Lewati ke konten

End and fail conditions — stop the run, and judge it

Konten ini belum tersedia dalam bahasa Anda.

Two different questions, two different panels:

  • END CONDITIONSwhen does the run stop?
  • FAIL CONDITIONSwas the run a failure?

Both live on the last node of the logic graph. Select the END CONDITIONS node and the attribute panel shows both sections.

The END CONDITIONS node's attribute panel, showing END CONDITIONS set to Automatic above a FAIL CONDITIONS section with a Collision row

Keeping them apart matters. A run that stops after 30 seconds has not therefore succeeded, and a run that ends in a collision after 4 seconds has not therefore behaved correctly. The end condition controls the clock; the fail conditions decide the verdict.

The node summarises itself in one line:

SummaryMeaning
AutomaticNo explicit condition. The run stops when every phase and event has finished.
After <name> endsAn imported StopTrigger, for example After CutInManeuver ends.

+ Add condition in the panel lets you set one explicitly. The choices are the same catalogue used for event triggers, minus Immediately (no condition)18 conditions:

Simulation time · Time gap to actor · Time to collision ·
Distance to actor · Traveled distance · Phase / event state ·
Distance to point · Reach position · End of road · Actor speed ·
Relative speed · Stand still · Actor acceleration · Collision ·
Off-road · Scenario parameter · Scenario variable · Traffic signal

Conditions combine with ALL OF (AND) and or… exactly as event triggers do.

In the exported .xosc this becomes the storyboard’s StopTrigger, so other OpenSCENARIO 1.x tools honour it.

Three end conditions cover most work:

  • Leave it on Automatic while you are authoring. The run stops by itself once your events are done.
  • Simulation time for a fixed-length run — the usual choice when a scenario feeds a batch or a comparison.
  • Phase / event state, state ends to stop as soon as the manoeuvre under test completes, no matter how long it takes.

The section says what it does:

FAIL CONDITIONS Fails the simulation when triggered during playback.

A fail condition is an assertion. If it triggers at any point during the run, the run ends with a FAIL verdict instead of running to its end condition.

New scenarios start with one:

[Collision ▾] [✕]
ACTOR A [Any actor ▾]
Collision (default) — added automatically for new scenarios.

So a freshly drawn scenario already fails on any collision. + Add fail condition adds another row; each row has an to remove it. A newly added row repeats the same type as the default, so change its type after adding it.

Fail conditions are drawtonomy’s own concept — they are not part of the ASAM OpenSCENARIO standard. See How they are stored.

TypeFails when
CollisionThe selected actor collides with another entity. Any actor watches every entity in the scenario.
Actor speedAn actor’s speed satisfies the rule you set — absolute, or relative to another actor.
Distance to actorThe distance between two actors falls below, or exceeds, a threshold.
Distance to pointAn actor’s distance to a fixed point falls below, or exceeds, a threshold.
Longitudinal distance to actorThe along-road gap to another actor crosses a threshold, measured ahead, behind, or either way.
DurationAnother condition holds continuously for longer than a given time.
Simulation timeThe run reaches a given time — a timeout.
Phase stateA phase starts, is running, or ends.
SettingChoices
Actor selectionAny actor, or a named entity
Distance rulefalls below / exceeds
Speed rule= equals / > greater than / ≥ greater or equal / < less than / ≤ less or equal / ≠ not equal
Speed basisAbsolute speed / Relative to actor
Relative speed directionAny direction / Faster / Slower / Same speed
Longitudinal sideAhead or behind / Ahead / Behind
Phase statestarts / is running / ends

Duration is not a condition of its own — it is a “for how long” wrapper. Pick it, then pick the inner condition from four:

  • Actor speed
  • Distance to actor
  • Distance to point
  • Longitudinal distance to actor

This is how you express tolerance. “The gap dropped below 5 m for a single frame” is usually noise; “the gap stayed below 5 m for two seconds” is a finding. Wrap the distance condition in a Duration and you have said the second thing.

The transport row with a red FAIL badge and a red cross marker on the timeline where a fail condition triggered

The badge on the transport row reports the state of the run:

BadgeMeaning
IDLENot running. Nothing has been evaluated.
RUNRunning. No fail condition has triggered yet.
PASSThe run reached its end condition without any fail condition triggering.
FAILA fail condition triggered. The run stopped there.

PASS therefore means “finished, and none of my assertions fired”. It is only as meaningful as the fail conditions you wrote — a scenario with the conditions removed will report PASS for almost any behaviour.

The pattern is the same one used for automated tests:

  1. Set up the situation. Road, actors, phases, events.
  2. Say what must not happen. Fail conditions: no collision; the gap never falls below 5 m for more than a second; the ego never exceeds the speed limit; the run never takes longer than 30 s.
  3. Say when to stop looking. End condition: a simulation time, or the state of the manoeuvre under test.
  4. Run it and read the badge.

Some conditions worth reaching for:

IntentCondition
No contactCollision, Any actor
Keep a safe gapDurationDistance to actor, falls below, with a tolerance
Do not tailgateLongitudinal distance to actor, Ahead, falls below
Respect a limitActor speed, > greater than, Absolute speed
Do not stall the scenarioSimulation time as a timeout
Do not overtakeRelative speed, Faster

Fail conditions are outside the ASAM OpenSCENARIO standard, so drawtonomy keeps them where a standards-compliant reader will ignore them: as a drawtonomy:failConditions entry in the scenario’s ParameterDeclarations.

Consequences worth knowing:

  • The parameter is written only when you have edited the fail conditions. A scenario left on the defaults exports without it, so nothing extra appears in your .xosc.
  • Other OpenSCENARIO tools read the file normally — an unknown parameter declaration is inert.
  • Re-importing the same file into drawtonomy restores the conditions exactly.
  • A .xosc imported from elsewhere starts with no fail conditions, so an imported scenario never reports a FAIL you did not ask for.