Skip to content

Commit

Permalink
included launch for microros
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikN committed Dec 1, 2023
1 parent 98d7776 commit 5baf6d7
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions rosbot_bringup/launch/combined.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import ThisLaunchFileDir, LaunchConfiguration
from launch_ros.actions import Node

def generate_launch_description():
# Declare launch arguments for the serial port and baud rate
declare_serial_port_arg = DeclareLaunchArgument(
'serial_port',
default_value='//dev/ttySERIAL', # Default value, replace if needed
description='Serial port for micro-ROS agent'
)

declare_serial_baudrate_arg = DeclareLaunchArgument(
'serial_baudrate',
default_value='576000', # Default baud rate, replace if needed
description='Baud rate for serial communication'
)

# Retrieve launch configurations
serial_port = LaunchConfiguration('serial_port')
serial_baudrate = LaunchConfiguration('serial_baudrate')

# Node configuration for micro-ROS agent
microros_agent_node = Node(
package='micro_ros_agent',
executable='micro_ros_agent',
arguments=['serial', '-D', serial_port, '-b', serial_baudrate],
output='screen'
)

# Include bringup.launch.py
bringup_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/bringup.launch.py'])
)

return LaunchDescription([
declare_serial_port_arg,
declare_serial_baudrate_arg,
microros_agent_node,
bringup_launch
])

0 comments on commit 5baf6d7

Please sign in to comment.