ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

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

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


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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 256 times

Last updated: Jan 10 '22