lgsvl / simulator

A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Other
2.29k stars 780 forks source link

Build environment map with self-reversed lanes #1325

Open MisterioRemo opened 3 years ago

MisterioRemo commented 3 years ago

Our team have a HD map with self-reversing lanes, so when I try to build an environment, I get an error:

ArgumentNullException: Value cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <9577ac7a62ef43179789031239ba8798>:0)
Simulator.Editor.ApolloMapTool.Calculate () (at Assets/Scripts/Editor/ApolloMapTool.cs:1022)
Simulator.Editor.ApolloMapTool.Export (System.String filePath) (at Assets/Scripts/Editor/ApolloMapTool.cs:2832)
Simulator.Editor.Build+BundleData.PrepareSceneManifest (Simulator.Editor.Build+BundleData+Entry sceneEntry, System.String outputFolder, System.Collections.Generic.List`1[T] buildArtifacts, Simulator.Manifest manifest) (at Assets/Scripts/Editor/Build.cs:383)
Simulator.Editor.Build+BundleData.RunBuild (System.String outputFolder) (at Assets/Scripts/Editor/Build.cs:514)
Simulator.Editor.Build.BuildBundles (System.String outputFolder, System.Action onComplete) (at Assets/Scripts/Editor/Build.cs:1104)
Simulator.Editor.Build+<>c__DisplayClass18_0.<OnGUI>b__1 () (at Assets/Scripts/Editor/Build.cs:940)
UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at <afa5b9a1793446ff98b741dc036c4c6e>:0)

We assumed this is because the self-reversed lanes are only supported on Apollo 5.0. So I temporarily commented out the Apollo 3.0 related code in Build.cs in void PrepareSceneManifest(). Then I managed to build environment successfully.

Сan you add an option to the environments build menu (Build Map & Vehicle) to select which HD map formats should be supported?

lemketron commented 3 years ago

Thanks for the detailed report and suggestion; glad you were able to work around it (and thanks for sharing the fix).