Road network dependency issues
I would like to run an OpenSCENARIO 1.3 file without any road network using only FollowTrajectoryAction with world position polyline trajectory (incl. timing information for each vertex).
Shortened example: 20240603T143803.535904Z_osc_pmsf_dronetracker_119_cutout-copy.xosc
I tried it with gtgen-simulator_8.0.0_amd64.deb and gtgen-simulator_9.0.0_amd64.deb on WSL Ubuntu 24.04.1 LTS and ran into some - kind of related - problems:
Road network is required
In order to be able to run the scenario at all, I had to provide a RoadNetwork/OpenDRIVE map file even though the OSC entities do not require a road. Not adding a map leads to this exception:
[2025-01-21 13:39:51.945] [osc_engine] [info] [0.040s] Scenario validation succeeded with 0 errors, 0 warnings, and 0 catalog warnings
terminate called after throwing an instance of 'gtgen::core::simulation::simulator::SimulatorException'
what(): Map path could not be resolved from scenario. Cannot proceed with creation of map engine.
Aborted
According to the OSC standard the definition of a map should be optional. In RoadNetwork the docs say:
The road network which provides the base layer (and road-relative coordinate systems) for all scenario elements is defined as a reference to a road network file. This reference is optional; in case it is not specified, an infinite non-inclined plane on level z=0 shall be assumed as base layer. Additionally and optionally, a visual 3D model file can be referenced and any number of signals can be specified.
Nearby lane is required
I also noticed that it is necessary to place a road near the entities (probably because of chunking?) otherwise I get the following exception. I don't know, why a lane is required in the first place though.
[2025-01-21 13:21:17.962] [environment] [info] [0.000s] Deleting KeepVelocityControlUnit in composite controller #1002
[2025-01-21 13:21:17.962] [environment] [info] [0.000s] Deleting LaneOffsetControlUnit in composite controller #1002
[2025-01-21 13:21:17.962] [environment] [info] [0.000s] Deleting PathControlUnit in composite controller #1002
[2025-01-21 13:21:17.962] [environment] [info] [0.000s] Adding FollowTrajectoryWithSpeedControlUnit to composite controller #1002
[2025-01-21 13:21:17.962] [environment] [info] [0.000s] Deleting KeepVelocityControlUnit in composite controller #1003
[2025-01-21 13:21:17.962] [environment] [info] [0.000s] Deleting LaneOffsetControlUnit in composite controller #1003
[2025-01-21 13:21:17.962] [environment] [info] [0.000s] Deleting PathControlUnit in composite controller #1003
[2025-01-21 13:21:17.962] [environment] [info] [0.000s] Adding FollowTrajectoryWithSpeedControlUnit to composite controller #1003
[2025-01-21 13:21:18.266] [gtgen::core] [error] [0.300s] Terminating due to an unhandled exception:
gtgen::core::environment::EnvironmentException
what(): SensorViewBuilder: Lane is not set in the generated OSI Ground Truth.
Executing original terminate handler...terminate called after throwing an instance of 'gtgen::core::environment::EnvironmentException'
what(): SensorViewBuilder: Lane is not set in the generated OSI Ground Truth.
Aborted
Weird stopping behavior of control units in the last simulation step
Then I tried to set some random straight OpenDRIVE road close to the ego vehicle (not exactly overlapping with the course of the trajectory but within <50m distance). It runs fine until it throws the following exception once the trajectory ends (one step after final vertex which is given at 18.450s):
[2025-01-21 16:14:15.232] [environment] [info] [18.500s] Deleting FollowTrajectoryWithSpeedControlUnit in composite controller #1002
[2025-01-21 16:14:15.232] [environment] [info] [18.500s] Adding KeepVelocityControlUnit to composite controller #1002
[2025-01-21 16:14:15.232] [environment] [info] [18.500s] Adding PathControlUnit to composite controller #1002
[2025-01-21 16:14:15.232] [environment] [info] [18.500s] Adding LaneOffsetControlUnit to composite controller #1002
[2025-01-21 16:14:15.232] [environment] [info] [18.500s] Deleting FollowTrajectoryWithSpeedControlUnit in composite controller #1003
[2025-01-21 16:14:15.232] [environment] [info] [18.500s] Adding KeepVelocityControlUnit to composite controller #1003
[2025-01-21 16:14:15.232] [environment] [info] [18.500s] Adding PathControlUnit to composite controller #1003
[2025-01-21 16:14:15.232] [environment] [info] [18.500s] Adding LaneOffsetControlUnit to composite controller #1003
[2025-01-21 16:14:15.232] [gtgen::core] [error] [18.500s] Terminating due to an unhandled exception:
gtgen::core::environment::EnvironmentException
what(): Cannot keep lane offset for entity "Ego" (id: 0): Position -155.512163254, -15.647915623, 0.709500000 not on a lane
Executing original terminate handler...terminate called after throwing an instance of 'gtgen::core::environment::EnvironmentException'
what(): Cannot keep lane offset for entity "Ego" (id: 0): Position -155.512163254, -15.647915623, 0.709500000 not on a lane
Aborted
I defined a stop trigger (SimulationTimeCondition) to stop the storyboard at simulation time greater than 18.450s
, so it should stop properly after it reaches the last vertex point at 18.450s. But instead of immediately stopping the simulation in the next step (18.500s), FollowTrajectoryWithSpeedControlUnit is deleted and it defaults to KeepVelocityControlUnit, PathControlUnit and LaneOffsetControlUnit which require the vehicle(s) to be on a lane.
Shouldn't there be a default control unit combination that doesn't require a lane for situations where vehicles are not on a lane?
SimulationTimeCondition stops too late?
I would have to set the SimulationTimeCondition to greater than 18.400s
so that it stops before assigning another default action. When I tried that, I thought it would stop before the last vertex. But actually, the 18.450s frame with the corresponding vertex position was included in my OSI export. Shouldn't the simulation stop before that frame?