-
Notifications
You must be signed in to change notification settings - Fork 334
Controller restart by switch_controller (minimal implementation) #1592
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
base: master
Are you sure you want to change the base?
Controller restart by switch_controller (minimal implementation) #1592
Conversation
…check from the beginning whenever there is a change in the (de)activate request (but use goto)
…the same controller name in the start/stop requests
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1592 +/- ##
==========================================
+ Coverage 87.70% 88.36% +0.66%
==========================================
Files 102 105 +3
Lines 8704 8262 -442
Branches 780 675 -105
==========================================
- Hits 7634 7301 -333
+ Misses 790 720 -70
+ Partials 280 241 -39
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This pull request is in conflict. Could you fix it @TakashiSato? |
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
This pull request is in conflict. Could you fix it @TakashiSato? |
This PR is related to #1568. Unlike it, this focuses on implementing the new restart controllers feature while minimizing changes to the master branch code. Additionally, this PR depends on #1591 and is expected to be merged after #1591 is merged.
Note: To focus on meaningful changes, it is recommended to compare the code using "hide whitespace" mode as follows.
https://github.com/ros-controls/ros2_control/compare/master...TakashiSato:ros2_control:feature/restart_controllers_minimal?diff=split&w=1
Explanation code changes
Since comparing the final code changes with the master branch is complicated due to the large number of changes, I'll explain the key points of each change in the order of the commits.
The changes up to commit number 005a79f are included in #1591, so I will only address the commits after that.
1. refactor (de)activate request checkrefactor (de)activate request check
In this commit, the following refactoring was performed:
CreateRequestResult
toCheckDeActivateRequestResult
and moved its definition from inside switch_controller to within the class definition in the header (private).clear_chained_mode_request
from inside switch_controller to a member function, and changed the part of clear_requests that performed the same processing to this function call.2. add to support restart operations in switch_controller by specifying the same controller name in the start/stop requests
This commit implements the restart controllers feature and its tests.
To achieve the behavior of restart (deactivating first and then activating), I mainly made changes in the followings:
deactivate_request
andactivate_request
to ensure requests for restart (deactivate first, then activate) are not rejected as invalid requests.chained_mode_request
duringmanage_switch
to process them in the order of from and to.reference_interfaces
can be used appropriately when the following controller is activated immediately after being deactivated, modified thedeactivate_controllers
function not to executemake_controller_reference_interfaces_unavailable
during restart requests.I made the following changes to the test implementation:
test_controller
test_chainable_controller
fix typo and unnecessary semicolon
This commit contains minor fixes.