ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Gmapping the same area creating inaccurate duplication

asked 2021-03-21 22:39:27 -0600

sisko gravatar image

updated 2021-03-25 22:07:35 -0600

I'm attempting to map a city simulation using my robot model which is equipped with a laser. I am aware gmapping is used for indoors mapping but I'm attempting to use it on this project.

The laser is positioned low enough on the robot so that its beam is relected off the kerbs of the simulated streets, as shown below:

image description

My problem is 2-fold.

The first problem is as I teleoperate the robot, the map being generated has repeating V-shaped gaps in it. In order to deal with these gaps, I decided to map each street atleast twice but that led to my second problem.

When I bring the robot back onto a previously mapped road, to fix the gaps, the mapping is misaligned from the previous pass.

Both issues shown below :

image description

The section of the screenshot highlighted in red is supposed to be a single street.

I have tried running this multiple times and teleoped the robot as slowly as possible but each time the mapping eventually goes wrong.

Can anyone help me understand what I'm doing wrong and how I might fix these issues ?

*UPDATE : *

Odometry :

The image below shows my robot in rotation on the spot . . . kind of. I had suspected it's rotation was not quite what I expected and enabling the odometry view confirmed it. It drives around a virtual box - I'm not sure yet if this is an error.

image description

Distance and cycle of the scan :

The following is my gazebo plugin code and the urdf for the laser. I know the maximum range is 10 but I'm not sure what the cycle is, probably <samples>720</samples>:

<xacro:macro name="laser_front">
    <gazebo reference="hokuyo_link_front">
        <sensor type="ray" name="head_hokuyo_sensor_front">
        <pose>0 0 0 0 0 0</pose>
        <visualize>true</visualize>
        <update_rate>20</update_rate>
        <ray>
            <scan>
                <horizontal>
                    <samples>720</samples>
                    <resolution>1</resolution>
                    <min_angle>-1.5</min_angle>
                    <max_angle>1.5</max_angle>
                </horizontal>
            </scan>
            <range>
                <min>0.10</min>
                <max>10.0</max>
                <resolution>0.05</resolution>
            </range>
            <noise>
                <type>gaussian</type>
                <mean>0.0</mean>
                <stddev>0.01</stddev>
            </noise>
        </ray>
        <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_laser.so">
            <topicName>/scan</topicName>
            <frameName>hokuyo_link_front</frameName>
        </plugin>
        </sensor>
    </gazebo>

    <link name="hokuyo_link_front">
        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <box size="0.1 0.1 0.1"/>
            </geometry>
        </collision>

        <visual>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <mesh filename="package://rrbot_description/meshes/hokuyo.dae"/>
            </geometry>
        </visual>

        <inertial>
            <mass value="1e-5" />
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
        </inertial>
    </link>

    <joint name="laser_joint_front" type="fixed">
        <origin xyz="0.53 0 -0.25" rpy="0 0.0 0"/>
        <parent link="chasis"/>
        <child link="hokuyo_link_front"/>
    </joint>
</xacro:macro>

Parameters of gmapping :

Only one parameter setting and that's just to change the base_frame, as shown below ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-03-22 06:56:54 -0600

miura gravatar image

updated 2021-03-23 08:39:20 -0600

Instead of going one way, it may be helpful to go a little further and then go back, or to rotate on the spot. If you haven't tried it yet, I think it's worth a try.

The following other information may increase our advice.

  • Is the odometry accurate enough?
  • Distance and cycle of the scan
  • Parameters of gmapping

Update

Thanks for the information. I think I can add a suggestion.

Odometry

The improvement in odometry seems to work. ( If it is just an image, gmapping will take care of it. )

Suggestion

  • try driving straight for a certain distance to see if it goes straight.

Distance and cycle of the scan

If I can increase the 10m of scanning, it might help. I think the sampling rate is sufficient. What you called the period will be [update_rate]. I think 20Hz is good enough for this too.

Suggestion

  • try changing <min_angle>-1.5</min_angle> <max_angle>1.5</max_angle> to increase the range of the scan.

Parameters of gmapping

Since gmapping has many parameters, it may be possible to improve it by checking and adjusting the contents of the parameters.

http://wiki.ros.org/gmapping

Suggestions

  • Reducing the value of map_update_interval from the default of 5 may help.
  • Try setting the minimumScore to 50 to see if that helps.
  • Increasing srt may help to deal with odometry misalignment.
  • Decreasing the value of linearUpdate may help.
edit flag offensive delete link more

Comments

Thank you for your input.

I will provide the information you suggested but can you please advice how I can determine the accuracy of the odometry ?

sisko gravatar image sisko  ( 2021-03-22 07:26:11 -0600 )edit
1

I updated my question with the information you requested.

sisko gravatar image sisko  ( 2021-03-22 18:09:41 -0600 )edit
1

I've been slowing experimenting with your suggestions and they have been helpful, particularly increasing the laser range. But the map is still "messy". The robot still seems to be loosing orientation so that the map in rviz is often badly distorted. I added a screenshot of the best map I been able to generate so far to my original question. One other thing I observered, the virtual city model might itself be more "imperfect" than I realised. I had to add collision data to all the sidewalks for the laser to bounce off them. But then the city seems to be floating in the air and I wonder if the laser might "be lost in space" and that causes the robot to loose orientation. I raise the sidewalk height a bit which seemed to help.

sisko gravatar image sisko  ( 2021-03-25 18:12:58 -0600 )edit

I'm glad it helped you to improve. It's hard for me to make any more suggestions. If the virtual city model is imperfect, you might want to create another question to ask about it.

miura gravatar image miura  ( 2021-03-27 09:25:39 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2021-03-21 22:39:27 -0600

Seen: 266 times

Last updated: Mar 25 '21