-
Notifications
You must be signed in to change notification settings - Fork 167
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
ros2clifecycle_set and ros2service_call_change_state in lifecycle management is too slow. #779
Comments
May be the right way to manage lifecycle of a node is to write cpp lifecycle manager client? |
I am not sure if this is right for everyone, it depends on the use case and requirement. I am using 1th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz, and lifecycle_talker(w/o this line) can respond approximately 1 secnod. root@tomoyafujita:~/ros2_ws/colcon_ws# time ros2 lifecycle set /lc_talker activate
Transitioning successful
real 0m1.034s
user 0m0.592s
sys 0m0.976s
root@tomoyafujita:~/ros2_ws/colcon_ws# time ros2 lifecycle set /lc_talker deactivate
Transitioning successful
real 0m1.030s
user 0m0.547s
sys 0m0.997s
root@tomoyafujita:~/ros2_ws/colcon_ws# time ros2 lifecycle set /lc_talker activate
Transitioning successful
real 0m1.043s
user 0m0.583s
sys 0m0.916s
root@tomoyafujita:~/ros2_ws/colcon_ws# time ros2 lifecycle set /lc_talker deactivate
Transitioning successful
real 0m1.040s
user 0m0.588s
sys 0m0.971s I do not really know the requirement or expectation in performance perspective for this issue, but 1 second is reasonable for me. And this will also depends on the network configuration and node graph. the reason that
|
@fujitatomoya thanks for your quick reply.
My use case is that a manager of state machine would start a thread executing a launch.py to configure, activate, and deactivate some lifecycle nodes(with executing process And the launch thread often run into the error with
I see,
|
It has been tested that the There may be a system pitfall in the ros2cli and/or rclpy. |
This could be quicker for initialization, and i think sometimes we do this kind of init performance improvement like replacing scripts into compiled code. (e.g replace bash script into C compiled binary.) probably this is something makes your performance requirement. but i am not inclined to take this path for mainline, since this will increases burden for code maintenance. I think current
No i do not think so, it is not about how fast it is, but where it is implemented. Node graph comes from underlying rmw implementation, so this will not bypass the node list issue, i believe.
it just takes some time to check all the arguments are correct, such as node, topic and service names. |
from #582 (comment) Since rclcpp doesn't depend on daemon(graph cache), if rclcpp service client will bypass the issue(evidence from my test in #779 (comment)), the root cause would be in the daemon-graph-cache rather than rmw-graph. |
neither
i guess that this could be, it would be worth to try. |
Bug report
Required Info:
Steps to reproduce issue
the simple lifecycle node can be seen in https://github.com/micro-ROS/system_modes/tree/master/system_modes_examples
Additional information
repeated test of the same cmd can make it quicker, see the complete test log below
Thanks.
The text was updated successfully, but these errors were encountered: