Problem with setting origin of hector map

asked 2019-03-28 05:27:17 -0500

hannesjk gravatar image


I want to have the start position of my robot to be in the middle of the map when running hector slam so I have set map_start_x and map_start_y to 0.5. However, the result of this is that the middle point of the map is half a grid cell length down to the right, not in the middle. Why is it not in the middle?

edit retag flag offensive close merge delete


In HectorMappingRos::setServiceGetMapData, I found this line:

mapOrigin.array() -= gridMap.getCellLength()*0.5f;

I removed this and now I get the expected result.

hannesjk gravatar image hannesjk  ( 2019-03-28 06:08:15 -0500 )edit