35 lines
1.7 KiB
Python
35 lines
1.7 KiB
Python
from launch import LaunchDescription
|
|
from launch.actions import DeclareLaunchArgument
|
|
from launch.substitutions import LaunchConfiguration
|
|
from launch_ros.actions import Node
|
|
from launch_ros.parameter_descriptions import ParameterValue
|
|
|
|
|
|
def generate_launch_description() -> LaunchDescription:
|
|
return LaunchDescription([
|
|
DeclareLaunchArgument('transport', default_value='udp'),
|
|
DeclareLaunchArgument('server_addr', default_value=''),
|
|
DeclareLaunchArgument('relay_via', default_value=''),
|
|
DeclareLaunchArgument('peer_id', default_value='ros-keyboard-ctrl'),
|
|
DeclareLaunchArgument('target_peer', default_value='ros-bridge-ctrl'),
|
|
DeclareLaunchArgument('input_topic', default_value='/teleop/cmd_vel'),
|
|
DeclareLaunchArgument('send_rate_hz', default_value='20.0'),
|
|
DeclareLaunchArgument('input_timeout', default_value='0.75'),
|
|
Node(
|
|
package='udp_teleop_bridge',
|
|
executable='cmd_vel_udp_sender',
|
|
name='cmd_vel_udp_sender',
|
|
output='screen',
|
|
parameters=[{
|
|
'transport': LaunchConfiguration('transport'),
|
|
'server_addr': LaunchConfiguration('server_addr'),
|
|
'relay_via': LaunchConfiguration('relay_via'),
|
|
'peer_id': LaunchConfiguration('peer_id'),
|
|
'target_peer': LaunchConfiguration('target_peer'),
|
|
'input_topic': LaunchConfiguration('input_topic'),
|
|
'send_rate_hz': ParameterValue(LaunchConfiguration('send_rate_hz'), value_type=float),
|
|
'input_timeout': ParameterValue(LaunchConfiguration('input_timeout'), value_type=float),
|
|
}],
|
|
),
|
|
])
|