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

convert image to occupancy grid ?

asked 2016-03-19 09:49:47 -0500

g-emad gravatar image

updated 2016-03-21 12:21:23 -0500

how to convert image taken from camera to occupancy grid map ? what i did till now is to :

1- i made this photo by paint just a white area with black boarders to let the robot moves within it

http://imgur.com/7ize04b

2- create a .ymal file with the same name at the same dir with this content

image:map.png
resolution: 0.1
origin: [0.0, 0.0, 0.0]
occupied_thresh: 0.65
free_thresh: 0.196
negate: 0

3- run the roscore

4- rosrun map_server map_server map.yaml

and nothing happens , i checked the published topics using rostopic list and nothing is published, please help

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2016-03-19 22:45:35 -0500

al-dev gravatar image

updated 2016-03-21 15:53:11 -0500

The map_server package can probably help : http://wiki.ros.org/map_server

Write a .yaml file as specified on the wiki page and try to run rosrun map_server map_server mymap.yaml

Edit: You have a typo in your yaml : the first line needs an additional space : image: map.png instead of image:map.png. To prevent this kind of mistakes in the future, I suggest you look up how to enable syntax highlighting for yaml in your editor and/or use a yaml validator if you really have a doubt. But usually your yaml library will do most of the job.

edit flag offensive delete link more

Comments

i did so, but the map_server halt at the waiting for the map state

g-emad gravatar image g-emad  ( 2016-03-20 10:58:16 -0500 )edit

Can you edit your post to add your procedure and the complete output of your commands ? You must explain what you have tried before people can help you.

al-dev gravatar image al-dev  ( 2016-03-20 13:41:37 -0500 )edit

done please help

g-emad gravatar image g-emad  ( 2016-03-21 12:21:35 -0500 )edit

See my edit, you have a typo

al-dev gravatar image al-dev  ( 2016-03-21 15:28:08 -0500 )edit

thanks it now works , i spent many days searching because of this space :D

g-emad gravatar image g-emad  ( 2016-03-21 18:35:14 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-03-19 09:49:47 -0500

Seen: 4,361 times

Last updated: Mar 21 '16