Add ros2 launch and make it the default

This commit is contained in:
2026-04-16 22:02:50 +00:00
parent ecbd72e9db
commit 6af4ba10bf
5 changed files with 87 additions and 56 deletions
+45
View File
@@ -0,0 +1,45 @@
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
def generate_launch_description():
return LaunchDescription([
# ── Motor controller arguments ────────────────────────────────────
DeclareLaunchArgument('wheel_base', default_value='0.3',
description='Distance between left and right wheels (m)'),
DeclareLaunchArgument('max_speed', default_value='1.0',
description='Maximum motor speed in library units'),
# ── Camera orientation arguments ──────────────────────────────────
DeclareLaunchArgument('pan_center_deg', default_value='90.0',
description='Pan angle at startup and shutdown (degrees)'),
DeclareLaunchArgument('tilt_center_deg', default_value='60.0',
description='Tilt angle at startup and shutdown (degrees)'),
# ── Nodes ─────────────────────────────────────────────────────────
Node(
package='my_robot',
executable='motor_controller',
name='motor_controller',
parameters=[{
'wheel_base': LaunchConfiguration('wheel_base'),
'max_speed': LaunchConfiguration('max_speed'),
}],
output='screen',
),
Node(
package='my_robot',
executable='camera_orientation',
name='camera_orientation',
parameters=[{
'pan_center_deg': LaunchConfiguration('pan_center_deg'),
'tilt_center_deg': LaunchConfiguration('tilt_center_deg'),
}],
output='screen',
),
])