fix(ros2controlcli): use lifecycle nomenclature and add finalized sta…#3134
fix(ros2controlcli): use lifecycle nomenclature and add finalized sta…#3134shraavb wants to merge 3 commits intoros-controls:masterfrom
Conversation
…te to hardware component
There was a problem hiding this comment.
Thank you for submitting a PR.
The fixes of the if/elif branches and adding the finalized state are perfect, but I am not convinced from the rewording of the messages? I think this change is not needed.
I added a comment in the linked issue for clarification.
| help="State in which the controller should be changed to", | ||
| help=( | ||
| "State in which the controller should be changed to. " | ||
| "Valid lifecycle states are: unconfigured, inactive, active. " |
There was a problem hiding this comment.
Is this needed? The help already prints the valid arguments:
{unconfigured,inactive,active}
State in which the controller should be changed to
There was a problem hiding this comment.
Thanks for the feedback! I have reverted the help text change - you're right, the choices= already displays the valid arguments.
Kept the if/elif fixes and finalized state addition.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3134 +/- ##
==========================================
+ Coverage 89.32% 89.36% +0.04%
==========================================
Files 158 158
Lines 19497 19497
Branches 1584 1584
==========================================
+ Hits 17416 17424 +8
+ Misses 1428 1422 -6
+ Partials 653 651 -2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
de4d1c6 to
21ddb2c
Compare
Closes #688
Summary
Use ROS 2 lifecycle nomenclature consistently in the CLI and add the missing
finalizedstate toset_hardware_component_state.Changes
set_controller_state.pyunconfigured,deactivating)finalizedis reached viaunload_controllerset_hardware_component_state.pyfinalizedto valid choices usingState.PRIMARY_STATE_FINALIZEDif/if/if→if/elif/elif/eliffor correct branch structureNote on
finalizedfor controllersThe controller manager has no
FinalizeControllerservice, so controllers cannotbe directly transitioned to
finalizedvia this command. Hardware components can,since
SetHardwareComponentState.srvaccepts any lifecycle state by ID.Checklist
set_controller_stateshould support full lifecycle and use lifecycle nomenclature. #688