0
$\begingroup$

Rosanswers logo

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


Originally posted by g-emad on ROS Answers with karma: 15 on 2016-03-19

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by al-dev with karma: 883 on 2016-03-19

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by g-emad on 2016-03-20:
i did so, but the map_server halt at the waiting for the map state

Comment by al-dev on 2016-03-20:
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.

Comment by g-emad on 2016-03-21:
done please help

Comment by al-dev on 2016-03-21:
See my edit, you have a typo

Comment by g-emad on 2016-03-21:
thanks it now works , i spent many days searching because of this space :D

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.