usdot-fhwa-stol / cdasim

CDASim is an open-source simulation system supporting the development and testing of Cooperative Driving Automation applications.
38 stars 13 forks source link

Question on how to convert town04.xodr to mosaic folder #145

Closed Jonyian closed 1 year ago

Jonyian commented 1 year ago

Summary

When I used your tool to convert the example in your carma-simulation, town04.net.xml, to town04.db, there was a problem, and the lane information in .net could not be recognized, so how did you do it at that time?...

Version

4.3.0 (Current)

Expected Behavior

see above

Actual Behavior

16:58:10.756 INFO - initializing database 16:58:10.814 INFO - parsing net file 16:58:10.826 ERROR |- An unexpected error occurred. java.lang.NullPointerException: If import-zone is not given, import-lat and import-lon must be defined. at org.apache.commons.lang3.Validate.notNull(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.importer.sumo.a.a(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.importer.sumo.b.a(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.importer.sumo.b.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at java.xml/javax.xml.parsers.SAXParser.parse(SAXParser.java:276) at com.dcaiti.mosaic.tools.scenarioconvert.importer.sumo.b.a(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.importer.sumo.a.a(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.core.a.a(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.core.Starter.main(Unknown Source) 16:58:10.827 ERROR |- Could not load network data from Net File. java.lang.IllegalStateException: Could not parse network file at com.dcaiti.mosaic.tools.scenarioconvert.importer.sumo.b.a(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.importer.sumo.a.a(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.core.a.a(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.core.Starter.main(Unknown Source) Caused by: java.lang.NullPointerException: If import-zone is not given, import-lat and import-lon must be defined. at org.apache.commons.lang3.Validate.notNull(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.importer.sumo.a.a(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.importer.sumo.b.a(Unknown Source) at com.dcaiti.mosaic.tools.scenarioconvert.importer.sumo.b.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at java.xml/javax.xml.parsers.SAXParser.parse(SAXParser.java:276) ... 4 common frames omitted 16:58:10.828 INFO - no route file for import given, ignoring! 16:58:12.740 INFO - Saving 0 nodes... 16:58:12.741 INFO - Saving 0 ways... 16:58:12.741 INFO - Saving 0 connections... 16:58:12.741 INFO - Saving 0 restrictions... 16:58:12.741 INFO - Saving 0 routes... 16:58:12.741 INFO - Saving 0 roundabouts... 16:58:12.741 INFO - Saving 0 buildings... 16:58:12.741 INFO - Create Indices 16:58:12.881 INFO - Database saved 16:58:12.882 INFO - finished

Steps to Reproduce the Actual Behavior

java -jar scenario-convert.jar --sumo2db -i town04.net.xml

Related Work

No response

chengyuan0124 commented 1 year ago

From log you provided java.lang.NullPointerException: If import-zone is not given, import-lat and import-lon must be defined. It seems like you didn't provide zone or lat and lon arguments.

Jonyian commented 1 year ago

Hello, thank you very much for your reply, how can zone or lat and lon arguments be defined? Because I am trying to use the convert tool provided by the project to reproduce the process from town04.xodr to town04.db in the demo, I have not modified any parameters. But there is this problem, do you know how to solve this problem?

chengyuan0124 commented 1 year ago

To view the available arguments for deployment, you can add -h after your command.

--import-lat <DOUBLE>                  Center latitude of imported region to project coordinates.
--import-lon <DOUBLE>                  Center longitude of imported region to project coordinates.

Typically, the latitude and longitude values are set to the same values as those found in the scenario_config.json file located in the scenario folder.