esmini: Simulation does not stop even though a trigger is evaluated true
I am playing around with the new conditions which are added with OpenScenario V1.1 (THW and TTC). I got a scenario in which my ego collides with a challenger vehicle. I included a stop trigger to the storyboard to evaluate true if the ego has a collision. Even though the log.txt shows that the collision was recognized the simulation continues. I think this is the relevant information for this.
1.876: Collision between EgoVehicle and ChallengingVehicle_945
this is from the log.txt
I have several stop triggers added and from my understanding, they are connected with a logical OR. So if one evaluates to true the trigger should be acting. I hope you can help me with this
</Story>
<StopTrigger>
<ConditionGroup>
<Condition name="Time headaway trigger" delay="0" conditionEdge="rising">
<ByEntityCondition>
<TriggeringEntities triggeringEntitiesRule="any">
<EntityRef entityRef="EgoVehicle"/>
</TriggeringEntities>
<EntityCondition>
<TimeHeadwayCondition entityRef="EgoVehicle" value="5" relativeDistanceType="longitudinal" coordinateSystem="road" freespace="true" rule="lessThan"/>
</EntityCondition>
</ByEntityCondition>
</Condition>
</ConditionGroup>
<ConditionGroup>
<Condition name="Time to collision trigger" delay="0" conditionEdge="rising">
<ByEntityCondition>
<TriggeringEntities triggeringEntitiesRule="any">
<EntityRef entityRef="EgoVehicle"/>
</TriggeringEntities>
<EntityCondition>
<TimeToCollisionCondition value="15" relativeDistanceType="longitudinal" coordinateSystem="road" freespace="true" rule="lessThan">
<TimeToCollisionConditionTarget>
<EntityRef entityRef="EgoVehicle"/>
</TimeToCollisionConditionTarget>
</TimeToCollisionCondition>
</EntityCondition>
</ByEntityCondition>
</Condition>
</ConditionGroup>
<ConditionGroup>
<Condition name="Reach position condition" delay="0" conditionEdge="rising">
<ByEntityCondition>
<TriggeringEntities triggeringEntitiesRule="any">
<EntityRef entityRef="EgoVehicle"/>
</TriggeringEntities>
<EntityCondition>
<ReachPositionCondition tolerance="1">
<Position>
<WorldPosition x="335.6357" y="-67.9807" z="0" h="2.216713012360714" p="0" r="0"/>
</Position>
</ReachPositionCondition>
</EntityCondition>
</ByEntityCondition>
</Condition>
</ConditionGroup>
<ConditionGroup>
<Condition name="Collision trigger" delay="0" conditionEdge="rising">
<ByEntityCondition>
<TriggeringEntities triggeringEntitiesRule="any">
<EntityRef entityRef="EgoVehicle"/>
</TriggeringEntities>
<EntityCondition>
<CollisionCondition>
<EntityRef entityRef="EgoVehicle"/>
</CollisionCondition>
</EntityCondition>
</ByEntityCondition>
</Condition>
</ConditionGroup>
</StopTrigger>
</Storyboard>
</OpenSCENARIO>
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 26
We found (or rather, you found 😃) an issue in esmini interpretation of the EntityAction. The entityRef should be an attribute to the EntityAction (parent) element, not AddEntityAction or DeleteEntityAction. Its obvious in the documentation. It was me reading sloppy.
Anyway, it should now be fixed (both application code and example scenario) in esmini by commit https://github.com/esmini/esmini/commit/669ced4b10bd347300d926ad532af34172d498ed
I’ll keep the issue open until release.
Release v2.20.3 available. Closing the issue.
That’s really good news. Thanks for reporting the issue. We actually learned, and now shared, some lessons how to deal with large (in terms of #entities) scenarios. And esmini was improved as well. Closing the issue.
I just tested it and it runs very smoothly. All proposed solutions and additions work fine as well. Again thank you very much for your help.
Release v2.20.2 available. Please test and report how it works.
I understand. I hope we can find something that can improve performance for this kind of scenarios. Will try to look into it in the next couple of days.
Okay, due to company regulations It would be awesome if you could give me an e-mail I can send an example to.
That’s a good workaround I guess. Thank you for your answers!
Well, the simplest solution I see is to just add empty actions like in the example (same as previous): Unittest/xosc/test-collision-detection.xosc. There are collision conditions that will be logged (like all conditions) but no action is taken:
This is the only solution I see. Only collision detections are automatically evaluated, not TTC, HWT and other measurements (I can imaging many, just think about all relative distances, velocity and so on…). Users can use conditions for those, which is the OpenSCENARIO way to go.
Alright, that helps a lot. Thank you very much!