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

[Feature] Interfaces remapping for controllers #1667

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

Conversation

saikishor
Copy link
Member

This PR aims to add a new features to the controllers so that they will be able to remap interfaces, this would be interesting to have as for interfaces such as effort the hardware could expose more meaningful interfaces such as torque, force or current and it would get the logic of the controller more complicated if they need to support multiple type of interfaces. Instead the users should be able to remap as simply by defining the remapping definition under the controller's parameters

controller_joint2:
  ros__parameters:
    type: "controller_manager/test_controller_with_interfaces"
    joint_name: "joint2"
    remap:
      state_interfaces:
        "joint2/effort": "joint2/torque"
      command_interfaces:
        "joint2/effort": "joint2/torque"

The controller prints some more explicit log when configuring the controller, so that the user are clear on what interfaces are being remapped

1: [INFO] [1723486187.875195738] [test_controller_manager]: Configuring controller 'controller_joint3'
1: [WARN] [1723486187.875569719] [controller_joint3]: The controller : controller_joint3 will remap the following state interfaces:
1: [WARN] [1723486187.875584819] [controller_joint3]: 	'joint3/effort' to 'joint3/force'
1: [WARN] [1723486187.875615433] [controller_joint3]: The controller : controller_joint3 will remap the following command interfaces:
1: [WARN] [1723486187.875621793] [controller_joint3]: 	'joint3/effort' to 'joint3/force'

Related to ros-controls/roadmap#61

Copy link

codecov bot commented Aug 12, 2024

Codecov Report

Attention: Patch coverage is 95.38462% with 6 lines in your changes missing coverage. Please review.

Project coverage is 87.79%. Comparing base (d55def1) to head (836de9a).

Files with missing lines Patch % Lines
...roller_interface/src/controller_interface_base.cpp 87.80% 0 Missing and 5 partials ⚠️
controller_manager/src/controller_manager.cpp 95.23% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1667      +/-   ##
==========================================
+ Coverage   87.62%   87.79%   +0.16%     
==========================================
  Files         120      121       +1     
  Lines       12217    12327     +110     
  Branches     1093     1115      +22     
==========================================
+ Hits        10705    10822     +117     
+ Misses       1123     1109      -14     
- Partials      389      396       +7     
Flag Coverage Δ
unittests 87.79% <95.38%> (+0.16%) ⬆️

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

Files with missing lines Coverage Δ
...controller_interface/controller_interface_base.hpp 92.30% <ø> (ø)
...ger/include/controller_manager/controller_spec.hpp 100.00% <100.00%> (ø)
...ller_manager/test/test_controller_manager_srvs.cpp 99.26% <100.00%> (ø)
...ith_interfaces/test_controller_with_interfaces.cpp 100.00% <100.00%> (+20.00%) ⬆️
...ith_interfaces/test_controller_with_interfaces.hpp 100.00% <100.00%> (ø)
...ler_manager/test/test_hardware_management_srvs.cpp 98.56% <ø> (ø)
...ontroller_manager/test/test_release_interfaces.cpp 92.30% <100.00%> (+4.80%) ⬆️
...ace_testing/test/test_components/test_actuator.cpp 92.85% <100.00%> (+1.19%) ⬆️
...e_interface_testing/test/test_resource_manager.cpp 99.32% <ø> (ø)
controller_manager/src/controller_manager.cpp 78.21% <95.23%> (+0.04%) ⬆️
... and 1 more

... and 6 files with indirect coverage changes

Copy link
Contributor

mergify bot commented Aug 21, 2024

This pull request is in conflict. Could you fix it @saikishor?

Copy link
Contributor

mergify bot commented Aug 26, 2024

This pull request is in conflict. Could you fix it @saikishor?

@saikishor saikishor force-pushed the feat/interface/remapping branch from a3ef839 to 0d6f733 Compare October 8, 2024 17:41
Copy link
Contributor

mergify bot commented Oct 17, 2024

This pull request is in conflict. Could you fix it @saikishor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant