Map not visible in Rviz

asked 2019-10-10 05:14:35 -0600

Maagtablet gravatar image

updated 2019-10-10 07:07:18 -0600


I'm trying to visualize and create a map using a Lidar in Rviz.

I have a Lidar that publishes the LaserScan data on /scan and that is visible in Rviz. That is working fine. I also have installed slam_gmapping and run that as following:

rosrun gmapping slam_gmapping scan:=scan

i suppose that this should publish a map on the /map topic, but there is nothing visible in Rviz?

I guess i have to so something with tf_static_transform_publisher but i dont understand it.

I'm using a Raspberry Pi Mouse ( with a Lidar on top of it.

edit retag flag offensive close merge delete


This is a custom robot? Have you modelled your robot (ie: do you have a urdf/xacro) and the location of the lidar? The first part of this tutorial (ie: the first section) has a decent overview for why that would be desirable/required. You don't necessarily need to write any code.

Gmapping must be outputting messages, but you don't mention any, so it's hard to know what could be going wrong.

gvdhoorn gravatar image gvdhoorn  ( 2019-10-10 05:33:32 -0600 )edit

The problem is that i dont know what the output is of gmapping

Maagtablet gravatar image Maagtablet  ( 2019-10-10 06:11:07 -0600 )edit

So you have no log messages on your console at all? If you could just copy-paste everything on your console after launching your system that would already help.

I would also recommend taking a look at some other robots, and how they've setup their systems to start gmapping, such as the turtlebot (here). There are many parameters that influence its behaviour. Just starting slam_gmapping could result in inefficient/unwanted defaults.

gvdhoorn gravatar image gvdhoorn  ( 2019-10-10 06:16:16 -0600 )edit

I have watched the launch-file of turtlebot. But what i dont understand is what to publish on odom and base_footprint topic

Maagtablet gravatar image Maagtablet  ( 2019-10-10 06:36:52 -0600 )edit

base_footprint and odom are not topics, they are TF frames.

This is not a direct solution, but I would recommend trying to become a little more familiar with how ROS (for mobile bases/service robots) is typically used and configured.

It might also help (others, as I'm not really into navigation) if you could describe your robot a bit more. Without more information on what you already have and don't have it's going to be hard to provide suggestions.

gvdhoorn gravatar image gvdhoorn  ( 2019-10-10 06:46:29 -0600 )edit