-
Notifications
You must be signed in to change notification settings - Fork 1
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
Construction of transform listener #187
Comments
Ah, very interesting, good catch. If every component with a transform listener is creating a new node and new executor, that adds a bit of complexity to the ros graph. Using the parent node certainly makes a lot of sense. Regarding the
In principle, it might be nice to use the existing executor for tf listeners - it means we don't rely on the kernel to resolve multithreaded scheduling but instead place the duty on the Executor (which, with the EventsExecutor, is very capable of handling such tasks and would give more control or access for debugging / profiling if needed). But, based on the implementation of the TF listener class, we aren't able to split the logic; we either use the parent executor and have the tf listeners in the default callback group (not ideal, because then they won't be executed in parallel even though they could be), or we have them in a new callback group but also executed by a new thread. Also, the Python executor is still pretty awful so adding tf callbacks even in a separate callback group could bog it down regardless. What we can take away from this is that the transform listener class is threadsafe in any case, so apart from the scheduling logic, spinning it in the background threaed is functionally equivalent to spinning it in parallel in a separate callback group of the main thread. TL;DR, I would pass the parent node interface to the constructor and keep |
That sounds good! |
I think we should consider benchmarking how this behaves as True, since we noticed executor performance issues with Python components that were specifically noticeable with TF (manifesting as jittery frames which could be caused by blocked execution) |
Since I was looking a bit closer into
tf2_ros
I saw that there are actually several ways to construct theTransformListener
. Note that we are currently doing that in modulo:However, this constructor creates yet another node under the hood, one that we can see as
transform_listener_impl_XXX
. I don't know why I never questioned this but there is this constructor that takes the node as argument. I believe we should at least give the transform listener access to the node to avoid an additional one being created.Additionally, there is also the
spin_thread
argument that defaults totrue
, see what it does here. It does create another executor under the hood but here I'm not sure if that is a good thing or not.What do you think @eeberhard @bpapaspyros ?
The text was updated successfully, but these errors were encountered: