How can I visualize a map on rviz2? (ros2 eloquent) [closed]
I am running "nav2_map_server" togheter with "rviz2". I used the "nav2_util" to call the map_server. Following the output of the terminals.
Terminal 1:
lorenzoteo@lorenzoteo-HP-ZBook-15v-G5:~$ ros2 run nav2_util lifecycle_bringup map_server
Terminal 2:
lorenzoteo@lorenzoteo-HP-ZBook-15v-G5:~$ ros2 run rviz2 rviz2
[INFO] [rviz2]: Stereo is NOT SUPPORTED
[INFO] [rviz2]: OpenGl version: 3.1 (GLSL 1.4)
[INFO] [rviz2]: Stereo is NOT SUPPORTED
Terminal 3:
lorenzoteo@lorenzoteo-HP-ZBook-15v-G5:~$ ros2 run nav2_map_server map_server --ros-args --params-file /home/lorenzoteo/Downloads/map_server_params.yaml
[INFO] [map_server]: Creating
[INFO] [map_server]: Configuring
[INFO] [map_server]: OccGridLoader: Creating
[INFO] [map_server]: OccGridLoader: Configuring
[INFO] [map_server]: Loading yaml file: /home/lorenzoteo/Downloads/map.yaml
[INFO] [map_server]: Loading image_file: /home/lorenzoteo/Downloads/map.png
[INFO] [map_server]: Activating
[INFO] [map_server]: OccGridLoader: Activating
I have attached the rviz window setup in which I cannot see the map even if I select the map topic.
C:\fakepath\Screenshot from 2020-02-10 15-54-27.png
EDIT
I found that with a configuration file (for rviz2) of a tutorial it displays the map. Why? The file could be found here: https://github.com/ros-planning/navig...
Do you see the map topic being published before you run rviz?
If so, make sure your QoS settings are correct.
What are QoS settings?
https://design.ros2.org/articles/qos....
Even if I run it alone it doesn't publish the topic /map. See the edit.
With your edit: again, pelase look at the QoS settings. You are required to understand QoS and their interactions as part of working with ROS2.
Thank you so much Steve. I read the QoS and understood
Stevemacenski, Thanks for pointing to a very generic article about QoS that was so generic to be not very helpful. and then you closed the question. How about something like the map server should have x profile or have history value of x depth value of y reliability value of x and durability value of v. Also how does Qos affect the map server not publishing the map? I could see maybe rviz2 not displaying because its not getting a map that is fresh enough. That could be a QoS issue. But the mapserver not publishing the topic at all points to something else. I repeated lorenzo's steps and then ran ros2 topic info /map and I see subscribers=1 publishers=0. that tells me mapserver is not working.
Sorry but I am a bit jaded since I saw these claims about how ros2 was so much better and ...(more)
Hi, have you solved this question? Facing the same problem after 2 years.