-
Notifications
You must be signed in to change notification settings - Fork 306
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
Fix the controller deactivation on the control cycles returning ERROR #1756
base: master
Are you sure you want to change the base?
Fix the controller deactivation on the control cycles returning ERROR #1756
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1756 +/- ##
=========================================
Coverage ? 87.27%
=========================================
Files ? 122
Lines ? 12253
Branches ? 1093
=========================================
Hits ? 10694
Misses ? 1163
Partials ? 396
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Could you please briefly summarize your solution for me? |
@christophfroehlich sure! Right now, we have the above issues because the prepare_command_switch and perform_command_swirch are not called when deactivating the controller. So, the hardware is not aware of the resources not being used any more. Now, I've added prepare_command_switch and perform_command_switch, so that the hardware will be aware of the changes and act accordingly. In our case, if the robot is EFFORT, FORCE or TORQUE control mode, we change the actuator to IDLE mode, if there are no more interfaces to activate for those motors. This way it is safer. Moreover, as now the hardware is aware of the deactivated resources, when you try to activate the same controller again or a different controller that uses different resources of that joint, it will be able to properly activate the controller. |
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.
Thanks for the explanation. The changes and the test looks fine for me.
This pull request is in conflict. Could you fix it @saikishor? |
0ffaacc
to
a648496
Compare
@@ -2466,6 +2486,26 @@ controller_interface::return_type ControllerManager::update( | |||
RCLCPP_ERROR( | |||
get_logger(), "Activating fallback controllers : [ %s]", controllers_string.c_str()); | |||
} | |||
std::vector<std::string> failed_controller_interfaces, fallback_controller_interfaces; | |||
failed_controller_interfaces.reserve(500); |
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.
Isn't this in the update method? Can we do this ahead of time?
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.
Right now, we are just deactivating the controllers when we have an ÈRROR` returned from the hardware or from the controller update cycles, but there could be 2 different issues with this approach:
EFFORT
mode it is not safe as any unsafe command it left in the interface and the hardware continues to maintain it. It is dangerous in some situationsThis PR proposes a solution for the above issues and a test is added to check for the proper functionality