course1_ws/my_robot_bringup/launch/turtlesim_catch_them_all.launch.py

35 lines
814 B
Python
Raw Permalink Normal View History

2024-12-11 19:24:37 +00:00
from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
ld = LaunchDescription()
turtlesim_node = Node(
package="turtlesim",
executable="turtlesim_node",
)
turtle_spawner_node = Node(
package="turtlesim_catch_them_all",
executable="turtle_spawner",
parameters=[
{"catch_closest_turtle_first": True}
]
)
turtle_controller_node = Node(
package="turtlesim_catch_them_all",
executable="turtle_controller",
parameters=[
{"spawn_frequency": 2.0},
{"turtle_name_prefix": "sim_turtle"}
]
)
ld.add_action(turtlesim_node)
ld.add_action(turtle_spawner_node)
ld.add_action(turtle_controller_node)
return ld