Skip to content

Collision behavior

post_collision_behavior (PostCollisionBehavior)

post_collision_behavior handles a vehicle's motion during and after a collision. When activated, it disables all other behaviors and produces and generates an objective that stops the vehicle. Braking happens with a deceleration defined by post-collision_behavior.collision_deceleration, which is intended to be an extreme value that imitates collision. This behavior is primarily applicable to kinematically driven vehicles, as dynamically driven vehicles can exhibit more realistic collision behavior produced by the simulator. By default, this behavior is active.

Field name Type Description Default
enable bool When true, this behavior handles the motion of a kinematically-driven vehicle during and after a collision. It brings the vehicle to a stop with the deceleration defined by the collision_deceleration. When false, this behavior is not active. true
collision_deceleration acceleration An extreme deceleration that imitates a collision. For example, with deceleration of 500mpsps, a vehicle driving at 80kph stops in 1m. [450..550]mpsps
OSC2 code: post_collision_behavior
extend top.main:
    def post_plan() is also:
        sut.car.ftx_driver.post_collision_behavior.collision_deceleration = 350mpsps

collision_avoidance_behavior (CollisionAvoidanceBehavior)

collision_avoidance_behavior uses the scenery information from the perception layer and the scenery_processing_utility library to identify the most dangerous objects in the actor's proximity and performs collision avoidance maneuvers based on the predicted interaction with them. By default, this behavior is active unless the avoid_collisions() modifier has been set to false.

Three Regions of Interest (ROIs) around the vehicle are checked for current and upcoming dangers. Each region can be defined using four vehicle-related values expressing its min/max lon boundaries and min/max lat_lane boundaries.

The collision_avoidance_behavior modifies the objective according to the following situations:

  • For obstacles in front, it adapts the driving speed and avoids getting closer to the front obstacle. It does not cause the vehicle to change lanes.
  • For obstacles to either side, it prevents lane changes into occupied lanes. It does not cause the vehicle to brake or steer away from the collision.
  • For obstacles on intersecting routes, it adapts the driving speed to avoid entering the intersection while it is occupied by other objects.
Field name Type Description Default
enabling_policy enum When by_the_plan, the vehicle avoids colliding with other objects unless the avoid_collisions() modifier has been set to false. When always_enabled, the collision_avoidance_behavior is active regardless of whether the avoid_collisions() modifier has been set to false. When always_disabled, the collision_avoidance_behavior is not active regardless of whether the avoid_collisions() modifier has been set to true (the default). by_the_plan
ignore_list [list of physical_objects] Stores a list of physical objects (vehicles or plain_objects) that this vehicle will ignore as obstacles. For example, if you want a vehicle to avoid collisions with all obstacles except "car2", add car2 to this list. empty list
lon_ca_cautious_factor integer Affects the behavior's approach to a front obstacle. For larger values, the actor will perform emergency braking sooner rather than later. For smaller values, the actor will avoid emergency braking as long as possible. The value for max aggressiveness is 0. Note: Values larger than ~200 will have little effect on the behavior. [70..100]
min_response_time time Added to the const safety distance, a speed-related safety distance used to calculate the response distance: speed_safety_distance = ca_min_response_time * current_speed [0.8..1.2]second
safety_distance_lat float When collision_avoidance_behavior is enabled, any lateral movement towards the object above this threshold is prevented. Measured in lane units 0.15
safety_distance_lon float When collision_avoidance_behavior is enabled, any longitudinal movement towards the object above this threshold is prevented. [2.5..3.5]meter
safety_distance_lon_at_standstill float When the actor's speed is near or at a standstill, safety_distance_lon_at_standstill replaces safety_distance_lon for collision avoidance, using a shorter distance to determine how close the vehicle can safely approach an obstacle before initiating avoidance actions. 60% of safety_distance_lon
OSC2 code: collision_avoidance_behavior
keep(cut_in_vehicle.ftx_driver.collision_avoidance_behavior.enabling_policy == always_disabled)

Front collision avoidance

Front collision avoidance logic distinguishes between two situations based on the relative location and speed of the obstacle:

  • Obstacle in speed adaptation area: It is possible for the actor to adapt to the speed of its front obstacle and keep a safe distance by driving slower than required (by the given objective).

  • Obstacle in emergency brake area: The obstacle is too close. The actor must brake fully to avoid the collision or reduce the damage.

The option for speed adaptation also depends on the obstacle object itself. For example, for static objects, speed adaptations cannot be made since they have no speed.

As a rule of thumb, speeds are adapted for obstacles where:

$$ \text{critical_rel_lon_distance} = \text{lon_ca_cautious_factor} \times \text{actor.DTS} + \text{min_safety_lon_distance} $$ (where DTS is Distance to Stop and eDTS is extended DTS).

Given that the actor's ROI length is DTS (lon), then:

  • Emergency braking is performed for relative distances between [0, DTS].

  • Speed adaptation is performed for relative distances between [DTS, eDTS].

Note

The Cautious factor by default equals 100%.

  • When changed to a lower value, the area for emergency braking will shrink. Values that are too small might cause the actor to start braking too late and eventually collide.

  • When changed to a higher value, the area of emergency braking will expand and the actor will reach a full stop further away from the obstacle.

See also Reckless and cautious behavioral profiles.

Side collision avoidance

Side collision avoidance happens mostly when the actor is actively trying to change lanes. When an obstacle approaches the actor on the side, there is very little that can be done. Side collision avoidance logic distinguishes between two situations, based on the relative location and speed of the obstacles:

  • Obstacle in stopping area: It is possible for the actor to stop lateral movement and maintain a safe distance to the obstacle.

  • Obstacle in steer correction area: The obstacle is too close. The actor must actively steer in the opposite direction from the original objective until reaching a safe distance from the obstacle.

Note

Collision avoidance is not triggered when the lateral speed is 0 even if the obstacle is inside the ROIs. This is done to allow vehicles to drive side-by-side closely.

Given that the actor's ROI width is eDTS (lat), then:

  • Steer correction is performed for relative distance between [0, min_safety_lat_distance].

  • Stopping is performed for relative distance between [min_safety_lat_distance, eDTS].

Side-Rear collision avoidance

Side-rear collision avoidance is triggered when an actor tries to perform a lateral maneuver and there is a risk of causing an unavoidable collision with a rear bypassing vehicle.

Unlike regular side collision avoidance, for obstacles in the rear sides, the actor has only one possible action—to stop moving laterally.

Note

Collision avoidance is not triggered when the relative speed with respect to the obstacle is negative (when the actor is faster) or when the behavior evaluates that the collision is avoidable from the obstacle’s side.

Side-Front collision avoidance

Side-front collision avoidance is triggered when an actor tries to perform a lateral maneuver and there is a risk of causing an unavoidable collision ahead.

In the case of an upcoming vehicle in the new lateral offset required by the objective, the behavior tries to slow down while still performing the maneuver, unless an unavoidable collision is predicted.

In that case, a partial lateral maneuver is planned, together with an emergency longitudinal braking. If the collision alert is later removed, the behavior resumes to the original lateral objective.

Note

This is the only case where a lon and lat collision avoidance is calculated together. It’s performed as a superposition.

First, if the relative speed between the actors is indeed negative (the actor is faster than the obstacle), it's necessary to determine whether the upcoming collision is unavoidable. This is done by comparing the actor’s relative DTS to the relative lon distance between the objects.

\[ rel\_DTS = 0.5 * \frac{{v_{relative}}^2}{a_{min}} \]