Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce managed transform buffer to geometry2 #758

Open
amadeuszsz opened this issue Feb 6, 2025 · 0 comments
Open

Introduce managed transform buffer to geometry2 #758

amadeuszsz opened this issue Feb 6, 2025 · 0 comments

Comments

@amadeuszsz
Copy link

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
    TimeCacheInterfacePtr frame = getFrame(frame_number);
  • Update user TFs requests history (whether static only so far or not) somewhere here
    rotation_out = accum.result_quat;
    This include traverse algorithm over tf tree to see if all TFs between target_frame -> source_frame are is_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant