46 lines
2.0 KiB
Python
46 lines
2.0 KiB
Python
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='raspbot_v2',
|
|
executable='motor_controller',
|
|
name='motor_controller',
|
|
parameters=[{
|
|
'wheel_base': LaunchConfiguration('wheel_base'),
|
|
'max_speed': LaunchConfiguration('max_speed'),
|
|
}],
|
|
output='screen',
|
|
),
|
|
|
|
Node(
|
|
package='raspbot_v2',
|
|
executable='camera_orientation',
|
|
name='camera_orientation',
|
|
parameters=[{
|
|
'pan_center_deg': LaunchConfiguration('pan_center_deg'),
|
|
'tilt_center_deg': LaunchConfiguration('tilt_center_deg'),
|
|
}],
|
|
output='screen',
|
|
),
|
|
|
|
])
|