Skip to content

Commit

Permalink
Add spawner namespacing and also add the missing --params-file path
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor authored and christophfroehlich committed Jul 29, 2024
1 parent 387a0b5 commit 59f1a08
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,18 @@ def generate_launch_description():
rrbot_1_position_trajectory_controller_spawner = Node(
package="controller_manager",
executable="spawner",
namespace="rrbot_1",
arguments=[
"position_trajectory_controller",
"-c",
"/rrbot_1/controller_manager",
"--inactive",
"--param-file",
PathJoinSubstitution(
[
FindPackageShare("ros2_control_demo_example_15"),
"config",
"multi_controller_manager_rrbot_1_controllers.yaml",
]
),
],
)

Expand All @@ -108,11 +115,18 @@ def generate_launch_description():
rrbot_2_position_trajectory_controller_spawner = Node(
package="controller_manager",
executable="spawner",
namespace="rrbot_2",
arguments=[
"position_trajectory_controller",
"-c",
"/rrbot_2/controller_manager",
"--inactive",
"--param-file",
PathJoinSubstitution(
[
FindPackageShare("ros2_control_demo_example_15"),
"config",
"multi_controller_manager_rrbot_2_controllers.yaml",
]
),
],
)

Expand Down
8 changes: 7 additions & 1 deletion example_15/bringup/launch/rrbot_base.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,13 @@ def generate_launch_description():
package="controller_manager",
executable="spawner",
namespace=namespace,
arguments=[robot_controller, "-c", controller_manager_name],
arguments=[
robot_controller,
"-c",
controller_manager_name,
"--param-file",
robot_controllers,
],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
11 changes: 7 additions & 4 deletions example_15/bringup/launch/rrbot_namespace.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,26 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "-c", "/rrbot/controller_manager"],
namespace="rrbot",
arguments=["joint_state_broadcaster"],
)

robot_forward_position_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["forward_position_controller", "-c", "/rrbot/controller_manager"],
namespace="rrbot",
arguments=["forward_position_controller", "--param-file", robot_controllers],
)

robot_position_trajectory_controller_spawner = Node(
package="controller_manager",
executable="spawner",
namespace="rrbot",
arguments=[
"position_trajectory_controller",
"-c",
"/rrbot/controller_manager",
"--inactive",
"--param-file",
robot_controllers,
],
)

Expand Down

0 comments on commit 59f1a08

Please sign in to comment.