Use Gmapping without a laser
I'm using ROS Melodic, Gazebo 9.7.0 on an Ubuntu 18.04.2 LTS.
I have to make a map with odometry only. I'm going to teleop the robot to move it around a closed room to make the map. After I have the map, I have to order the robot to move to a goal (the robot will move autonomously).
To make the map I will move the robot from wall to wall using a "snake" pattern but without hitting anything.
I had thought to use gmapping to store the map but it seems that it needs a laser and I can't use it. Any suggestion about how to store the map and where? Thanks.
Asked by Elric on 2019-04-07 12:37:46 UTC
Answers
If you are not using any exteroceptive sensors such as camera / laser/ sonar etc, then the conventional mapping solutions won't work for you.
Based on your comments, what I understood is that you need to understand where in the environment you can navigate without collisions. This information constitutes a map for you. To create that map you will navigate the robot in a pattern in the open space.
Assuming I have understood your problem correctly, I can see a couple of problems in this approach.
- You are entirely dependent on odometry, which will definitely drift while the robot moves
- You need to fix your odometry coordinate system's origin somewhere and keep track of it
If your odometry drift is tolerable and you can always initialize the robot accurately in the same place, I propose the following mapping approach.
Initialize map MxN 2D matrix to occupied everywhere
while navigating
get position x,y from odometry
convert x,y to corresponding i,j indices of the map (based on map resolution and map origin)
set map(i,j) free
Asked by janindu on 2019-04-08 21:27:20 UTC
Comments
Yes, you are right. I have to create a map to map where the walls and obstacles are (I will only have one obstacle). Maybe I can use tf to "convert x,y to corresponding i,j indices of the map". What do you think?
Asked by Elric on 2019-04-16 09:09:19 UTC
With correct implementation, you should be able to. However, note that tf is used for 3D coordinate transformations and map coordinates in your case are 2D.
Asked by janindu on 2019-04-25 20:13:08 UTC
Comments
What sensors do you have to work with?
Asked by stevemacenski on 2019-04-08 12:04:12 UTC
I'm not going to use any sensor. I only have odometry data.
Asked by Elric on 2019-04-08 12:17:55 UTC
Ok, in that case talking about mapping isn't really a meaningful thing if you have no way to view your environment (camera, lidar, depth camera, sonar, radar, bump sensor)
Asked by stevemacenski on 2019-04-08 12:22:05 UTC
I have to do a map using only odometry. I think I'm talking about mapping.
Asked by Elric on 2019-04-08 12:23:03 UTC