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

Add tf2_ros::async_wait_for_transform() #117

Closed
wants to merge 1 commit into from

Conversation

sloretz
Copy link
Contributor

@sloretz sloretz commented Jun 12, 2019

This PR adds tf2_ros::async_wait_for_transform(). It calls a callback when a transform is ready. This avoids creating a dedicated node and thread for each transform listener, and it works even if the executor is single threaded.

Internally it creates a timer with a callback that polls for the transform. If it becomes available before the timeout then the user's callback is called with the transform. If a timeout occurs then the tf2 exception is set on the returned future.

This PR also adds a class tf2_ros::GatedCallbackCaller. It waits for a bunch of transforms in parallel, and calls one callback once all of them are ready.

This function allows waiting for transforms without blocking an executor
or spinning up a dedicated node and thread.
Also included is a class GatedCallbackCaller that makes it easier to
wait until a bunch of transforms are ready.

Signed-off-by: Shane Loretz<sloretz@openrobotics.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
@sloretz sloretz added enhancement New feature or request in review Waiting for review (Kanban column) labels Jun 12, 2019
@sloretz sloretz self-assigned this Jun 12, 2019
@jacobperron
Copy link
Member

@sloretz Take a look at #121, where I also introduce an asynchronous method for waiting on transforms. It's possible it can be a replacement for this PR, but I'm not sure.

@nuclearsandwich
Copy link
Member

@sloretz were you able to evaluate #121 as a replacement for this PR?

@sloretz
Copy link
Contributor Author

sloretz commented Aug 8, 2019

Seems like #121 implemented the same feature a different way. Closing.

@sloretz sloretz closed this Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in review Waiting for review (Kanban column)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants