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

nav2_bringup not generates costmap

asked 2022-07-25 01:59:46 -0500

yyf202xz gravatar image

updated 2022-08-22 18:17:17 -0500

Hi. I'm studying NAV2 using the offical document but I stucked at costmap section. the /map topic published by slam_toolbox online_async_launch.py was fine but when I launch ros2 launch nav2_bringup navigation_launch.py , both /global_costmap/costmap and /local_costmap/costmap exist but showing no map received in rviz. The ternimal usually stucks at Creating bond timer... phase. Sometimes with Robot is out of bounds of the costmap! and Resizing costmap to 42 X 38 at 0.050000 m/pix behind it. I also tried download tutorial source code directly in order to check if I missed anything but got same result. I'm using humble distro. Please help me solve this!

update: I kinda solve this by launch all node at once according to this page. Why did this work any way?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2022-11-25 04:31:00 -0500

Jelle H gravatar image

I do not have an answer for why launching all required nodes from one launch file works, but I wanted to share this snippet for any other people stumbling upon this issue.

I was following the First-Time Robot Setup Guide and also did not receive any costmaps in RViz.

I cloned the navigation2_tutorials which contains the sam_bot_description package. I then edited the display.launch.py file and added the following lines to the launch.Launchdescription([]) array near the bottom of the screen (with the corresponding imports, of course)

TimerAction(
        period=3.0,  # This should be large enough that Gazebo is loaded before SLAM is started
        actions=[
            IncludeLaunchDescription(
                PythonLaunchDescriptionSource(
                    os.path.join(get_package_share_directory('slam_toolbox'),
                                 "launch",
                                 "online_async_launch.py")
                )
            ),
        ]
    ),
    TimerAction(
        period=6.0,  # This sould be large enough that SLAM is fully started before the rest of nav2 is launched
        actions=[
            IncludeLaunchDescription(
                PythonLaunchDescriptionSource(
                    os.path.join(get_package_share_directory('nav2_bringup'),
                                 "launch",
                                 "navigation_launch.py")
                )
            ),
        ]
    ),

After launching this new file, I can see the costmaps in RViz.

Hopefully this helps other people to quickly get this example up and running.

edit flag offensive delete link more
0

answered 2022-08-22 19:21:58 -0500

Someone posted saying:

and I solved this problem by delete param "use_sim_time:=True".

edit flag offensive delete link more

Comments

I simply launch them using ros2 launch sam_bot_description display.launch.py without any additional setting. Though use_sim_time is set as True in display.launch.py by default, so I trun it to false using ros2 launch sam_bot_description display.launch.py use_sim_time:=False. This time not only costmap, but alse all other map disappeared

yyf202xz gravatar image yyf202xz  ( 2022-08-29 18:29:41 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-07-22 03:29:34 -0500

Seen: 741 times

Last updated: Aug 22 '22