-
Notifications
You must be signed in to change notification settings - Fork 317
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
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 89.43% 89.42% -0.02%
==========================================
Files 138 139 +1
Lines 14794 14937 +143
Branches 1271 1283 +12
==========================================
+ Hits 13231 13357 +126
- Misses 1087 1101 +14
- Partials 476 479 +3
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
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.
I agree with this, considering that we merge #1801 very soon.
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