RA-Consulting-GmbH / openscenario.api.test

Apache License 2.0
38 stars 11 forks source link

XML export wrong for ParameterDeclaration element #200

Open arauschert opened 11 months ago

arauschert commented 11 months ago

Describe the bug When exporting a scenario to XML with the OpenScenarioXmlExporterV1_2, then the elements for parameters are wrong. The parent element is ParameterDeclaration and the child elements are ParameterDeclarations. Instead the parent element must be ParameterDeclarationsand the child elements must be ParameterDeclaration. Maybe because ParameterDeclarations is a wrapped list, it needed some manual implementation and was therefore not according to the schema.

See also: https://www.asam.net/static_downloads/ASAM_OpenSCENARIO_V1.2.0_Model_Documentation/modelDocumentation/content/ScenarioDefinition.html

Error is e.g. here (occurs for all places, where ParameterDeclarationsare defined in the scenario): https://github.com/RA-Consulting-GmbH/openscenario.api.test/blob/6c6d6c43764029033b35987d1b8d69cea3a873f0/cpp/openScenarioLib/generated/v1_2/export/xml/OpenScenarioXmlExporterV1_2.cpp#L1349

To Reproduce

  1. parse xosc scenario with parameter declarations
  2. write xosc scenario with OpenScenarioXmlExporterV1_2
  3. investigate tiny xml output

Expected behavior xml output contains ParameterDeclarations as parent element and ParameterDeclaration as child

Screenshots

<ParameterDeclaration>
    <ParameterDeclarations name="duration" parameterType="double" value="6000"/>
    <ParameterDeclarations name="deg_to_rad" parameterType="double" value="0.017453292519943295"/>
</ParameterDeclaration>