From ca069cd664f7a72ee9a8b5d52db1c7f14f26e6d0 Mon Sep 17 00:00:00 2001 From: Pimpest <82343504+Pimpest@users.noreply.github.com> Date: Thu, 8 May 2025 23:01:51 +0200 Subject: [PATCH] Added launch_files --- mg_bringup/launch/launch-external.py | 35 +++++++ mg_bringup/launch/launch.py | 26 ++++- mg_bt/behavior_trees/calib_bt.xml | 145 +++++++++++++++------------ mg_bt/behavior_trees/tactics.xml | 87 +++++++++++++++- 4 files changed, 226 insertions(+), 67 deletions(-) create mode 100644 mg_bringup/launch/launch-external.py diff --git a/mg_bringup/launch/launch-external.py b/mg_bringup/launch/launch-external.py new file mode 100644 index 0000000..addeef2 --- /dev/null +++ b/mg_bringup/launch/launch-external.py @@ -0,0 +1,35 @@ + +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_bt"), + 'launch', + 'launch.py' + ]), + ), + Node( + package="mg_planner", + executable="mg_planner", + name="mg_planner", + emulate_tty=True, + output='screen', + ) + ]) + diff --git a/mg_bringup/launch/launch.py b/mg_bringup/launch/launch.py index 67ba23d..e032a45 100644 --- a/mg_bringup/launch/launch.py +++ b/mg_bringup/launch/launch.py @@ -1,6 +1,6 @@ from launch import LaunchDescription from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, GroupAction -from launch.conditions import UnlessCondition +from launch.conditions import UnlessCondition, IfCondition from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, PythonExpression from launch_ros.actions import Node from launch_ros.substitutions import FindPackageShare @@ -26,6 +26,14 @@ def generate_launch_description(): 'local_test': LaunchConfiguration('local_test') }.items() ), + IncludeLaunchDescription( + PathJoinSubstitution([ + FindPackageShare("mg_lidar"), + 'launch', + 'launch.py' + ]), + condition=UnlessCondition(LaunchConfiguration('local_test')), + ), Node( package="mg_odometry", executable="mg_odom_publisher", @@ -39,6 +47,22 @@ def generate_launch_description(): emulate_tty=True, output='screen' ), + IncludeLaunchDescription( + PathJoinSubstitution([ + FindPackageShare("mg_bt"), + 'launch', + 'launch.py' + ]), + condition=IfCondition(LaunchConfiguration('local_test')), + ), + Node( + package="mg_planner", + executable="mg_planner", + name="mg_planner", + emulate_tty=True, + condition=IfCondition(LaunchConfiguration('local_test')), + output='screen', + ), Node( package="mg_navigation", executable="mg_nav_server", diff --git a/mg_bt/behavior_trees/calib_bt.xml b/mg_bt/behavior_trees/calib_bt.xml index 6f82669..a2ba048 100644 --- a/mg_bt/behavior_trees/calib_bt.xml +++ b/mg_bt/behavior_trees/calib_bt.xml @@ -3,32 +3,55 @@ - + max_vel="2.000000" + ornt_mult="4.000000" + tolerance="0.02" + action_name="/MovePoint"/> - + action_name="/MovePoint"/> - - - - - - + + + + + + @@ -41,23 +64,39 @@ - + max_vel="2.000000" + ornt_mult="4.000000" + tolerance="0.04" + action_name="/MovePoint"/> - + max_vel="2.000000" + ornt_mult="4.000000" + tolerance="0.001000" + action_name="/MovePoint"/> @@ -85,59 +124,39 @@ type="std::string">Service name - Action server name - - - - - - - - - - - + + + + + + Action server name - - - - - - - - Action server name diff --git a/mg_bt/behavior_trees/tactics.xml b/mg_bt/behavior_trees/tactics.xml index 445df99..485f5f0 100644 --- a/mg_bt/behavior_trees/tactics.xml +++ b/mg_bt/behavior_trees/tactics.xml @@ -257,7 +257,7 @@ - @@ -275,11 +275,79 @@ - + + + + + + + + + + + - + + + + + + + + + + + @@ -439,6 +507,19 @@ Action server name + + + + + + Service name +