getting pose from given map image
I am trying to interpret the position in the map generated by the map_server in si units. As i tried with the popular turtlebot3 simulations map file. Here is the .yaml file of given map:
image: nic_map4.pgm
resolution: 0.050000
origin: [-51.224998, -51.224998, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196
And here is the map file:
To calculate the position in the map when user clicks on the given map. I am using following forumula:
x_real_pose = mouse.x * resolution - 51.224998 ( meters )
y_real_pose = mouse.y * resolution - 51.224998 ( meters )
Here the yrealpose value is comming accuratly but somehow the xrealpose value is not correct and as i debugged is different by 1 meters with the real x coordinates.
How should i resolve this issue.
Environment: UI: Qt qml. ros version: noetic developement environment: ubuntu 20.04
Asked by dinesh on 2021-07-29 06:33:32 UTC
Comments