ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
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.