ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

print agruments in ROS 2 foxy launch files

asked 2021-02-14 16:43:58 -0500

ed gravatar image

I am having issues with running navigation on simulating turtlebot3 through a gazebo model I created and ran a slam with cartographer as per the emanual on robotis website. I am using a copy of turtlebot3_world.launch.py that I changed to launch my model world without the robot. Then I run a robot_spawner_pkg to launch the burger model in the model world at 0,0,0. Gazebo is building the model ok and sending the lidar fine. This is how I call this. ros2 launch turtlebot3_gazebo turtlebot3_lroom.launch.py. Then I call the navigation launch file ros2 launch turtlebot3_navigation2 navigation2.launch.py use_sim_time:=true map:=/home/robot/turtlebot3_ws/src/turtlebot3/turtlebot3_navigation2/map/newlroom.yaml newlroom.yaml is the yaml file from the slam session.

This launch file has the following LaunchConfigurations map and params Then arguments use_sim_time, map, params

Then it includes bringup_launch.py and finally rviz node.

I have modified the params file that gets passed to bringup launch file with values that I optimized for burger while running ros1. However I am not seeing these values. I want to print or log the values of the arguments passed to bringup_launch.py because it is not using the correct file.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-04-11 14:14:33 -0500

ed gravatar image

ok Here I am again answering my own questions. I never did figure out how to print out the arguments inside a launchfile. I almost stopped doing robotics because this. The whole issue is because the navigation2.launch.py file provided by robotis in their turtlebot3_navigation package is using the WRONG parameter name

This is their code

IncludeLaunchDescription(
             PythonLaunchDescriptionSource([nav2_launch_file_dir, '/bringup_launch.py']),
             launch_arguments={
                 'map': map_dir,
                 'use_sim_time': use_sim_time,
                 'params': param_dir I think this is wrong should be params_file
                 }.items(),   
),

This is the code that works

IncludeLaunchDescription(
    PythonLaunchDescriptionSource([nav2_launch_file_dir, '/bringup_launch.py']),
    launch_arguments={
        'map': map_dir,
        'use_sim_time': use_sim_time,
        'params_file': param_dir
        }.items(),

),

params Should be params_file

They never probably noticed that the local costmap parameters are not set and the default values are used. The default values work for their simulations but I had gone through extensive customizations in ros1 to to get the my burger to negotiate the tight spaces in my living room.

I wasted over 100 hours trying to track down why the robot would not go through the narrow space because I assumed the robotis packages had been fully tested. It would have helped if I could have printed the arguments being passed into the launch file so if anyone figured that out add a comment here.

Lesson learned do not assumed ros2 software has been tested. Also visually examine both side of the launch files hand off.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-02-14 16:43:58 -0500

Seen: 974 times

Last updated: Apr 11 '21