Introduce managed transform buffer to geometry2
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 153
- Forks
- 256
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 14
Description
Recently I was trying to address issue for high CPU load in runtime with many TF listeners in ROS graph. As a result I developed a wrapper for TF listener & buffer, please see https://github.com/autowarefoundation/ManagedTransformBuffer.
We already have static TF listener in geometry2, but Managed Transform Buffer acts as dynamic / static listener automatically. It's convenient approach for users if input frames are defined as parameters. Moreover, in case of static TFs requests only, there is no dangling tf_listener_impl_xxxxxxxx node - we use local buffer, TF listening happens only for first TF pairs requests.
There is one intuitive assumption. Once static TF requested, transform is constant. This TF will already exists in local buffer and listener is not initialized anymore (note: we can add external local buffer reset via service for users if needed).
Implementation handles two nodes. If we could place it in geometry2 with tiny API update, we might reduce it to a single node. To make it true, we need to:
- Fill local map with incoming transforms somewhere here https://github.com/ros2/geometry2/blob/24a8b9a1433220775c186cc7ef556972c6ca5402/tf2/src/buffer_core.cpp#L274
- Update user TFs requests history (whether static only so far or not) somewhere here https://github.com/ros2/geometry2/blob/24a8b9a1433220775c186cc7ef556972c6ca5402/tf2/src/buffer_core.cpp#L851 This include traverse algorithm over tf tree to see if all TFs between
target_frame->source_frameareis_static. - Add new public method to retrieve information e.g.
hasStaticTFsRequestsOnly(). - Rewrite new class for Managed Transform Buffer without extra features (e.g. eigen repr, transforming pointcloud etc.) and place it in tf2_ros.
Overhead is negligible, benefits visible. You can also see performance test for one of our component related issue. My motivation for this contribution is fact that ROS community values more packages maintaining rather than new packages. Before starting this contribution, I would like to know if these changes within tf2 are acceptable for rolling and possibly backporting to humble & jazzy.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the referenced locations in tf2/src/buffer_core.cpp and the ManagedTransformBuffer repository, then inspect the tf2_ros package structure and public API conventions. Done requires maintainer agreement on the API and scope, plus an implementation that covers static-transform request tracking and the proposed local buffering behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- robotics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100