carla-simulator / scenario_runner

Traffic scenario definition and execution engine
https://carla-scenariorunner.readthedocs.io/en/latest/
MIT License
536 stars 365 forks source link

The stop trigger on the storyboard is not working. #1069

Open hlsongg opened 7 months ago

hlsongg commented 7 months ago

I made an example of the situation below.

[Example]

  1. The Ego vehicle starts at SimulationTime = 0 and increases the speed from 0 to 60 km/h. (Accelerate for 5 seconds)
  2. In front of the lane where the Ego vehicle(hero) is located, there is a counter vehicle(standing).
  3. If the distance between the Ego vehicle(hero) and the counter vehicle(standing) is narrowed to 30 m, the speed of the Ego vehicle(hero) is reduced to 30 km/h.
  4. Both vehicles continue to drive for 1 minute and terminate.

I have a OpenSCENARIO file which has scenario end condition (StopTrigger on StoryBoard) as StoryboardElementStateCondition converting to endTransition. However, after SlowPrecordingStartCondition is triggered, the stop trigger does not work and ends with the following error. How can I fix it to do the scenario as intended? Destroying ego vehicle 147 ERROR: failed to destroy actor 147 : unable to destroy actor: not found

`<?xml version="1.0"?>

`
dx6nxr commented 1 month ago

If I remember correctly, endTransition is not supported as for now.

Best, Ivan

dx6nxr commented 1 month ago

If I remember correctly, endTransition is not supported as for now.

Best, Ivan

Following on my previous reply: endTransition is indeed supported, but i not treated as "transition" so to say. In openscenario_parser.py, image all of them are treated equally, as the finished state of the manueverGroup in this case.

Considering the trigger problem:

In your case it is following: Vehicles move, when the distance changes to <30 meters, the manueverGroup is being executed (the one inside of SlowPrecedingStory). As it is the only manueverGroup present in the file, the simulation just ends when the manueverGroup is fully executed, as there are no other manueverGroups to execute and therefore stopTrigger is being "ignored" as there's nothing more to run and therefore to stop.

Solution: add another manueverGroup that keeps vehicle driving for another minute.

Hope this helps. Best, Ivan