-
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
Controller restart by switch_controller (minimal implementation) #1592
Open
TakashiSato
wants to merge
7
commits into
ros-controls:master
Choose a base branch
from
TakashiSato:feature/restart_controllers_minimal
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Controller restart by switch_controller (minimal implementation) #1592
TakashiSato
wants to merge
7
commits into
ros-controls:master
from
TakashiSato:feature/restart_controllers_minimal
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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
github-actions
bot
requested review from
aprotyas,
bmagyar,
DasRoteSkelett,
destogl,
olivier-stasse,
peterdavidfagan and
VX792
June 26, 2024 11:22
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.
|
This pull request is in conflict. Could you fix it @TakashiSato? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.