Gmapping in rviz doesn't update correctly

asked 2019-03-08 10:42:37 -0500

kump gravatar image

I'm running the gmapping node and a robot with lidar sensor and imu sensor. This is what my frame tree look like

image description

When I launch rviz and add the laser, map and transform frame of odom and the robot base_link and set the fixed frame to map, the odom stays in the middle of the rviz map and the base_link moves around as I command to the robot. The laser data shows in the map with correct shape (when robot faces corner the data are corner shaped etc) but are positioned as if the odom frame was looking at the data.

image description

and the map is shown as if seen from the odom frame. When the odom is static, the map doesn't seem as being updated at all. When I use the imu data to get odom, the odom frame moves around a little so I can see changes in map, but the map is totally wrong. Seems as if the scan was applied to the origin of odom frame.

What am I doing wrong?

edit retag flag offensive close merge delete