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

Revision history [back]

Hi,

In MapMetaData, you get the real wold pose of pixel(0,0) in form of [x0,y0,orientation]; so if you need to know some particular pixel's(px,py) real world position(x,y) then, say, resolution = occ.info.resolution (occ is occupancy grid msg)

[x;y] = R[pxresolution ; py*resolution] + [x0,y0]

where, R is a 2d rotational matrix, with theta according to orientation of the map. However this data does not carry robot's location in the map.(tf data can be used)

Hope this helped, :) Sudeep

Hi,

In MapMetaData, you get the real wold pose of pixel(0,0) in form of [x0,y0,orientation]; so if you need to know some particular pixel's(px,py) real world position(x,y) then, say, resolution = occ.info.resolution (occ is occupancy grid msg)

[x;y] = R[pxR * [px * resolution ; py*resolution] py * resolution] + [x0,y0]

where, R is a 2d rotational matrix, with theta according to orientation of the map. However this data does not carry robot's location in the map.(tf data can be used)

Hope this helped, :) Sudeep

Hi,

In MapMetaData, you get the real wold pose of pixel(0,0) in form of [x0,y0,orientation]; so if you need to know some particular pixel's(px,py) real world position(x,y)

then, letssay

say,

resolution = occ.info.resolution (occ is occupancy grid msg)

[x;y] = R * [px * resolution ; py * resolution] + [x0,y0]

where, R is a 2d rotational matrix, with theta according to orientation of the map. However this data does not carry robot's location in the map.(tf data can be used)

Hope this helped, :) Sudeep