6.8 Routes

Routes in ASAM OpenSCENARIO are used to define the decision-behavior of entities at junctions. Two types of route can be assigned to entities:

  • Section 6.8.1
    An implicitly assigned route, assigned to all controllable entities that do not have an explicitly assigned route.

  • Section 6.8.2
    An explicitly assigned route, assigned to an entity in the scenario with an AssignRouteAction.

6.8.1 Default route

The default route is defined as: "Entity instances shall go straight at junctions" to ensure a reproducible behavior for different execution environments. This includes the following algorithm:

  1. The difference of the lane orientation between the end of the current lane and the end of each successor lane is calculated

  2. The successor lane with the smallest orientation difference to the current lane shall be used as route

  3. If a mathematical ambiguity still exists (for example, on a synthetically generated road with a t-junction, where the orientation differences are the same), then turn left on left-hand traffic roads and turn right on right-hand traffic roads.

6.8.2 Explicitly assigned route

A Route is used to navigate instances of Entity through the road network based on a list of waypoints on the road that are linked in a specific order, resulting in directional route. A Waypoint consists of a position and a RouteStrategy. The RouteStrategy indicates how to reach the position. An Entity’s movement between the waypoints is created by the simulator which uses the RouteStrategy as constraint. There may be more than one way to travel between a pair of waypoints. If this is the case, the RouteStrategy specified in the target Waypoint shall be used.

The different available and simulator-specific options for RouteStrategy are:

  • Fastest: Selects the route with the shortest traveling time between start and target location.

  • Least intersections: Selects the route with as few junctions as possible between start and target location.

  • Random: It is up to the simulator how to reach the target location.

  • Shortest: Selects the route with the shortest path between start and target location.

There may be cases where even the use of a RouteStrategy will lead to ambiguous routes. If, for example, the RouteStrategy "shortest" results in multiple possible routes of equal lengths, it is up to the simulator which route to choose.

The following figure shows the resulting routes depending on the chosen RouteStrategy (for example, either shortest or fastest) of the target waypoint. Moreover, the waypoint of a route does not affect the lateral position of an entity within a road when following the route.

image
Figure 16. Shortest and fastest route between two waypoints

The reference line of a route consists of the road reference lines along the calculated path.

Instances of Route may be assigned to an Actor using AcquirePositionAction or AssignRouteAction. Once assigned, they remain in place until another action overwrites them. For more details, refer to Section 7.5.1, "Conflicting actions".

An Actor is still considered "on the route" if it is on a road section that does not have a waypoint on it but is part of the route between waypoints as calculated at execution time.

If an actors starts somewhere before the first waypoint on a route, two different outcomes are possible, depending on where the first waypoint is located:

  • If the first waypoint can be reached by the actor in its present state, then the first waypoint should be reached by the strategy defined for the first waypoint.

  • If the first waypoint cannot be reached by the actor in its present state, then the route should be ignored.

It is possible that an actor starts somewhere along a route and not at its first waypoint. There are two ways to proceed for the actor, depending on whether the route contains loops:

  • If the route does not contains loops, the actor ignores the part of the route ranging from the first waypoint of the route to the position where the actor enters the route. The actor follows the remaining part of the route starting at the actors current position.

  • If the route contains loops, it passes the same road section several times.

If the route contains loops, see Figure 17 for an example, some additional rules apply. The route in the example consists of four waypoints (shown in boxes) that are linked in a specific order. The part of the route highlighted in red is driven twice: once on the links between waypoints 1 and 3, and once on the links between Waypoints 3 and 5. To avoid the entity becoming stuck in a loop, the following rules apply:

  • Where an entity is on a road that belongs to more than one link between waypoints, the entity shall be treated as being on the earliest link which has not been followed yet.

    • If an entity joins the route just before Waypoint 2, it is treated as being on the link between Waypoint 1 and Waypoint 2 (and not between 3 and 4).

  • Instances of Entity only follow later links than the one they are currently on.

    • If an entity joins the route just after Waypoint 3, it goes towards Waypoint 4, then 5.

  • When an entity leaves then rejoins a route or reaches the final waypoint, any previously visited waypoints shall be ignored.

    • If an entity is teleported to waypoint 1 after reaching waypoint 4, it follows the route as if for the first time.

    image
    Figure 17. Route passing the same road section twice

When waypoints and the resulting ordered sequence of roads uniquely define the path from the start to target location, a position along the route can be defined in road or lane coordinates relative to the reference line of the road or lane. For this purpose, PositionInRoadCoordinates or PositionInLaneCoordinates can be used. An example of this is shown in Figure 18. Furthermore, it is assumed that a simulator makes a calculation so that the composite reference line of a route consists of the road reference lines along the calculated path.

image
Figure 18. A route consisting of roads with a reference line and PositionInRoadCoordinates