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

[Spawner] Add support for wildcard entries in the controller param files (backport #1724) #1835

Merged
merged 1 commit into from
Nov 3, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Nov 2, 2024

This PR aims to add support for the wildcard entries for the controller config files. This is very helpful, for instance, if we need to load the joint_state_broadcaster or any other controllers to different CM namespaces, we could reuse the configuration of the controllers or broadcaster by just having them with a wildcard. If not, we must generate multiple configuration files for each namespaced controller manager.

I've also added tests to test the same architecture. I've also made some tests with ros2_control_demos, and it works well.

Reference: https://docs.ros.org/en/humble/Tutorials/Intermediate/Launch/Using-ROS2-Launch-For-Large-Projects.html#using-wildcards-in-yaml-files

Earlier approach:

/rrbot_1/position_trajectory_controller:
  ros__parameters:
    type: joint_trajectory_controller/JointTrajectoryController
    joints:
      - joint1
      - joint2

    command_interfaces:
      - position

    state_interfaces:
      - position

    state_publish_rate: 200.0 # Defaults to 50
    action_monitor_rate: 20.0 # Defaults to 20

    allow_partial_joints_goal: false # Defaults to false
    open_loop_control: true
    allow_integration_in_goal_trajectories: true
    constraints:
      stopped_velocity_tolerance: 0.01 # Defaults to 0.01
      goal_time: 0.0 # Defaults to 0.0 (start immediately)
  
  /rrbot_2/position_trajectory_controller:
  ros__parameters:
    type: joint_trajectory_controller/JointTrajectoryController
    joints:
      - joint1
      - joint2

    command_interfaces:
      - position

    state_interfaces:
      - position

    state_publish_rate: 200.0 # Defaults to 50
    action_monitor_rate: 20.0 # Defaults to 20

    allow_partial_joints_goal: false # Defaults to false
    open_loop_control: true
    allow_integration_in_goal_trajectories: true
    constraints:
      stopped_velocity_tolerance: 0.01 # Defaults to 0.01
      goal_time: 0.0 # Defaults to 0.0 (start immediately)

With this change, we can have one configuration as below and reuse it

/**/position_trajectory_controller:
  ros__parameters:
    type: joint_trajectory_controller/JointTrajectoryController
    joints:
      - joint1
      - joint2

    command_interfaces:
      - position

    state_interfaces:
      - position

    state_publish_rate: 200.0 # Defaults to 50
    action_monitor_rate: 20.0 # Defaults to 20

    allow_partial_joints_goal: false # Defaults to false
    open_loop_control: true
    allow_integration_in_goal_trajectories: true
    constraints:
      stopped_velocity_tolerance: 0.01 # Defaults to 0.01
      goal_time: 0.0 # Defaults to 0.0 (start immediately)

This is an automatic backport of pull request #1724 done by [Mergify](https://mergify.com).

Copy link
Contributor Author

mergify bot commented Nov 2, 2024

Cherry-pick of 83fff77 has failed:

On branch mergify/bp/humble/pr-1724
Your branch is up to date with 'origin/humble'.

You are currently cherry-picking commit 83fff77.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   controller_manager/doc/userdoc.rst
	modified:   controller_manager/test/test_controller_spawner_with_type.yaml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   controller_manager/controller_manager/controller_manager_services.py
	both modified:   controller_manager/test/test_spawner_unspawner.cpp
	both modified:   doc/release_notes.rst

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts label Nov 2, 2024
Copy link

codecov bot commented Nov 3, 2024

Codecov Report

Attention: Patch coverage is 51.80723% with 40 lines in your changes missing coverage. Please review.

Project coverage is 62.48%. Comparing base (bba0f0f) to head (d7119fe).
Report is 1 commits behind head on humble.

Files with missing lines Patch % Lines
controller_manager/test/test_spawner_unspawner.cpp 38.09% 5 Missing and 34 partials ⚠️
.../controller_manager/controller_manager_services.py 95.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           humble    #1835      +/-   ##
==========================================
- Coverage   62.54%   62.48%   -0.06%     
==========================================
  Files         108      108              
  Lines       12097    12156      +59     
  Branches     8198     8247      +49     
==========================================
+ Hits         7566     7596      +30     
- Misses        877      881       +4     
- Partials     3654     3679      +25     
Flag Coverage Δ
unittests 62.48% <51.80%> (-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_services.py 76.56% <95.00%> (+4.14%) ⬆️
controller_manager/test/test_spawner_unspawner.cpp 54.93% <38.09%> (-2.47%) ⬇️

@saikishor saikishor merged commit ac9f005 into humble Nov 3, 2024
10 of 12 checks passed
@saikishor saikishor deleted the mergify/bp/humble/pr-1724 branch November 3, 2024 20:34
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.

2 participants