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

How to make a nav_msgs/OccupancyGrid manually? [closed]

asked 2019-12-29 16:28:12 -0500

ros-noob gravatar image

Suppose I have a .png extension map in which the blocked paths are in black and free spots are white. Using OpenCV, how can I get an OccupancyGrid without using any external libraries?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by allenh1
close date 2020-01-02 16:34:52.494674

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-12-30 06:13:51 -0500

pkvk gravatar image

Occupancy Grids are probability maps, each grid shows the probability of an obstacle existing over there. So convert png into an array by reading the image using imread. And change the array values accordingly to match between 0 to 100.

edit flag offensive delete link more

Comments

Okay so, after making the changes to the array I'll just publish it as an OccupancyGrid right?

ros-noob gravatar image ros-noob  ( 2019-12-30 11:50:00 -0500 )edit

Yes, give it the details it's needs under nav_msgs/OccupancyGrid. Interesting taskphase eh?

pkvk gravatar image pkvk  ( 2019-12-30 11:58:32 -0500 )edit

Oh okay. Pretty interesting indeed hahaha

ros-noob gravatar image ros-noob  ( 2019-12-30 13:34:05 -0500 )edit

I am having the same exact issue. Could you please post the code of the solution if you found it? Thank you very much!

RayROS gravatar image RayROS  ( 2019-12-30 18:53:01 -0500 )edit

Check this out. It might solve your issue as well.

ros-noob gravatar image ros-noob  ( 2020-01-01 09:34:27 -0500 )edit

Thanks! It does :)

RayROS gravatar image RayROS  ( 2020-01-02 06:07:56 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-12-29 16:28:12 -0500

Seen: 420 times

Last updated: Dec 30 '19