[Redmine #8131] Indicate type of Object when using CatalogReferences
Bugzilla Link | 4044 |
Created on | May 24, 2019 09:23 |
Version | 0.9.1 |
Extended Description
https://redmine.vires.com/issues/8131
Andreas Biehn wrote:
With OSC 0.9.1 an Object (OpenSCENARIO->Entities->Object) from a CatalogReference could either be a Vehicle, a Pedestrian or a MiscObject, one will find out not until opening and parsing the catalog:
<Object name="Player1">
<CatalogReference catalogName="myAmbiguousCatalog" entryName="myAmbiguousPlayer"/> could be Vehicle, Pedestrian or MiscObject
</Object>
At any other location that uses CatalogReferences it is clear upfront what type of catalog entry must be used, e.g. in the FollowTrajectory action, only OSCTrajectory catalog entries can be used.
For consistency I would suggest to clarify the type of object also for Objects.
This could be done either by
using a type attribute
<Object name="Player1" type="vehicle|pedestrian|miscObject">
or by embedding the CatalogReference in another XML-tag indicating the type ob object
<Entities>
<Object name="Player1">
<Pedestrian>
<!-- choice: -->
<CatalogReference> must be a OSCPedestrian catalog entry
<Pedestrian> ... </Pedestrian>
</Pedestrian>
</Object>
</Entities>
The latter option is not very nice for inline-defined Objects because of doubled Tags (e.g. ) or, if we call it e.g. on the level above () we end with .
Suggestions are welcome or isn't this a problem at all?
René Weidling wrote:
I've talked with my colleagues and the current status is not a problem for us, per se. However, we would appreciate it if the intended type was defined within the scenario. The first proposal (with the added "type" attribute for the "Object" element) sounds good to us.
Additionally, we would like to propose a similar mechanism for the catalogs. Currently, the type of catalog is solely defined by its member elements. We propose to also add a "type" attribute to the "Catalog" element to help identify the type of catalog without needing to parse its members.