# Small, un-accurate, and flipped map generated from slam gmapping

I have a simple environment that I want to generate a map for it "map.ymal" using a uav as a robot and slam_gmapping package. I used a predefined point for the UAV to follow it. I used the following command line for slam_gmapping:

rosrun gmapping slam_gmapping scan:=/uav_1/scan _odom_frame:=world _base_frame:=/base_link


I generated a map using

 rosrun map_server map_sevar -f mymap


Then I used map_server and I used the generated map to do 2D localization but I have the following error

1- You can see that the the map is not accurate and not correct. map_3.png

2- In addition when I load it in Rviz and try to move the UAV again it shows that the map is smaller than the actual environment "the robot moves outside the projected map" on RVIZ ground. map_3.png

3- Also the map_3.png map is flipped in the RVIZ because as you can see in the attached file the position of the UAV in the environment is differer totally than the one in RVIZ in case of aligning the map with the environment --> how can I solve this problem .. because if we aligned the movement of the robot we will see that the map is flipped --> so again how can I solve this problem

The map and the actual environment images are attached.

edit retag close merge delete

Sort by » oldest newest most voted

gmapping was designed for ground robots; it assumes that the laser is mounted horizontally and at a fixed height, and it makes a 2D map based on those assumptions. If your UAV wobbles or changes height when it is moving, it breaks those assumptions. I'd suggest you look for a different mapping and localization package.

If you really want to make gmapping work, I would start by checking to see if your laser is mounted upside down; this might explain why the map is mirrored. gmapping has a parameter you can set if your laser is mounted upside down.

You say that the UAV position in the world doesn't match its position shown with respect to the map in rivz. This isn't surprising, because the map origins probably don't line up. gmapping uses the starting point of the robot as its map origin, and this probably doesn't align with the origin of your simulated environment. This shouldn't matter, because localization should correct for the offset and place the robot at the correct position on the map. You don't say how you're doing localization, so I can't provide any specific advice or guidance.

more

Thanks you @ahendrix. 1- what other mapping & localization packages that could be used for 2D mapping for UAVs. 2- I checked the laser, it is not up-side-down, so I should not have this issue. 3- I am using the map_server that generates a particle clouds that can be viewed as PoseArrays in RVIZ

( 2016-08-15 00:36:05 -0600 )edit

map_server does not generate particle clouds. perhaps you're using AMCL for localization?

( 2016-08-17 13:10:16 -0600 )edit

@ahendrix what should I use instead of the AMCL ?

( 2016-09-06 05:38:20 -0600 )edit

I spend most of my time working on indoor ground vehicles, so I know the limitations of those techniques very well, but I don't know what works well for quadrotors or UAVs. Perhaps you can consult google, or read the robotics journals if you have access.

( 2016-09-07 12:38:32 -0600 )edit