Skip to content

Commit

Permalink
Add --param-file to the spawners
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Jul 29, 2024
1 parent 1ac5e13 commit e9a33fd
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 34 deletions.
4 changes: 2 additions & 2 deletions example_1/bringup/launch/rrbot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["forward_position_controller", "--controller-manager", "/controller_manager"],
arguments=["forward_position_controller", "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
6 changes: 3 additions & 3 deletions example_10/bringup/launch/rrbot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

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

gpio_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["gpio_controller", "-c", "/controller_manager"],
arguments=["gpio_controller", "--param-file", robot_controllers],
)

# Delay start of robot_controller after `joint_state_broadcaster`
Expand Down
4 changes: 2 additions & 2 deletions example_11/bringup/launch/carlikebot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_bicycle_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["bicycle_steering_controller", "--controller-manager", "/controller_manager"],
arguments=["bicycle_steering_controller", "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
14 changes: 12 additions & 2 deletions example_12/bringup/launch/launch_chained_controllers.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,31 @@
from launch import LaunchDescription
from launch.actions import RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.substitutions import PathJoinSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():

robot_controllers = PathJoinSubstitution(
[
FindPackageShare("ros2_control_demo_example_12"),
"config",
"rrbot_chained_controllers.yaml",
]
)

position_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["position_controller", "--controller-manager", "/controller_manager"],
arguments=["position_controller", "--param-file", robot_controllers],
)

forward_position_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["forward_position_controller", "--controller-manager", "/controller_manager"],
arguments=["forward_position_controller", "--param-file", robot_controllers],
)

# Delay start of forward_position_controller_spawner after `position_controller_spawner`
Expand Down
6 changes: 3 additions & 3 deletions example_12/bringup/launch/rrbot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

j1_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint1_position_controller", "--controller-manager", "/controller_manager"],
arguments=["joint1_position_controller", "--param-file", robot_controllers],
)

j2_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint2_position_controller", "--controller-manager", "/controller_manager"],
arguments=["joint2_position_controller", "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=[robot_controller, "--controller-manager", "/controller_manager"],
arguments=[robot_controller, "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
4 changes: 2 additions & 2 deletions example_2/bringup/launch/diffbot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["diffbot_base_controller", "--controller-manager", "/controller_manager"],
arguments=["diffbot_base_controller", "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=[robot_controller, "--controller-manager", "/controller_manager"],
arguments=[robot_controller, "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
6 changes: 3 additions & 3 deletions example_4/bringup/launch/rrbot_system_with_sensor.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,20 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["forward_position_controller", "--controller-manager", "/controller_manager"],
arguments=["forward_position_controller", "--param-file", robot_controllers],
)

# add the spawner node for the fts_broadcaster
fts_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["fts_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["fts_broadcaster", "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,20 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["forward_position_controller", "--controller-manager", "/controller_manager"],
arguments=["forward_position_controller", "--param-file", robot_controllers],
)

# add the spawner node for the fts_broadcaster
fts_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["fts_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["fts_broadcaster" "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
4 changes: 2 additions & 2 deletions example_6/bringup/launch/rrbot_modular_actuators.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=[robot_controller, "--controller-manager", "/controller_manager"],
arguments=[robot_controller, "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
4 changes: 2 additions & 2 deletions example_7/bringup/launch/r6bot_controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["r6bot_controller", "-c", "/controller_manager"],
arguments=["r6bot_controller", "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=[robot_controller, "--controller-manager", "/controller_manager"],
arguments=[robot_controller, "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
4 changes: 2 additions & 2 deletions example_9/bringup/launch/rrbot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["forward_position_controller", "--controller-manager", "/controller_manager"],
arguments=["forward_position_controller", "--param-file", robot_controllers],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
13 changes: 11 additions & 2 deletions example_9/bringup/launch/rrbot_gazebo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ def generate_launch_description():
]
)
robot_description = {"robot_description": robot_description_content}

robot_controllers = PathJoinSubstitution(
[
FindPackageShare("ros2_control_demo_example_9"),
"config",
"rrbot_controllers.yaml",
]
)

rviz_config_file = PathJoinSubstitution(
[FindPackageShare("ros2_control_demo_description"), "rrbot/rviz", "rrbot.rviz"]
)
Expand All @@ -85,13 +94,13 @@ def generate_launch_description():
joint_state_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
arguments=["joint_state_broadcaster"],
)

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["forward_position_controller", "--controller-manager", "/controller_manager"],
arguments=["forward_position_controller", "--param-file", robot_controllers],
)
rviz_node = Node(
package="rviz2",
Expand Down

0 comments on commit e9a33fd

Please sign in to comment.