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

Revision history [back]

Given the width and the origin of the map, it should be fairly trivial:

x = map.info.origin.position.x + (point % map.info.width) * map.info.resolution;
y = map.info.origin.position.y + static_cast<int>(point / map.info.height) * map.info.resolution

Node that this discards the orientation of the origin. However, I haven't seen it used so far. If you want to have a really clean solution, you need to first calculate the x and y coordinates without taking into account the origin transform, put it into a pose and multiply the origin with that pose.

Given the width width, height and the origin of the map, it should be fairly trivial:

x = map.info.origin.position.x + (point % map.info.width) * map.info.resolution;
y = map.info.origin.position.y + static_cast<int>(point / map.info.height) * map.info.resolution

Node that this discards the orientation of the origin. However, I haven't seen it used so far. If you want to have a really clean solution, you need to first calculate the x and y coordinates without taking into account the origin transform, put it into a pose and multiply the origin with that pose.

Given the width, height and the origin of the map, it should be fairly trivial:

x = map.info.origin.position.x + (point % map.info.width) * map.info.resolution;
y = map.info.origin.position.y + static_cast<int>(point / map.info.height) * map.info.resolution
map.info.resolution;

Node that this discards the orientation of the origin. However, I haven't seen it used so far. If you want to have a really clean solution, you need to first calculate the x and y coordinates without taking into account the origin transform, put it into a pose and multiply the origin with that pose.

Given the width, height and the origin of the map, it should be fairly trivial:

x = map.info.origin.position.x + (point % map.info.width) * map.info.resolution;
y = map.info.origin.position.y + static_cast<int>(point / map.info.height) map.info.width) * map.info.resolution;

Node that this discards the orientation of the origin. However, I haven't seen it used so far. If you want to have a really clean solution, you need to first calculate the x and y coordinates without taking into account the origin transform, put it into a pose and multiply the origin with that pose.