Skip to content

Commit 4e23e4a

Browse files
Slam is working now
1 parent 5975d3b commit 4e23e4a

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

andino_gz/launch/slam_toolbox_online_async.launch.py

+12-13
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@
3131
import os
3232

3333
from launch import LaunchDescription
34-
from launch.actions import DeclareLaunchArgument
34+
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
3535
from launch.substitutions import LaunchConfiguration
3636
from launch_ros.actions import Node
3737
from ament_index_python.packages import get_package_share_directory
38+
from launch.launch_description_sources import PythonLaunchDescriptionSource
3839

3940

4041
def generate_launch_description():
@@ -46,21 +47,19 @@ def generate_launch_description():
4647
'config', 'slam_toolbox_online_async.yaml'),
4748
description='Full path to the ROS 2 parameters file to use for the slam_toolbox node')
4849

49-
start_async_slam_toolbox_node = Node(
50-
parameters=[
51-
slam_params_file,
52-
{
53-
'use_sim_time': True
54-
}
55-
],
56-
package='slam_toolbox',
57-
executable='async_slam_toolbox_node',
58-
name='slam_toolbox',
59-
output='screen')
50+
async_slam_toolbox_launch = IncludeLaunchDescription(
51+
PythonLaunchDescriptionSource(
52+
os.path.join(get_package_share_directory("slam_toolbox"),
53+
'launch', 'online_async_launch.py')
54+
),
55+
launch_arguments={
56+
'slam_params_file': slam_params_file
57+
}.items(),
58+
)
6059

6160
ld = LaunchDescription()
6261

6362
ld.add_action(declare_slam_params_file_cmd)
64-
ld.add_action(start_async_slam_toolbox_node)
63+
ld.add_action(async_slam_toolbox_launch)
6564

6665
return ld

0 commit comments

Comments
 (0)