ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
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.
2 | No.2 Revision |
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.
3 | No.3 Revision |
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.
4 | No.4 Revision |
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.