Spaces:
Runtime error
Runtime error
File size: 1,348 Bytes
b3cedce | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.substitutions import LaunchConfiguration
from launch.actions import DeclareLaunchArgument
import os
def generate_launch_description():
# Path to the mock_robot.py script
# Since we are running in dev mode without full install, we use relative path from workspace root
# or absolute path. Assuming workspace root is /root/projects/ros2-robot-stack
script_path = '/root/projects/ros2-robot-stack/robotics/ros2_ws/src/simulation_manager/src/mock_robot.py'
return LaunchDescription([
# Robot 1
ExecuteProcess(
cmd=['python3', script_path, '--ros-args', '-p', 'robot_id:=robot_1', '-p', 'initial_x:=2.0', '-p', 'initial_y:=2.0'],
output='screen',
emulate_tty=True
),
# Robot 2
ExecuteProcess(
cmd=['python3', script_path, '--ros-args', '-p', 'robot_id:=robot_2', '-p', 'initial_x:=5.0', '-p', 'initial_y:=3.0'],
output='screen',
emulate_tty=True
),
# Robot 3
ExecuteProcess(
cmd=['python3', script_path, '--ros-args', '-p', 'robot_id:=robot_3', '-p', 'initial_x:=8.0', '-p', 'initial_y:=5.0'],
output='screen',
emulate_tty=True
)
])
|