For ROS navigation stack, map_server
is responsible to read the map. So you need to go through the map_server wiki after reading my answer.
Basically, map_server
need two files, i.e a image file and a YAML file. The YAML file describes the map meta-data, and names the image file. The image file encodes the occupancy data.
The image file is the 2D drawing of the map, it is read in via SDL image library. So most popular image formats are widely supported, such as .pgm, .png, .jpg, etc. I don't know if the CAD format is supported, but maybe you can convert the CAD drawing format into regular image format.
In my project, I used the GIMP to draw a map, and output a .pgm image.
EDIT
In the YAML file, there is a param named resolution
, which is the resolution of the map, meters / pixel.
For example, the image is 400x300, and resolution=0.1, then your map is 40mx30m.
And my project is not open-source yet.
Can you be more specific? Are you talking about a 2D CAD drawing? Or a 3D model? How is the map stored? (i.e. what filetype is it saved as?)
The map is a 2D drawing its like floor plan of an indoor environment, the files will be in typical CAD drawing format Eg: .dae, .stl, .xml.