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 7 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 88.20%. Comparing base (612b30b) to head (b436a4e).

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   88.13%   88.20%   +0.06%     
==========================================
  Files         121      121              
  Lines       13163    13215      +52     
  Branches     1183     1189       +6     
==========================================
+ Hits        11601    11656      +55     
+ Misses       1129     1126       -3     
  Partials      433      433              
Flag Coverage Δ
unittests 88.20% <80.35%> (+0.06%) ⬆️

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 74.81% <ø> (+2.22%) ⬆️
...ontroller_manager/test/test_release_interfaces.cpp 87.50% <ø> (ø)
controller_manager/test/test_spawner_unspawner.cpp 96.72% <100.00%> (+0.16%) ⬆️
...r_manager/test/test_controller/test_controller.cpp 88.05% <75.00%> (-4.10%) ⬇️
controller_manager/src/controller_manager.cpp 76.20% <63.15%> (-0.13%) ⬇️

... and 2 files with indirect coverage changes

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
bmagyar
bmagyar previously approved these changes Dec 19, 2024
Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

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

Thank you!!

@christophfroehlich christophfroehlich dismissed stale reviews from bmagyar and themself via b436a4e December 19, 2024 10:01
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.

3 participants