wrong map position
I am using the map file generated by the hector slam in qt quick applicatino. Here when i click on the map location the x coordintates are accurate but the y value are not comming accurate. The forumula i'm using is:
onPressed: {
fnameFieldX.text = point1.x * resolution-map_origin.x
fnameFieldY.text = point1.y * resolution-map_origin.y
}
For example when i press at center i.e 0,0 location of popular turtlebot3 world map. The x,y data is comming as: 0.04,0.9
.
Here the orign is 10,10 and resolution is 0.05 acording to map.yaml file.
image: ./map.pgm
resolution: 0.050000
origin: [-10.000000, -10.000000, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196
In this map 384x384 pixel and if you calculate your map dimensions 384x0.05 = 19.2 meter
What are the point.x and point.y values when you press the upper left corner? What are the point.x and point.y values when you press the bottom right corner?
Its 0,0 as expected. Their is no problem in pixel position as i confirmed. eg. If i click on bottom right corner the x and y coms as the height and widht of the image itself.