Gmapping problem when limiting sensor range to 90 degree

asked 2020-02-22 18:23:09 -0500

zhefan gravatar image

I am testing planning algorithm using gazebo simulation with turtlebot, and I want to use gmapping. The lds sensor in turtlebot is 360 degree, but I want to test the 90 degree case. So, I change the urdf file of turtlebot:

<gazebo reference="base_scan">
    <material>Gazebo/FlatBlack</material>
    <sensor type="ray" name="lds_lfcd_sensor">
      <pose>0 0 0 0 0 0</pose>
      <visualize>$(arg laser_visual)</visualize>
      <update_rate>5</update_rate>
      <ray>
        <scan>
          <horizontal>
            <samples>360</samples>
            <resolution>1</resolution>
            <!-- <min_angle>0.0</min_angle> -->
            <!-- <max_angle>6.28319</max_angle> -->
            <min_angle>-0.785</min_angle>
            <max_angle>0.785</max_angle> 
          </horizontal>
        </scan>
        <range>
          <min>0.120</min>
          <max>3.5</max>
          <resolution>0.015</resolution>
        </range>
        <noise>
          <type>gaussian</type>
          <mean>0.0</mean>
          <stddev>0.01</stddev>
        </noise>
      </ray>
      <plugin name="gazebo_ros_lds_lfcd_controller" filename="libgazebo_ros_laser.so">
        <topicName>scan</topicName>
        <frameName>base_scan</frameName>
      </plugin>
    </sensor>
  </gazebo>

But when I do this, gmapping cannot give me a accurate map when robot make moves. I don't know exacly how gmapping works, but I think missing a part of scan data would cause some problem to the gmapping algorithm. So, is there any way that I can limit angle of sensor without disturbing gmapping?

edit retag flag offensive close merge delete