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.