ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

The origin of the map.yaml [-51.224998, -51.224998, 0.000000] refers to the position of the bottom left corner pixel of your map image with respect to your map frame. So, in order to represent your robot's position at (1,1) [with respect to the map frame], your pixel value from the bottom left corner of the map image would be: [1044.49996 pixels,1044.49996 pixels]

Calculation:

pixel value of the map origin in x: +51.224998 / resolution = +51.224998 / 0.05 = 1024.49996 pixels

pixel value of the map origin in y: +51.224998 / resolution = +51.224998 / 0.05 = 1024.49996 pixels

Now,

pixel value of the position (1,1) with respect to your map frame in x:

1024.49996 pixels + (1/resolution) = 1024.49996 pixels + (1/0.05) = 1044.49996 pixels

pixel value of the position (1,1) with respect to your map frame in y:

1024.49996 pixels + (1/resolution) = 1024.49996 pixels + (1/0.05) = 1044.49996 pixels

Please note: I am considering the pixel values with respect to the bottom left corner of the image.