Skip to content
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 spawner behaviour on failing controller activation or deactivation #1941

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

saikishor
Copy link
Member

@saikishor saikishor commented Dec 14, 2024

Before the fix proposed in this PR, the spawner reports the controller activation as successful, if the activation is failed at the last stage after calling activate_controllers. This PR addresses the issue by proposing a fix and this should now properly fail at the spawner end as well

Before the fix:

1: [INFO] [1734338012.820800005] [test_controller_manager]: Activating controllers: [ ctrl_with_joint1_and_joint2_command_interfaces ]
1: [ERROR] [1734338012.829138606] [test_controller_manager]: Resource conflict for controller 'ctrl_with_joint1_and_joint2_command_interfaces'. Command interface 'joint1/position' is already claimed.
1: [INFO] [1734338012.830469222] [spawner_ctrl_with_joint1_and_joint2_command_interfaces]: Configured and activated ctrl_with_joint1_and_joint2_command_interfaces

With the proposed fix:

1: [INFO] [1734338233.806072093] [test_controller_manager]: Activating controllers: [ ctrl_with_joint1_and_joint2_command_interfaces ]
1: [ERROR] [1734338233.814172942] [test_controller_manager]: Resource conflict for controller 'ctrl_with_joint1_and_joint2_command_interfaces'. Command interface 'joint1/position' is already claimed.
1: [ERROR] [1734338233.814291503] [test_controller_manager]: Could not activate controller : 'ctrl_with_joint1_and_joint2_command_interfaces'
1: [ERROR] [1734338233.817168509] [spawner_ctrl_with_joint1_and_joint2_command_interfaces]: Failed to activate controller : ctrl_with_joint1_and_joint2_command_interfaces

Copy link

codecov bot commented Dec 15, 2024

Codecov Report

Attention: Patch coverage is 80.35714% with 11 lines in your changes missing coverage. Please review.

Project coverage is 87.71%. Comparing base (7374c43) to head (7805687).

Files with missing lines Patch % Lines
controller_manager/src/controller_manager.cpp 63.15% 5 Missing and 2 partials ⚠️
...r_manager/test/test_controller/test_controller.cpp 75.00% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1941      +/-   ##
==========================================
- Coverage   87.73%   87.71%   -0.02%     
==========================================
  Files         122      122              
  Lines       13010    13065      +55     
  Branches     1165     1171       +6     
==========================================
+ Hits        11414    11460      +46     
- Misses       1165     1169       +4     
- Partials      431      436       +5     
Flag Coverage Δ
unittests 87.71% <80.35%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
controller_manager/controller_manager/spawner.py 75.38% <ø> (+2.30%) ⬆️
...ontroller_manager/test/test_release_interfaces.cpp 87.50% <ø> (ø)
controller_manager/test/test_spawner_unspawner.cpp 96.65% <100.00%> (+0.17%) ⬆️
...r_manager/test/test_controller/test_controller.cpp 90.47% <75.00%> (-5.27%) ⬇️
controller_manager/src/controller_manager.cpp 76.12% <63.15%> (-0.27%) ⬇️

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (At least the test you've written makes totally sense.)

controller_manager/test/test_spawner_unspawner.cpp Outdated Show resolved Hide resolved
@saikishor saikishor added the backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble. label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants