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

create a map for navigation from points?

asked 2022-01-10 03:02:21 -0500

Misrek gravatar image

updated 2022-01-10 03:49:02 -0500

Hi everyone, I would like to create a map (pgm image and related yaml file) for robot navigation. I need to create the map inside a python code where I have all the points of interest available such as room size, position and orientation of obstacles (fixed), etc... basically i need to create a function that create a map (pgm image) from some points, for example if i have the vertices of an obstacle i need to create a shape with black outline and grey inside and so on.... Can anyone give me some guidance?

(ps: i use python with ros noetic)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-01-10 03:46:24 -0500

ljaniec gravatar image

updated 2022-01-10 04:51:10 -0500

This netpbmfile library could help you generate your PGM map file with *.yaml file too (documentation of YAML format for ROS)- then you can go with steps from this YT tutorial to load this map inside ROS1 Navigation stack.

EDIT: Example usage: image description

edit flag offensive delete link more

Comments

Thank you for your reply, I will study the library you have indicated. I have only a small problem: I installed the library with "pip install netpbmfile" as indicated in the page but the import does not work in python.... I don't understand if the import is netpbm or netpbmfile, but neither works (Import "netpbm" could not be resolved, same for netpbmfile).

Misrek gravatar image Misrek  ( 2022-01-10 04:44:49 -0500 )edit

I edited the answer with example from documentation :)

ljaniec gravatar image ljaniec  ( 2022-01-10 04:51:35 -0500 )edit
1

I keep getting a warning about the import, but it works. Thanks for your help.

Misrek gravatar image Misrek  ( 2022-01-10 04:56:24 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-01-10 03:02:21 -0500

Seen: 501 times

Last updated: Jan 10 '22