carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.38k stars 3.69k forks source link

Grid map #8180

Open johnren-code opened 1 month ago

johnren-code commented 1 month ago

How to get the grid map of carla map?

PatrickPromitzer commented 1 month ago

Hi, if you want the Road data of a Map, you can get it with

client = carla.Client("127.0.0.1",  2000) 
world = client.get_world()
map = world.get_map()
opendrive_string = map.to_opendrive()

If you want something else, I would need more information of the kind of Grid you want.

johnren-code commented 1 month ago

It is the raster map used for path planning that contains the map possessed or not possessed

PatrickPromitzer commented 1 month ago

I didn't find something fitting, but with the Semantic LIDAR sensor you should be able to crate one yourself. https://carla.readthedocs.io/en/latest/ref_sensors/#semantic-lidar-sensor

Set the Semantic Lidar to different places of the map, and use the "tag" to find roads, ground, buildings, ....

raw_data (bytes)    

- Array containing the point cloud with instance and semantic information. 
  For each point, four 32-bits floats are stored. XYZ coordinates.
- cosine of the incident angle.
- Unsigned int containing the index of the object hit.
- Unsigned int containing the semantic tag of the object it.