From 2675c4dd487850c08569bde5af446f5a95eb8f6f Mon Sep 17 00:00:00 2001 From: Pimpest <82343504+Pimpest@users.noreply.github.com> Date: Sat, 22 Feb 2025 22:57:39 +0100 Subject: [PATCH] Added general launch file --- mg_bringup/CMakeLists.txt | 13 ++++++++++ mg_bringup/launch/launch.py | 50 +++++++++++++++++++++++++++++++++++++ mg_bringup/package.xml | 20 +++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 mg_bringup/CMakeLists.txt create mode 100644 mg_bringup/launch/launch.py create mode 100644 mg_bringup/package.xml diff --git a/mg_bringup/CMakeLists.txt b/mg_bringup/CMakeLists.txt new file mode 100644 index 0000000..d19920b --- /dev/null +++ b/mg_bringup/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) +set(CMAKE_EXPORT_COMPILE_COMMANDS OFF) + +project(mg_bringup) + +find_package(ament_cmake REQUIRED) + +install(DIRECTORY + launch + DESTINATION share/${PROJECT_NAME}/ +) + +ament_package() diff --git a/mg_bringup/launch/launch.py b/mg_bringup/launch/launch.py new file mode 100644 index 0000000..9b15a96 --- /dev/null +++ b/mg_bringup/launch/launch.py @@ -0,0 +1,50 @@ +from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, GroupAction +from launch.conditions import UnlessCondition +from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, PythonExpression +from launch_ros.actions import Node +from launch_ros.substitutions import FindPackageShare + + +def generate_launch_description(): + + is_local_test = DeclareLaunchArgument( + 'local_test', + default_value="False", + description='Launch with simulated components' + ) + + return LaunchDescription([ + is_local_test, + IncludeLaunchDescription( + PathJoinSubstitution([ + FindPackageShare("mg_control"), + 'launch', + 'launch.py' + ]), + launch_arguments={ + 'local_test': LaunchConfiguration('local_test') + }.items() + ), + Node( + package="mg_odometry", + executable="mg_odom_publisher", + name="mg_odom_publisher", + condition=UnlessCondition(LaunchConfiguration('local_test')), + parameters=[{ + 'odom': "odom", + 'serial_path': "/dev/ttyACM1", + }], + + emulate_tty=True, + output='screen' + ), + Node( + package="mg_navigation", + executable="mg_nav_server", + name="mg_nav_server", + emulate_tty=True, + output='screen', + ) + ]) + diff --git a/mg_bringup/package.xml b/mg_bringup/package.xml new file mode 100644 index 0000000..267f93c --- /dev/null +++ b/mg_bringup/package.xml @@ -0,0 +1,20 @@ + + + + mg_bringup + 0.0.0 + TODO: Package description + Pimpest + Apache-2.0 + + ament_cmake + launch + launch_ros + mg_control + mg_odometry + mg_navigation + + + ament_cmake + +