Slam gmapping map doesn't update in RViz after the first laser scan

asked 2020-04-16 07:51:34 -0500

anonymous user


updated 2020-04-16 07:54:45 -0500

I am trying to implement gmapping SLAM into my current project, visualising the map in RViz. However, the slam gmapping only shows the map from the first laser scan and doesn't update when i move the robot. My set up is:

  • custom robot simulated in CopelliaSim (V-REP)
  • hokuyo sensor attached to robot
  • all position info published to tf from CopelliaSim
  • run simulation with use_sim_time set to true
  • run gmapping slam with the following launch file:

<launch> <arg name="scan_topic" default="/laser_scan"/> <arg name="base_frame" default="base_link"/> <arg name="odom_frame" default="odom"/> <arg name="map_frame" default="map"/>

<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
    <param name="base_frame" value="$(arg base_frame)"/>
    <param name="odom_frame" value="$(arg odom_frame)"/>
    <param name="map_frame" value="$(arg map_frame)"/>

    <param name="throttle_scans" value="1"/>

    <param name="map_update_interval" value="2.0"/> 
    <param name="maxUrange" value="5.0"/>

    <param name="maxRange" value="40.0"/>

    <remap from="scan" to="$(arg scan_topic)"/>


When running the simulation I can see that the laser scan is visualised correctly in RViz and moves when the robot is driven.

The commandline output from gmappong also seems to be responding correctly to the laser scan, i've shown the first couple of responses below:

-maxUrange 5 -maxUrange 40 -sigma 0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05 -srr 0.01 -srt 0.02 -str 0.01 -stt 0.02 -linearUpdate 0.1 -angularUpdate 0.05 -resampleThreshold 0.5 -xmin -10 -xmax 10 -ymin -10 -ymax 10 -delta 0.02 -particles 10 update frame 0 update ld=0 ad=0 Laser Pose= 0.363947 0.00158579 -0.00387078 m_count 0 Registering First Scan update frame 28 update ld=0.117944 ad=0.0368429 Laser Pose= 0.478733 0.0186419 0.0327192 m_count 1 Average Scan Matching Score=675.004 neff= 7.59408 Registering Scans:Done update frame 31 update ld=0.115139 ad=0.00576534 Laser Pose= 0.593606 0.026421 0.0384845 m_count 2 Average Scan Matching Score=679.28 neff= 7.797 Registering Scans:Done

Has anyone got any ideas why it isn't updating the map in RViz?

edit retag flag offensive close merge delete