0
$\begingroup$

Rosanswers logo

I need to create a set of waypoints for my robot to go through and perform a specific task. My plan was to manually map my environment, than save it using nav2_map_server, generate an array of waypoints based on .pgm file and pass them to NavigateThroughPoses action server. However waypoints based just on .pgm file just do not work for obvious reasons (differnt origins and scale). Does anyone here have any idea on how to transform those waypoints into my robot's frame of reference? I am using Ubuntu 20.4 and ROS2:Galactic


Originally posted by sdudiak01 on ROS Answers with karma: 27 on 2022-03-13

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Did you try (Python Simple Commander)[https://navigation.ros.org/commander_api/index.html] and it's goThroughPoses() or followWaypoints()? It's nice and easy Python API to Nav2 stack, it seems suitable to your needs.

You can try to calculate your waypoints based on your init_pose (you should know real-world coordinates and coordinates on the PGM map), chosen points on the map (pixels (x,y)) and a resolution of your map (it's meter/pixel, defined in *.YAML) with correct set of translations.

There are some sources I have found, both ROS1 and ROS2, maybe they will help you:


Originally posted by ljaniec with karma: 3064 on 2022-03-15

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by sdudiak01 on 2022-03-15:
Thanks! I totally forgot about the .yaml file generated alongside the picture. Based on this file it is possible to get real-world coordinates of selected waypoints

Comment by ljaniec on 2022-03-15:
If it was enough, please accept the answer so others could see it :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.