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

Converting 2d image to occupancy grid on ros2 foxy

asked 2022-03-10 20:57:35 -0600

Flash gravatar image

updated 2022-03-10 21:01:49 -0600

Hi,
I am having trouble converting images to grids on ros2 foxy. Any help will be much appreciated. I checked the links for nav2 but was unable to get this done.
Thanks,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-03-11 06:13:00 -0600

ljaniec gravatar image

Could you add these Nav2 links to your answer, with description of your problems? Only then you can expect some useful answers.

What kind of image do you want to convert? Do you want to convert probability map to ROS OccupancyGrid message?

You can do it by hand with PGM files by threshold of every cell either to 0 or 1, then up/down scaling to fit chosen resolution. It could be done automatically with some graphics library, e.g. Shapely (Python).

You can base your implementation on some ROS packages like this one: https://github.com/awesomebytes/occup... (ROS1), https://github.com/clearpathrobotics/... (ROS1) etc.

You can find even more for sure.

edit flag offensive delete link more

Comments

1

The link I tried to use is https://index.ros.org/p/nav2_map_server/. I have the png/pgm format of the image which I want to convert to the grid with 1 and 0 so that I can use the algorithm using that grid. I will try to use python or opencv methods and see if I can work with them.

Flash gravatar image Flash  ( 2022-03-12 17:58:56 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2022-03-10 20:57:35 -0600

Seen: 924 times

Last updated: Mar 11 '22