35 lines
814 B
Python
35 lines
814 B
Python
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 |