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

# Revision history [back]

If you look the gray area at the right bottom corner is -10,-10 and the center is also looks like 0,0 this coordinate system is cartesian coordinate system. In this system maps x values increase from left to right and and y values increase from bottom to top. Generally mobile and web application coordinate system is little bit different. In that type of applications origin point accepted left top point and y axis value is increase from top to bottom.

So that you can calculate your click position on the map with this formula

• x = click.x(px)*map_resolution(meter/px) + origin.x(meter)
• y = (map.height(px) - click.y(px))*map_resolution(meter/px) + origin.y(meter)

If we make a check - Our click position (200,184)(px) (this is center point on this map you can check it with paint or other app) our map size (384,384)(px) and origin (-10,-10)(meter) and resolution 0.05

• x (200*0.05) + (-10) = 0
• y = ((384-184)*0.05) + (-10) = 0

I hope that has been revealing