From d4f92e349dc7810625c3b74a3427f901f923e396 Mon Sep 17 00:00:00 2001 From: JesusSilvaUtrera Date: Thu, 5 Sep 2024 10:53:01 +0200 Subject: [PATCH] Slam is working now Signed-off-by: JesusSilvaUtrera --- .../slam_toolbox_online_async.launch.py | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/andino_gz/launch/slam_toolbox_online_async.launch.py b/andino_gz/launch/slam_toolbox_online_async.launch.py index 8ed37b3..4543756 100644 --- a/andino_gz/launch/slam_toolbox_online_async.launch.py +++ b/andino_gz/launch/slam_toolbox_online_async.launch.py @@ -31,10 +31,11 @@ import os from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument +from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription from launch.substitutions import LaunchConfiguration from launch_ros.actions import Node from ament_index_python.packages import get_package_share_directory +from launch.launch_description_sources import PythonLaunchDescriptionSource def generate_launch_description(): @@ -46,21 +47,19 @@ def generate_launch_description(): 'config', 'slam_toolbox_online_async.yaml'), description='Full path to the ROS 2 parameters file to use for the slam_toolbox node') - start_async_slam_toolbox_node = Node( - parameters=[ - slam_params_file, - { - 'use_sim_time': True - } - ], - package='slam_toolbox', - executable='async_slam_toolbox_node', - name='slam_toolbox', - output='screen') + async_slam_toolbox_launch = IncludeLaunchDescription( + PythonLaunchDescriptionSource( + os.path.join(get_package_share_directory("slam_toolbox"), + 'launch', 'online_async_launch.py') + ), + launch_arguments={ + 'slam_params_file': slam_params_file + }.items(), + ) ld = LaunchDescription() ld.add_action(declare_slam_params_file_cmd) - ld.add_action(start_async_slam_toolbox_node) + ld.add_action(async_slam_toolbox_launch) return ld