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

ROS2 NAV2 map not served - help requested

asked 2023-01-22 13:47:16 -0500

billy gravatar image

Ros2 Humble, new install of Ubuntu 22.04 on Intel desktop.

Working through NAV2 tutorials with real robot - custom. Have successfully mapped the house multiple times using custom URDF and the following:

ros2 launch robot_description display.launch.py
ros2 launch nav2_bringup navigation_launch.py
ros2 launch slam_toolbox online_async_launch.py

During the mapping, had zero issues with the map being built being served and and shown on RVIZ2.

With mapping done, attempting navigation the map server doesn't seem to work. The map frame is never issued and the map never shows on RVIZ, That attempt is using:

ros2 launch nav2_bringup bringup_launch.py use_sim_time:=False autostart:=True map:='/home/b/map.yaml'

There is no issue with file path as the startup clearly finds and reads the map yaml and file:

[component_container_isolated-1] [INFO] [1674403535.435682167] [map_server]: Configuring
[component_container_isolated-1] [INFO] [map_io]: Loading yaml file: /home/b/map.yaml
[component_container_isolated-1] [DEBUG] [map_io]: resolution: 0.05
[component_container_isolated-1] [DEBUG] [map_io]: origin[0]: -4.22
[component_container_isolated-1] [DEBUG] [map_io]: origin[1]: -4.81
[component_container_isolated-1] [DEBUG] [map_io]: origin[2]: 0
[component_container_isolated-1] [DEBUG] [map_io]: free_thresh: 0.25
[component_container_isolated-1] [DEBUG] [map_io]: occupied_thresh: 0.65
[component_container_isolated-1] [DEBUG] [map_io]: mode: trinary
[component_container_isolated-1] [DEBUG] [map_io]: negate: 0
[component_container_isolated-1] [INFO] [map_io]: Loading image_file: /home/b/map.pgm
[component_container_isolated-1] [INFO] [1674403535.438891662] [behavior_server]: 
[component_container_isolated-1]    behavior_server lifecycle node launched. 
[component_container_isolated-1]    Waiting on external lifecycle transitions to activate
[component_container_isolated-1]    See https://design.ros2.org/articles/node_lifecycle.html for more information.
[component_container_isolated-1] [DEBUG] [map_io]: Read map /home/b/map.pgm: 266 X 230 map @ 0.05 m/cell

[component_container_isolated-1] [INFO] [1674403535.457025407] [map_server]: Activating
[component_container_isolated-1] [INFO] [1674403535.457180554] [amcl]: Received a 266 X 230 map @ 0.050 m/pix
[component_container_isolated-1] [INFO] [1674403535.457192287] [map_server]: Creating bond (map_server) to lifecycle manager.

[component_container_isolated-1] [INFO] [1674403535.570334635] [lifecycle_manager_localization]: Server map_server connected with bond. 

[component_container_isolated-1] [INFO] [1674403535.587049624] [global_costmap.global_costmap]: Subscribing to the map topic (/map) with transient local durability

It looks like the costmap plugin gets the correct map:

[component_container_isolated-1] [INFO] [1674403535.663900677] [global_costmap.global_costmap]: StaticLayer: Resizing costmap to 266 X 230 at 0.050000 m/pix

but eventually end up with repeating errors here complaining about 'map' frame not existing, and the map never shows up on the map topic. Looking at the TF frames there is also no 'map' frame shown.

[component_container_isolated-1] [INFO] [1674403535.916757777] [global_costmap.global_costmap]: Timed out waiting for transform from base_link to map to become available, tf error: Invalid frame ID "map" passed to canTransform argument target_frame - frame does not exist

Things I've tried:

  • I tried for hours to use a stand alone map server but never get past the configure stage with that.
  • Have remapped the house just in case the map file was corrupted, it looks fine in GIMP.
  • Have been careful to source everything.
  • The local cost map works and appears in RVIZ and can be seen updating as laser data changes.
  • I even tried adding a static transform from odom to map just to see if that was preventing the map from showing up on the 'map' topic.

Really appreciate guidance with this.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-01-23 14:45:17 -0500

updated 2023-01-23 14:45:55 -0500

Almost definitely just a QoS issue. Maps are served over transient local connection types which are incompatible with reliable connection types. Just change the QoS profile in the rviz dropdown (or is properly served in our rviz configuration for Nav2).

If the file failed to load, you'd see something about it and the costmap layers would not be displaying the map.

edit flag offensive delete link more

Comments

Thank you Steve.

I eventually got a stand alone map server working and it also didn't show up in RVIZ2 but I was able to confirm the map was on the map topic. So I moved on and started looking at QoS after finding this question: https://answers.ros.org/question/3437... where you mention QoS. I couldn't find where the QoS for map_server was listed, so set all the paramaters in RVIZ2 map topic to 'System Default' and that corrected it.

For those wondering about CLI for map_server: ros2 service call /map_server/load_map nav2_msgs/srv/LoadMap "{map_url: /home/path/map.yaml}"which I found here: https://automaticaddison.com/how-to-l...

Still not sure where to find the QoS settings but immediate issue solved.

billy gravatar image billy  ( 2023-01-23 22:35:21 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-01-22 13:47:16 -0500

Seen: 1,716 times

Last updated: Jan 23 '23