feat(tf): add ros-z-tf crate with TF2 listener, broadcaster, and buffer#178
Closed
YuanYuYuan wants to merge 12 commits into
Closed
feat(tf): add ros-z-tf crate with TF2 listener, broadcaster, and buffer#178YuanYuYuan wants to merge 12 commits into
YuanYuYuan wants to merge 12 commits into
Conversation
Introduces `ros-z-tf`, a pure-Rust TF2 listener and transform buffer that subscribes to `/tf` and `/tf_static`, maintains a frame tree, and provides `lookup_transform` with multi-hop LCA traversal and linear/slerp interpolation. Public API: - `Buffer::new(node)` — subscribes to /tf (Volatile) and /tf_static (TransientLocal) - `Buffer::lookup_transform(target, source, time)` — LCA-based chain composition - `Buffer::can_transform(target, source, time)` — non-panicking availability check - `Buffer::all_frames()` — enumerate known frame IDs - `LookupError` — UnknownFrame, NoCommonAncestor, ExtrapolationError Also adds `tf2_msgs` message definitions to ros-z-codegen assets and extends `GeneratorConfig` with `protobuf_excluded_packages` to handle packages whose cross-package array fields cannot be represented in protobuf (e.g. `geometry_msgs/TransformStamped[]` in TFMessage).
…sform, lookup_transform_full - ros-z core: declare PublicationCache alongside ZPub for TransientLocal publishers; use QueryingSubscriber (FetchingSubscriber) for TransientLocal subscribers so late joiners receive previously published data - ros-z-tf: add TransformBroadcaster (/tf, Volatile) and StaticTransformBroadcaster (/tf_static, TransientLocal) - ros-z-tf: add wait_for_transform (async, notified on each add_message) with WaitError::Timeout and WaitError::Lookup variants - ros-z-tf: add lookup_transform_full for fixed-frame two-time lookups - remove #[ignore] from tf_static_transient_local_replayed_on_connect - 8 integration tests pass, 28 unit tests pass
…rder, optional wait timeout - StaticTransformBroadcaster zeroes all timestamps before publishing (tf2 spec requires sec=0, nanosec=0 on /tf_static for ROS 2 interop) - lookup_transform_full reordered to (target, target_time, source, source_time, fixed_frame) matching tf2 C++ and roslibrust APIs - wait_for_transform now takes Option<Duration>; None falls back to the buffer's default duration (10 s) - Document intentional separation of Buffer and broadcaster types
|
Codecov Report❌ Patch coverage is
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…y codegen filter - QosHistory::KeepAll was mapped to usize::MAX for PublicationCache ring buffer capacity, which would OOM on first transient-local publisher; cap at 1000 entries to match tf2 buffer convention - tf-tests feature no longer hardcodes ros-z-tf/jazzy; distro propagation uses '?' syntax so it only activates when the optional dep is enabled - generate_protobuf_types always filters excluded packages via one-liner instead of a split-variable conditional
…t_naming Adds digit→uppercase split so Int8MultiArray→Int8MultiArray and ensures TFMessage→TfMessage matches what prost_build generates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ros-z-tf— pure-Rust TF2 transform listener and buffer for ros-z/tf(Volatile) and/tf_static(TransientLocal) with automatic replay for late-joining subscribersTransformBroadcasterandStaticTransformBroadcasterfor publishing transformswait_for_transformasync wait withOption<Duration>timeout (defaults to 10 s)lookup_transform_fullfor tf2 "time travel" lookups through a fixed frameros-z-tests --features tf-testsKey Changes
crates/ros-z-tf/— new crate withBuffer,TransformBroadcaster,StaticTransformBroadcaster, LCA lookup, slerp/lerp mathcrates/ros-z/src/pubsub.rs— TransientLocal replay viaPublicationCache+FetchingSubscriber(zenoh-ext)crates/ros-z-msgs/— addedtf2_msgsfeature withTFMessagecrates/ros-z-codegen/— excludestf2_msgsfrom protobuf (cross-package array fields unsupported)crates/ros-z-tests/— integration tests undertf-testsfeature flagAPI
Breaking Changes
None — new crate, no changes to existing public APIs.