Commonroad convert to SUMO

Hello,

I wish to ask if the repository commonroad-sumo-interface: tum-cps / commonroad-sumo-interface · GitLab (lrz.de) could achieve the conversion from commonroad scenario to the SUMO scenario?
I followed the tutorial in the readme in the repository and Examples for using the interface — commonroad-sumo-interface 2022.1 documentation (lrz.de), but could not find the way to convert from commonroad to SUMO.

thank you so much!

Best,
Tian

Hello Tian,

The Code for the CommonRoad to SUMO conversion is part of the Scenario Designer repo; most likely you are searching for this directory.

Best regards,
Florian

Dear Florian,

thank you for your answer! I succeed by converting the net/map from commonroad to SUMO using the Scenario Designer repo.
I wish to also convert the dynamic scneario from commonroad to SUMO. Is this scenario conversion possible using the commonroad-sumo-interface tum-cps / commonroad-sumo-interface · GitLab (lrz.de) repo maybe?

Dear Tian,

Depending on the type of conversion you aim for, the Interactive Scenarios Repo might be helpful for you. If you cannot find a suitable solution in one of the named repos, please send me a more precise description of what you’re looking for.

Best regards,
Florian

Dear Florian,

I also tried with the Interactive Scenarios Repo. I went through its tutorial script. Instead of visualizing the traffic scenario in commonroad, I wish to visualize the scenario in SUMO GUI. Is this maybe also possible?

Hello Tian,

This tutorial shows how to convert a CommonRoad scenario into a SUMO one. In particular, once the .sumo.cfg file has been created (line 57 in the tutorial), you can open the .sumo.cfg file in the SUMO GUI.

Best regards,
Florian

Hello Florian,

thank you for your help! I tried with the tutorial. It seems the same as using the commonroad GUI to convert. I got from both methods the same problem. The SUMO file seems not the same as the traffic low shown in commonroad. Here are the cr.xml file and the files for SUMO: CR2SUMO_test – Google Drive. Did I misunderstand the scenario conversion, or did I misunderstand the meaning of the scenario maybe?

Hello Tian,

We typically use SUMO to generate traffic on our Lanelet Networks, not to visualize or further edit CommonRoad scenarios. Therefore, I don’t know whether the functionality which you have in mind is currently implemented. I’ll take a look into this and let you know.

Best regards,
Florian

Hello Florian,

thank you so much! Any help or suggestion regarding the visualization of CommonRoad scenarios on SUMO would be helpful for me!

Best,
Tian

Hello Tian,

If you choose to create the traffic in SUMO based on the trajectories of dynamic obstacles in CommonRoad scenarios (with this parameter), the trajectories of the dynamic obstacles are actually abstracted to a sequence of edges which are traveled (the SUMO route file). Thus, a direct conversion of the concrete trajectories is currently not implemented. Is it even possible to set concrete trajectories for vehicles in SUMO? In the SUMO documentation, I could not find a suitable method. Please let me know if you have a suggestion how to set concrete trajectories for vehicles in SUMO.

Best regards,
Florian

Hello Florian,

thank you for your help and explanation. I have another question about the interactive SUMO-Commonroad repo. I understood the purpose and procedure of it as following:

We wish to test some motion planner with the help of the commonroad. But the behavior of non-ego vehicles reacting to the ego vehicles’ behavior is not realistic. So if the ego vehicle is about to change onto another lane, we let the SUMO engine take over and control the surrounding non-ego cars. We override states of host vehicles at each time increment ∆tS using the TraCI commands moveToXY for the position and orientation and setSpeed for velocity. After the SUMO take control, the x, y positions of the dynamic non-ego vehicles are converted from SUMO to Commonroad.

My question is: When the ego vehicle is about to change lane and the SUMO need to take over the control, where did we get the position and speed info of the host vehicle? Where did the interface interpolate the states of the host vehicles for every time increment ∆tS and sends them to SUMO?

Best,
Tian

Hello Florian,

The conversion from CommonRoad to SUMO for a simple scenario without any traffic sign works properly. Then I tried conversion for a scenario with traffic signs. I got an error message said, that the “Lanelet” object has no attribute “to_xml”. Should I reinstall the commonroad-sceanrio-designer package?

Best,
Tian

Hello Tian,

Why don’t you use SUMO for controlling the surrounding vehicles all the time? That’s what the coupling of interactive CommonRoad scenarios with SUMO is made for.

Regarding your question: What do you mean by ‘host vehicle’? Is it the ‘ego vehicle’? If you use your own motion planner, the position and speed information should be provided by the motion planner, don’t they?

Maybe I didn’t get your question or aim correctly. In that case, please create another topic in this forum where you also provide more context. Thanks!

Best regards,
Florian

Hello Tian,

Please open a new thread for your question, where you attach (or name) the scenario file which you want to convert. Moreover, please include the terminal output. Do you use the latest version of the scenario-designer, commonroad-io, and sumocr?

Best regards,
Florian