Repository navigation
Give the controller spawners a parameter file (backport #3851) - #3869
Conversation
|
Cherry-pick of 4bdbde2 has failed: 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 |
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
This pull request is merged. |
* moveit_configs_utils: give the controller spawners a parameter file generate_spawn_controllers_launch starts each spawner with only the controller name. The controller_manager node reads ros2_controllers.yaml, but the controller nodes do not read it. Each controller therefore starts with no parameters and fails to initialize. The user can plan a motion, but the user cannot run it. The spawner program has a --param-file option. The option loads the file into the controller node before configuration. This commit gives the option to each spawner. generate_demo_launch already uses the same path convention for the ros2_control_node. This commit reuses that convention. The code omits the option if the file does not exist, so a config package without ros2_controllers.yaml keeps the old behavior. Co-Authored-By: Claude Opus 5 <[email protected]> * Give a parameter file to the controller spawners in this repository The utility function now has callers, but 12 launch files in this repository create their spawners directly. They have the same defect, so this commit corrects them too. Four moveit_servo demo launch files spawn the same controllers that generate_spawn_controllers_launch() creates, and they use the same configuration package. They now call the utility function instead. The utility function takes an optional controller_manager_timeout, because these demos start the controller manager themselves and must wait longer than the default. The other eight launch files cannot use the utility function without a change of behavior: * prbt_moveit_config and the hybrid planning test spawn panda_joint_group_position_controller, which is not the controller in moveit_controllers.yaml. * The move_group tests also spawn panda_hand_controller. * The remaining tests stage each spawner with a TimerAction or an event handler, which the utility function does not reproduce. Each of those files gets --param-file directly. Every file already holds the correct path in ros2_controllers_path. Co-Authored-By: Claude Opus 5 <[email protected]> * prbt_moveit_config: spawn the controller that the configuration defines demo.launch.py spawns panda_joint_group_position_controller. The variable that holds the node is named prbt_arm_controller_spawner, and prbt_ros_controllers.yaml defines prbt_arm_controller, not the panda one. prbt_controllers.yaml also maps MoveIt to prbt_arm_controller. The requested controller therefore has no type and cannot load. This commit spawns prbt_arm_controller. This defect is older than this branch. It became visible once the spawner received the parameter file. Co-Authored-By: Claude Opus 5 <[email protected]> * trajectory_cache: give the spawners a parameter file The two trajectory_cache fixtures start their spawners with ExecuteProcess and a shell command, not with a Node action. The earlier commits looked only for the Node form, so these two files kept the defect. Both files already hold the correct path in ros2_controllers_path. Co-Authored-By: Claude Opus 5 <[email protected]> * trajectory_cache: pass the spawner command as an argument list The previous commit put the parameter file path into a shell command string. A path that holds a space or a shell metacharacter would split before --param-file received it. These two fixtures were the only launch files in the repository that ran a shell. Every other launch file gives an argument list to a Node action. This commit gives ExecuteProcess an argument list as well, so no shell reads the path and no quoting is necessary. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]> (cherry picked from commit 4bdbde2)
78a9e4a to
fcbea81
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## jazzy #3869 +/- ##
==========================================
+ Coverage 46.35% 46.38% +0.04%
==========================================
Files 718 718
Lines 59255 59267 +12
Branches 7611 7612 +1
==========================================
+ Hits 27459 27484 +25
+ Misses 31630 31618 -12
+ Partials 166 165 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
The controller spawners do not receive a parameter file. The
controller_managernode readsros2_controllers.yaml, but the controller nodes do not read it. Each controller therefore starts with no parameters, and initialization fails:The user can plan a motion in RViz, but the user cannot run the motion. The Execute button has no action server to call.
The
spawnerprogram has a--param-fileoption that loads the file into the controller node before configuration. This pull request gives that option to every spawner that MoveIt starts.Changes
1.
moveit_configs_utils.launches.generate_spawn_controllers_launch()Passes
--param-filewith theros2_controllers.yamlof the configuration package.generate_demo_launch()already uses that path convention for theros2_control_node. The option is omitted when the file does not exist, so a configuration package without one keeps its present behavior.The function also takes an optional
controller_manager_timeoutfor callers that start the controller manager in the same launch file.The callers of this function are generated, not committed: MoveIt Setup Assistant offers a "Spawn Controllers Launch" bundle (
moveit_setup_app_plugins/src/launches.cpp:66), andtemplates/launch/generic.launch.py.templatewrites a launch file whose body isreturn generate_spawn_controllers_launch(moveit_config). Every generated configuration package therefore calls it.2. Four
moveit_servodemo launch files now call that functiondemo_joint_jog,demo_pose,demo_ros_apianddemo_twistspawn exactly the controllers the function creates, from the same configuration package, so the call is equivalent. They keep their 300 second wait through the new argument.3. Eight further launch files receive
--param-filedirectlyThe function would change the behavior of these, so they keep their own spawners:
prbt_moveit_config/launch/demo.launch.py,hybrid_planning/test/launch/test_basic_integration.test.pypanda_joint_group_position_controller, not the controller inmoveit_controllers.yamlplanning_interface/test/launch/move_group_launch_test_common.py,tests/launch/move_group_api.test.pypanda_hand_controllerplanning_scene_monitor.test.py,servo_{cpp,ros}_integration.test.py,servo_utils.test.pyTimerActionor an event handlerThat is 18 spawners across 12 files. Every file already holds the correct path in
ros2_controllers_path.Testing
Ubuntu 26.04 (Resolute), ROS 2 Lyrical binary packages, MoveIt 2.15.0 from the build farm.
ros2 launch moveit_servo demo_ros_api.launch.pybefore the change:Failed loading controller panda_arm_controller, no active controller.After:
The same correction on
moveit_resources(moveit/moveit_resources#221) brings all three Panda controllers toactiveand makes/panda_arm_controller/follow_joint_trajectoryand/panda_hand_controller/gripper_cmdavailable, so trajectory execution works again.I also confirmed that each changed launch description still builds, and that
ros2_controllers_pathis in scope at all 18 spawners.Note on the tests
The CI log of the first run shows a controller failing to initialize while the test still passes:
The
_with_move_grouptests therefore run today without an active controller. This pull request starts the controllers; a test that fails afterwards was failing silently before.Related
moveit_resourceshas the same defect in its hand-written demo launch files: moveit/moveit_resources#221.Checklist
🤖 Generated with Claude Code
Summary by CodeRabbit
This is an automatic backport of pull request #3851 done by [Mergify](https://mergify.com).