Convert xml into pickle error Tutorial 1

Hi there,

I’ve been using the xml files generated from commonroad scenario designer GUI, in which the planning problem and static obstacles are also added.

When I convert 200 xml files into pickle files, the progress bar shows 200 files fully converted, but in the generated folder ‘problem’ there is only one pickle file called ‘ZAM_Test-1_1_T-1.pickle’ generated, which doesn’t share the name with any xml file I’ve been input.

These xml files are validated by tutorial 01.3 and can been visualized in tutorial 01.4. And the ‘meta_scenario’ folder is also generated with a ‘meta_scenario_reset_dict.pickle’ in it. The 200 xml files have different obstacles in them with different obstacle ids.

Does someone have similar experience and could help me?

BR
Qiuyi

Dear Qiuyi,

That is indeed very strange. Could you maybe send 10 of the scenarios to me via Email?

Best,
Xiao

Hi Qiuyi,

I had a look at the scenario xmls you sent me. The problem was that all scenarios you created had the same benchmark id. Each scenario should have its own unique id and the pickle file name will be the same as the benchmark id. Therefore, the converted pickles all had the same file names and were overwritten one by one.

Best,
Xiao

Hi Xiao,

thanks for your notification. The benchmark id cannot be set by commonroad file writer so I used element tree to hard change the benchmark id. And now they can be successfully convert to pickle files.
During the process, I found that the name of the xml files have a certain naming principles to follow, but I don’t find any relevant doc. If you have any similar doc, would you share here?
And also is there existing API that we can use to change benchmarkID?

BR,
Qiuyi

Hi Qiuyi,

The benchmark id is assigned when you construct a Scenario class, not when you use the file writer to write a scenario into xml. The pattern for the benchmark id is explained in this pdf in section 2.1.2.

Best,
Xiao