Registry / serialization / foxglove-schemas-protobuf

foxglove-schemas-protobuf

JSON →
library0.3.0pypypi✓ verified 35d ago

This library provides precompiled Protocol Buffer (protobuf) schemas for Foxglove, a web-based visualization and debugging tool for robotics. It allows Python applications to serialize and deserialize data according to Foxglove's standardized message definitions, facilitating interoperability within the Foxglove ecosystem. The current version is 0.3.0, and updates typically align with new schema definitions released by the broader Foxglove SDK.

serialization
Install & Compatibility
Where this runs
tested against v0.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.285s · 19.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 2.0s · import 0.058s · 21MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Generated protobuf messages are typically within a `_pb2` module.

from foxglove_schemas_protobuf.FrameTransform_pb2 import FrameTransform

Common protobuf types like Timestamp are part of the `google.protobuf` package, not directly from `foxglove_schemas_protobuf`.

from google.protobuf.timestamp_pb2 import Timestamp

This example demonstrates how to create, serialize, and deserialize a `FrameTransform` message using the `foxglove-schemas-protobuf` library. It includes importing the specific message class and a common Google Protobuf type like `Timestamp`.

from foxglove_schemas_protobuf.FrameTransform_pb2 import FrameTransform from google.protobuf.timestamp_pb2 import Timestamp # Create a Timestamp ts = Timestamp() ts.seconds = 1678886400 # Example: March 15, 2023 12:00:00 PM UTC ts.nanos = 123456789 # Create a FrameTransform message transform = FrameTransform( timestamp=ts, parent_frame_id="base_link", child_frame_id="tool0", translation_x=1.0, translation_y=0.5, translation_z=0.2, rotation_x=0.0, rotation_y=0.0, rotation_z=0.0, rotation_w=1.0 ) # Serialize to bytes serialized_data = transform.SerializeToString() print(f"Serialized FrameTransform data length: {len(serialized_data)} bytes") # Deserialize from bytes deserialized_transform = FrameTransform() deserialized_transform.ParseFromString(serialized_data) print(f"\nDeserialized Parent frame: {deserialized_transform.parent_frame_id}") print(f"Deserialized Child frame: {deserialized_transform.child_frame_id}") print(f"Deserialized Timestamp: {deserialized_transform.timestamp.seconds}.{deserialized_transform.timestamp.nanos}") assert deserialized_transform.parent_frame_id == "base_link" assert deserialized_transform.translation_x == 1.0
Debug
Known footguns
gotchaThe `foxglove-schemas-protobuf` Python package may lag behind schema updates in other Foxglove SDK languages (TypeScript, C++, Rust). If you're working with the latest schema definitions in other environments, ensure your Python package version is compatible or sufficiently recent.
gotchaIncompatibility with the `protobuf` library version. Protobuf generated code is sensitive to the version of the `protobuf` runtime library installed. Mismatched versions can lead to serialization/deserialization errors or unexpected behavior.
gotchaSchema definition changes between `foxglove-schemas-protobuf` versions. While Protobuf is designed for backward compatibility, changes like renaming fields, altering field types, or modifying enum values can lead to `AttributeError` during access or `DecodeError` during deserialization if an older client tries to parse data from a newer schema (or vice-versa).
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
11 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
bingbot
1
chatgpt-user
1
Resources