-
Notifications
You must be signed in to change notification settings - Fork 310
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 CM switch_controller
service timeout as parameter to spawner.py
#1790
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1790 +/- ##
=======================================
Coverage 88.01% 88.01%
=======================================
Files 121 121
Lines 12412 12416 +4
Branches 1109 1109
=======================================
+ Hits 10924 10928 +4
Misses 1083 1083
Partials 405 405
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my point of view it isn't really clear from a user's perspective, what the difference between these two timeouts is.
Also: Wouldn't it make sense to default to 0.0 with both of them? This can probably also happen when activation of a hardware component fails, right?
Thanks for the feedback.
The old one ros2_control/controller_manager/controller_manager/controller_manager_services.py Lines 79 to 80 in 0433960
while the new one Any suggestions for a better name?
5s was the hardcoded value before, 0s as switch_controller timeout will be overridden with 1s in the CM, I'm not sure which value is the best here.
No, this value is only used for the switch_controller service. |
I see, that does make sense. I was not aware of that, sorry. So the problem is not that this particular service isn't available, but the CM itself doesn't manage to do the requested switch within the requested time. I think the name might be fine, but the docstring / the output could explain that better. My main motivation is: If "the average user" would stumble into ros-controls/gz_ros2_control#421, would she know that this timeout has to be increased? And wouldn't it make sense to allow an infinite amount of time for such as case? This way, users could specify the switch time for their spawners to infinity in launchfiles that start gz in paused mode. |
you are totally right, I try to come up with something.
@saikishor what do you think, can we switch the CM behavior to wait infinitely if the time is set to 0? |
Switching this wouldn't be a big issue in terms of code, but I think it is better to stick to a constant value and let the people play with it. If we leave it to infinity, if for some reason, it is blocked, we cannot access any other services at all. This would be a huge cumbersome to debug in my opinion |
@christophfroehlich @fmauch How about |
ok, so do you prefer to set the default in the spawner to the same like in the cm? |
It can be different I don't mind, what I don't prefer to avoid is infinite waiting with no timeout at all. Usually, it needs to happen immediately in the same cycle. |
I just tried it with unpaused gz. and with a timeout of 1s it fails: it needs more time from the plugin loading until the simulation runs. |
Co-authored-by: Felix Exner (fexner) <[email protected]>
Co-authored-by: Felix Exner (fexner) <[email protected]>
This pull request is in conflict. Could you fix it @christophfroehlich? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request is in conflict. Could you fix it @christophfroehlich? |
This pull request is in conflict. Could you fix it @christophfroehlich? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request is in conflict. Could you fix it @christophfroehlich? |
…#1790) Co-authored-by: Felix Exner (fexner) <[email protected]> Co-authored-by: Sai Kishor Kothakota <[email protected]> (cherry picked from commit 23bd1c3) # Conflicts: # controller_manager/doc/userdoc.rst # doc/release_notes.rst
This is a workaround for ros-controls/gz_ros2_control#421 and ros-controls/gazebo_ros2_control#380
If the simulation is started in paused mode, one can now configure also the timeout for the switch_controller service to be completed (the simulation has to be unpaused to perform the controller switches).
Also fixes docs after changes to the spawners in #1562