Closed daohu527 closed 4 years ago
I found some ways to create a new map from the OSM data format:
By the way, The most effect way to create a new unity scenes is just replace the environment by the models export from cityengine?
Utymap. Which is a open source project to generate city 3d models by OSM data. utymap
You can also look at OSM unity
When you import the city 3d models into unity, you can use the HDMap Tool to make and export the HDMap to apollo or autoware.
If you want to import hdmap directly, you must create a function that automatically generates roads and buildings. I think it might be possible to import OSM data first. And make an adpter to change hdmap to osm map. Then the map of the game is the same as the real map. You don't need to create a HD map twice.
I think there are different uses cases for map import that can require very different implementations.
One use case is when user wants to import HD map for testing their path planning or routing. They do not necessary care about buildings or great visuals as long as basic road network is created so that NPC vehicles can use it. I would say this is a good way to start import - just create hdmap annotations and put everything on a plane (so car can drive). For a lot of use case this can be enough.
Next step - to add buildings actual road surface, with or without textures could be done later. Getting actual data is tricky part. One option is to generate them procedurally. This could give you very nice visuals, but requires more work. Another would be to use real world data. But that sometimes is not enough if it has low precision or low quality. Running perception can require high quality/precision data that something like OSM might not have.
Good advice! The simulation is used to test autonomous driving, and we need to be as real as possible, not completely real. In fact, we need more scenarios. A completely real world does require a lot of simulation work. We need accurate location information, buildings, plants, textures, etc.
One use case is when user wants to import HD map for testing their path planning or routing. They do not necessary care about buildings or great visuals as long as basic road network is created so that NPC vehicles can use it. I would say this is a good way to start import - just create hdmap annotations and put everything on a plane (so car can drive). For a lot of use case this can be enough.
This is really what we want, apollo provides "sim_control", which is a simple simulation test planning module. But it can't detect collisions, and NPC is not smart. It is much easier to achieve this in Unity.
First, import HD maps into Unity and only generate roads without buildings. Then send the traffic light status and NPC location information to Apollo or Autoware. Finally, control the car to drive and detect collisions, whether or not exceed the road.
By the way, is there an API that provides NPC location and speed information?
Next step - to add buildings actual road surface, with or without textures could be done later. Getting actual data is tricky part. One option is to generate them procedurally. This could give you very nice visuals, but requires more work. Another would be to use real world data. But that sometimes is not enough if it has low precision or low quality. Running perception can require high quality/precision data that something like OSM might not have.
Currently, I think the better way is to use OSM data to generate buildings, although the accuracy may not be enough. Otherwise, it is difficult to have other good data. Where do we get real data?
By the way, is there an API that provides NPC location and speed information?
Yes, Python API can get and set any npc location and speed.
There is no easy way to get real data with good quality. We are internally currently working on pipeline to generate map from collected point cloud & camera. But that won't have good accuracy for buildings. But it will have good quality road - accurate geometry and color information.
Good, I will try to do it.
Currently, does the simulator support changing the angle of view? If just test the planning module, I think the overhead view is a good choice.
Not during runtime. But if you run inside Editor you can use Scene view to switch camera to orthographic projection and keep camera position above the car pointing downwards.
Additional, How does the NPC know the lane and the direction? They just move by program or they have AI and know the lane, the direction and the traffic light?
Basically, we have map annotations for each scene, and this map annotations have these information: lane, direction, traffic light, traffic sign, and etc. NPCs know the lane and the direction using the map annotations and drive around following the traffic rules we have. By AI, if you are asking if NPCs are detecting lanes or traffic lights using its own sensors, they are not for performance reasons. Only ego vehicles have sensors like a camera or LiDAR and can be controlled by AD stack.
@martins-mozeiko I have created a demo, but there are some questions to discuss. This is a map rendering.
Additional, How does the NPC know the lane and the direction? They just move by program or they have AI and know the lane, the direction and the traffic light?
NPC's does not have advanced AI - they just follow annotated lanes, stop at traffic lights (which are annotated, so they know exact position & state of light). Then they randomly decide to turn or drive straight. NPCs do not use any sensors like EGO vehicle does.
Did you take street_one_way4lane material from SanFrancisco scene? This material is very hardcoded to roads in SF scene. If you want to create new different roads, then you will need to use texture manipulation and 3d editor software (Photoshop and Maya or similar) to adjust mesh and texture so it looks good. Unity cannot do this for you.
I render based on the lane instead of the road. And it seems to work, I will upload a branch to see the effect
@martins-mozeiko I have already submit a pull request. Could you pls make a review #243
I want to import hd map into lg simulator, maybe the openstreet format first. And then I will try apollo hd map format.
It's useful for end to end test in self-driving. If you first create a map in the simulator and then export it as a hd map format. Actually the maps we use in apollo or autoware are labeled with other systems and they cannot be unified. So we need to import the label map into simulator without any 3d geometry structure. We will automatically generate it. Then you can adjust the house and street map in the simulator.
By the way, when did you release the version?
101