-
Notifications
You must be signed in to change notification settings - Fork 422
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
Simulated clock subscriber is built for each node #2659
Comments
Currently btw, we can disable the clock thread via rclcpp/rclcpp/include/rclcpp/node_options.hpp Lines 303 to 309 in 9b65494
|
@fujitatomoya thank you for your feedback. I have a couple more questions though...
About the possibility of having a mixed configuration, with some nodes using sim time and others not, I think it is totally doable that the ones with sim time enabled share the clock sub if they are in the same process space, while the others that take system time don't. |
you mean more like crashed by
I do not think
this is good question. and yes. if clock thread is disabled, you need to spin this node with executor to update the simulation clock data.
I am not against this, we always can explore the possibility for better user experience. but i am just not sure enough how we can design this in detail. for example, there could be multiple contexts with different domain, in that case we just cannot bind the process global time source to every nodes in the process. and maybe i am missing more here... |
It is. There is one
I don't think we should try to design this sharing around multiple contexts; that is too hard. We could consider having all Nodes within a single Context share a clock thread, i.e. the clock thread would live in the Context (much like the |
We discussed this in the triage meeting yesterday. The suggested solution would be to add a way to pass a For our generic composition containers, we could add a global flag such that all components either share or don't share a single time source. For more complicated layouts (some nodes using sime, but not all), then these could be manage via manual composition like you are currently doing. Would this be a feature that you are interested in adding for the |
The manual override solution via I further propose to split implementation in two subsequent steps/smaller PRs:
In this moment, I do not know if I may have available bandwidth to implement this; maybe I can start at least to prototype the first step and share with you the draft PR for further discussion if you are ok with this. |
While profiling a big application of mine, made by static composition of 20+ nodes in the same executable, enabling
use_sim_time
makes 20+ threads spawn, each one with a clock subscriber.rclcpp/rclcpp/src/rclcpp/time_source.cpp
Lines 396 to 402 in 9b65494
Why wouldn't be possible to share among all nodes the clock subscription / the time source? This would bring down the count of clock subscriber threads to just one.
The text was updated successfully, but these errors were encountered: