Skip to content

Avoidance design#

This is a rule-based path planning module designed for obstacle avoidance.

Purpose / Role#

This module is designed for rule-based avoidance that is easy for developers to design its behavior. It generates avoidance path parameterized by intuitive parameters such as lateral jerk and avoidance distance margin. This makes it possible to pre-define avoidance behavior.

In addition, the approval interface of behavior_path_planner allows external users / modules (e.g. remote operation) to intervene the decision of the vehicle behavior. This function is expected to be used, for example, for remote intervention in emergency situations or gathering information on operator decisions during development.

Limitations#

This module allows developers to design vehicle behavior in avoidance planning using specific rules. Due to the property of rule-based planning, the algorithm can not compensate for not colliding with obstacles in complex cases. This is a trade-off between "be intuitive and easy to design" and "be hard to tune but can handle many cases". This module adopts the former policy and therefore this output should be checked more strictly in the later stage. In the .iv reference implementation, there is another avoidance module in motion planning module that uses optimization to handle the avoidance in complex cases. (Note that, the motion planner needs to be adjusted so that the behavior result will not be changed much in the simple case and this is a typical challenge for the behavior-motion hierarchical architecture.)

Why is avoidance in behavior module?#

This module executes avoidance over lanes, and the decision requires the lane structure information to take care of traffic rules (e.g. it needs to send an indicator signal when the vehicle crosses a lane). The difference between motion and behavior module in the planning stack is whether the planner takes traffic rules into account, which is why this avoidance module exists in the behavior module.

Inner-workings / Algorithms#

The following figure shows a simple explanation of the logic for avoidance path generation. First, target objects are picked up, and shift requests are generated for each object. These shift requests are generated by taking into account the lateral jerk required for avoidance (red lines). Then these requests are merged and the shift points are created on the reference path (blue line). Filtering operations are performed on the shift points such as removing unnecessary shift points (yellow line), and finally a smooth avoidance path is generated by combining Clothoid-like curve primitives (green line).

fig1

Flowchart#

uml diagram

Overview of algorithm for target object filtering#

How to decide the target obstacles#

The avoidance target should be limited to stationary objects (you should not avoid a vehicle waiting at a traffic light even if it blocks your path). Therefore, target vehicles for avoidance should meet the following specific conditions.

  • It is in the vicinity of your lane (parametrized)
  • It is stopped
    • threshold_speed_object_is_stopped: parameter that be used for judge the object has stopped or not.
    • threshold_time_object_is_moving: parameter that be used for chattering prevention.
  • It is a specific class.
    • User can limit avoidance targets.
    • Fo now, avoidance module supports only vehicle.
  • It is not being in the center of the route
    • This means that the vehicle is parked on the edge of the lane. This prevents the vehicle from avoiding a vehicle waiting at a traffic light in the middle of the lane. However, this is not an appropriate implementation for the purpose. Even if a vehicle is in the center of the lane, it should be avoided if it has its hazard lights on, and this is a point that should be improved in the future as the recognition performance improves.
  • Object is not behind ego(default: > -2.0 m) or too far(default: < 150.0 m) and object is not behind the path goal.

fig1

Parked-car detection#

Not only the length from the centerline, but also the length from the road shoulder is calculated and used for the filtering process. It calculates the ratio of the actual length between the the object's center and the center line shift_length and the maximum length the object can shift shiftable_length.

\[ l_D = l_a - \frac{width}{2}, \\ ratio = \frac{l_d}{l_D} \]
  • \(l_d\) : actual shift length
  • \(l_D\) : shiftable length
  • \(l_a\) : distance between centerline and most left boundary.
  • \(width\) : object width

The closer the object is to the shoulder, the larger the value of \(ratio\) (theoretical max value is 1.0), and it compares the value and object_check_shiftable_ratio to determine whether the object is a parked-car. If the road has no road shoulders, it uses object_check_min_road_shoulder_width as a road shoulder width virtually.

fig2

Compensation for detection lost#

In order to prevent chattering of recognition results, once an obstacle is targeted, it is hold for a while even if it disappears. This is effective when recognition is unstable. However, since it will result in over-detection (increase a number of false-positive), it is necessary to adjust parameters according to the recognition accuracy (if object_last_seen_threshold = 0.0, the recognition result is 100% trusted).

Flowchart#

uml diagram

uml diagram

uml diagram

uml diagram

Overview of algorithm for avoidance path generation#

How to prevent shift line chattering that is caused by perception noise#

Since object recognition results contain noise related to position ,orientation and boundary size, if the raw object recognition results are used in path generation, the avoidance path will be directly affected by the noise.

Therefore, in order to reduce the influence of the noise, avoidance module generate a envelope polygon for the avoidance target that covers it, and the avoidance path should be generated based on that polygon. The envelope polygons are generated so that they are parallel to the reference path and the polygon size is larger than the avoidance target (define by object_envelope_buffer). The position and size of the polygon is not updated as long as the avoidance target exists within that polygon.

# default value
object_envelope_buffer: 0.3 # [m]

fig1

fig1

Computing Shift Length and Shift Points#

The lateral shift length is affected by 4 variables, namely lateral_collision_safety_buffer, lateral_collision_margin, vehicle_width and overhang_distance. The equation is as follows

avoid_margin = lateral_collision_margin + lateral_collision_safety_buffer + 0.5 * vehicle_width
max_allowable_lateral_distance = to_road_shoulder_distance - road_shoulder_safety_margin - 0.5 * vehicle_width
if(isOnRight(o))
{
  shift_length = avoid_margin + overhang_distance
}
else
{
  shift_length = avoid_margin - overhang_distance
}

The following figure illustrates these variables(This figure just shows the max value of lateral shift length).

shift_point_and_its_constraints

Rationale of having safety buffer and safety margin#

To compute the shift length, additional parameters that can be tune are lateral_collision_safety_buffer and road_shoulder_safety_margin.

  • The lateral_collision_safety_buffer parameter is used to set a safety gap that will act as the final line of defense when computing avoidance path.
    • The rationale behind having this parameter is that the parameter lateral_collision_margin might be changing according to the situation for various reasons. Therefore, lateral_collision_safety_buffer will act as the final line of defense in case of the usage of lateral_collision_margin fails.
    • It is recommended to set the value to more than half of the ego vehicle's width.
  • The road_shoulder_safety_margin will prevent the module from generating a path that might cause the vehicle to go too near the road shoulder or adjacent lane dividing line.

shift_length_parameters

Generating path only within lanelet boundaries#

The shift length is set as a constant value before the feature is implemented. Setting the shift length like this will cause the module to generate an avoidance path regardless of actual environmental properties. For example, the path might exceed the actual road boundary or go towards a wall. Therefore, to address this limitation, in addition to how to decide the target obstacle, the module also takes into account the following additional element

  • The obstacles' current lane and position.
  • The road shoulder with reference to the direction to avoid.

These elements are used to compute the distance from the object to the road's shoulder (to_road_shoulder_distance). The parameters use_adjacent_lane and use_opposite_lane allows further configuration of the to to_road_shoulder_distance. The following image illustrates the configuration.

obstacle_to_road_shoulder_distance

If one of the following conditions is false, then the shift point will not be generated.

  • The distance to shoulder of road is enough
avoid_margin = lateral_collision_margin + lateral_collision_safety_buffer + 0.5 * vehicle_width
avoid_margin <= (to_road_shoulder_distance - 0.5 * vehicle_width - road_shoulder_safety_margin)
  • The obstacle intrudes into the current driving path.

    • when the object is on right of the path

      -overhang_dist<(lateral_collision_margin + lateral_collision_safety_buffer + 0.5 * vehicle_width)
      
    • when the object is on left of the path

      overhang_dist<(lateral_collision_margin + lateral_collision_safety_buffer + 0.5 * vehicle_width)
      

Details of algorithm for avoidance path generation#

Flow-chart of the process#

uml diagram

How to decide the path shape#

Generate shift points for obstacles with given lateral jerk. These points are integrated to generate an avoidance path. The detailed process flow for each case corresponding to the obstacle placement are described below. The actual implementation is not separated for each case, but the function corresponding to multiple obstacle case (both directions) is always running.

One obstacle case#

The lateral shift distance to the obstacle is calculated, and then the shift point is generated from the ego vehicle speed and the given lateral jerk as shown in the figure below. A smooth avoidance path is then calculated based on the shift point.

Additionally, the following processes are executed in special cases.

Lateral jerk relaxation conditions#

  • If the ego vehicle is close to the avoidance target, the lateral jerk will be relaxed up to the maximum jerk
  • When returning to the center line after avoidance, if there is not enough distance left to the goal (end of path), the jerk condition will be relaxed as above.

Minimum velocity relaxation conditions#

There is a problem that we can not know the actual speed during avoidance in advance. This is especially critical when the ego vehicle speed is 0. To solve that, this module provides a parameter for the minimum avoidance speed, which is used for the lateral jerk calculation when the vehicle speed is low.

  • If the ego vehicle speed is lower than "nominal" minimum speed, use the minimum speed in the calculation of the jerk.
  • If the ego vehicle speed is lower than "sharp" minimum speed and a nominal lateral jerk is not enough for avoidance (the case where the ego vehicle is stopped close to the obstacle), use the "sharp" minimum speed in the calculation of the jerk (it should be lower than "nominal" speed).

fig1

Multiple obstacle case (one direction)#

Generate shift points for multiple obstacles. All of them are merged to generate new shift points along the reference path. The new points are filtered (e.g. remove small-impact shift points), and the avoidance path is computed for the filtered shift points.

Merge process of raw shift points: check the shift length on each path points. If the shift points are overlapped, the maximum shift value is selected for the same direction.

For the details of the shift point filtering, see filtering for shift points.

fig1

Multiple obstacle case (both direction)#

Generate shift points for multiple obstacles. All of them are merged to generate new shift points. If there are areas where the desired shifts conflict in different directions, the sum of the maximum shift amounts of these areas is used as the final shift amount. The rest of the process is the same as in the case of one direction.

fig1

Filtering for shift points#

The shift points are modified by a filtering process in order to get the expected shape of the avoidance path. It contains the following filters.

  • Quantization: Quantize the avoidance width in order to ignore small shifts.
  • Small shifts removal: Shifts with small changes with respect to the previous shift point are unified in the previous shift width.
  • Similar gradient removal: Connect two shift points with a straight line, and remove the shift points in between if their shift amount is in the vicinity of the straight line.
  • Remove momentary returns: For shift points that reduce the avoidance width (for going back to the center line), if there is enough long distance in the longitudinal direction, remove them.

Other features#

Drivable area expansion#

This module has following parameters that sets which areas the path may extend into when generating an avoidance path.

# drivable area setting
use_adjacent_lane: true
use_opposite_lane: true
use_intersection_areas: false
use_hatched_road_markings: false

adjacent lane#

fig1

opposite lane#

fig1

intersection areas#

The intersection area is defined on Lanelet map. See here

fig1

hatched road markings#

The hatched road marking is defined on Lanelet map. See here

fig1

Safety check#

The avoidance module has a safety check logic. The result of safe check is used for yield maneuver. It is enable by setting enable as true.

# safety check configuration
enable: true # [-]
check_current_lane: false # [-]
check_shift_side_lane: true # [-]
check_other_side_lane: false # [-]
check_unavoidable_object: false # [-]
check_other_object: true # [-]

# collision check parameters
check_all_predicted_path: false # [-]
time_horizon: 10.0 # [s]
idling_time: 1.5 # [s]
safety_check_backward_distance: 50.0 # [m]
safety_check_accel_for_rss: 2.5 # [m/ss]

fig1

safety_check_backward_distance is the parameter related to the safety check area. The module checks a collision risk for all vehicle that is within shift side lane and between object object_check_forward_distance ahead and safety_check_backward_distance behind.

fig1

NOTE: Even if a part of an object polygon overlaps the detection area, if the center of gravity of the object does not exist on the lane, the vehicle is excluded from the safety check target.


Judge the risk of collision based on ego future position and object prediction path. The module calculates Ego's future position in the time horizon (safety_check_time_horizon), and use object's prediction path as object future position.

fig1

After calculating the future position of Ego and object, the module calculates the lateral/longitudinal deviation of Ego and the object. The module also calculates the lateral/longitudinal margin necessary to determine that it is safe to execute avoidance maneuver, and if both the lateral and longitudinal distances are less than the margins, it determines that there is a risk of a collision at that time.

fig1

The value of the longitudinal margin is calculated based on Responsibility-Sensitive Safety theory (RSS). The safety_check_idling_time represents \(T_{idle}\), and safety_check_accel_for_rss represents \(a_{max}\).

\[ D_{lon} = V_{ego}T_{idle} + \frac{1}{2}a_{max}T_{idle}^2 + \frac{(V_{ego} + a_{max}T_{idle})^2}{2a_{max}} - \frac{V_{obj}^2}{2a_{max}} \]

The lateral margin is changeable based on ego longitudinal velocity. If the vehicle is driving at a high speed, the lateral margin should be larger, and if the vehicle is driving at a low speed, the value of the lateral margin should be set to a smaller value. Thus, the lateral margin for each vehicle speed is set as a parameter, and the module determines the lateral margin from the current vehicle speed as shown in the following figure.

fig1

target_velocity_matrix:
  col_size: 5
  matrix: [2.78 5.56 ... 16.7  # target velocity [m/s]
           0.50 0.75 ... 1.50] # margin [m]

Yield maneuver#

Overview#

If an avoidance path can be generated and it is determined that avoidance maneuver should not be executed due to surrounding traffic conditions, the module executes YIELD maneuver. In yield maneuver, the vehicle slows down to the target vehicle velocity (yield_velocity) and keep that speed until the module judge that avoidance path is safe. If the YIELD condition goes on and the vehicle approaches the avoidance target, it stops at the avoidable position and waits until the safety is confirmed.

# For yield maneuver
yield_velocity: 2.78 # [m/s]

fig1

NOTE: In yield maneuver, the vehicle decelerates target velocity under constraints.

nominal_deceleration: -1.0 # [m/ss]
nominal_jerk: 0.5 # [m/sss]

If it satisfies following all of three conditions, the module inserts stop point in front of the avoidance target with an avoidable interval.

  • Can't pass through the side of target object without avoidance.
  • There is enough lane width to avoid target object.
  • In waiting approval or yield maneuver.

The module determines that it is NOT passable without avoidance if the object overhang is less than the threshold.

lateral_passable_collision_margin: 0.5 # [-]
\[ L_{overhang} < \frac{W}{2} + L_{margin} (not passable) \]

The \(W\) represents vehicle width, and \(L_{margin}\) represents lateral_passable_collision_margin.

Limitation#

Limitation1#

The current behavior in unsafe condition is just slow down and it is so conservative. It is difficult to achieve aggressive behavior in the current architecture because of modularity. There are many modules in autoware that change the vehicle speed, and the avoidance module cannot know what speed planning they will output, so it is forced to choose a behavior that is as independent of other modules' processing as possible.

Limitation2#

The YIELD maneuver is executed ONLY when the vehicle has NOT initiated avoidance maneuver. The module has a threshold parameter (avoidance_initiate_threshold) for the amount of shifting and determines that the vehicle is initiating avoidance if the vehicle current shift exceeds the threshold.

\[ SHIFT_{current} > L_{threshold} \]

fig1

fig1


Avoidance cancelling maneuver#

If enable_cancel_maneuver parameter is true, Avoidance Module takes different actions according to the situations as follows:

  • If vehicle stops: If there is any object in the path of the vehicle, the avoidance path is generated. If this object goes away while the vehicle is stopping, the avoidance path will cancelled.
  • If vehicle is in motion, but avoidance maneuver doesn't started: If there is any object in the path of the vehicle, the avoidance path is generated. If this object goes away while the vehicle is not started avoidance maneuver, the avoidance path will cancelled.
  • If vehicle is in motion, avoidance maneuver started: If there is any object in the path of the vehicle, the avoidance path is generated,but if this object goes away while the vehicle is started avoidance maneuver, the avoidance path will not cancelled.

If enable_cancel_maneuver parameter is false, Avoidance Module doesn't revert generated avoidance path even if path objects are gone.

How to keep the consistency of the optimize-base path generation logic#

WIP

Parameters#

The avoidance specific parameter configuration file can be located at src/autoware/launcher/planning_launch/config/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/avoidance/avoidance.param.yaml.

Name Type Description Default Range
resample_interval_for_planning float Path resample interval for avoidance planning path. 0.3 N/A
resample_interval_for_output float Path resample interval for output path. Too short interval increases computational cost for latter modules. 4.0 N/A
enable_bound_clipping boolean Enable clipping left and right bound of drivable area when obstacles are in the drivable area. false N/A
disable_path_update boolean Disable path update. false N/A
use_adjacent_lane boolean Extend avoidance trajectory to adjacent lanes that has same direction. If false, avoidance only happen in current lane. true N/A
use_opposite_lane boolean Extend avoidance trajectory to opposite direction lane. use_adjacent_lane must be true to take effects. true N/A
use_hatched_road_markings boolean Extend drivable to hatched road marking area. true N/A
use_intersection_areas boolean Extend drivable to intersection area. true N/A
use_freespace_areas boolean Extend drivable to freespace area. true N/A
car.th_moving_speed float Objects with speed greater than this will be judged as moving ones. 1.0 ≥0.0
car.th_moving_time float Objects keep moving longer duration than this will be excluded from avoidance target. 1.0 N/A
car.longitudinal_margin float Creates an additional longitudinal gap that will prevent the vehicle from getting to near to the obstacle. 0.0 N/A
lateral_margin.soft_margin float Lateral distance between ego and avoidance targets. 0.3 N/A
lateral_margin.hard_margin float Lateral distance between ego and avoidance targets. 0.2 N/A
lateral_margin.hard_margin_for_parked_vehicle float Lateral distance between ego and avoidance targets. 0.7 N/A
car.envelope_buffer_margin float The buffer between raw boundary box of detected objects and enveloped polygon that is used for avoidance path generation. 0.5 N/A
car.max_expand_ratio float This value will be applied envelope_buffer_margin according to the distance between the ego and object. 0.0 N/A
truck.th_moving_speed float Objects with speed greater than this will be judged as moving ones. 1.0 ≥0.0
truck.th_moving_time float Objects keep moving longer duration than this will be excluded from avoidance target. 1.0 N/A
truck.longitudinal_margin float Creates an additional longitudinal gap that will prevent the vehicle from getting to near to the obstacle. 0.0 N/A
lateral_margin.soft_margin float Lateral distance between ego and avoidance targets. 0.3 N/A
lateral_margin.hard_margin float Lateral distance between ego and avoidance targets. 0.2 N/A
lateral_margin.hard_margin_for_parked_vehicle float Lateral distance between ego and avoidance targets. 0.7 N/A
truck.envelope_buffer_margin float The buffer between raw boundary box of detected objects and enveloped polygon that is used for avoidance path generation. 0.5 N/A
truck.max_expand_ratio float This value will be applied envelope_buffer_margin according to the distance between the ego and object. 0.0 N/A
bus.th_moving_speed float Objects with speed greater than this will be judged as moving ones. 1.0 ≥0.0
bus.th_moving_time float Objects keep moving longer duration than this will be excluded from avoidance target. 1.0 N/A
bus.longitudinal_margin float Creates an additional longitudinal gap that will prevent the vehicle from getting to near to the obstacle. 0.0 N/A
lateral_margin.soft_margin float Lateral distance between ego and avoidance targets. 0.3 N/A
lateral_margin.hard_margin float Lateral distance between ego and avoidance targets. 0.2 N/A
lateral_margin.hard_margin_for_parked_vehicle float Lateral distance between ego and avoidance targets. 0.7 N/A
bus.envelope_buffer_margin float The buffer between raw boundary box of detected objects and enveloped polygon that is used for avoidance path generation. 0.5 N/A
bus.max_expand_ratio float This value will be applied envelope_buffer_margin according to the distance between the ego and object. 0.0 N/A
trailer.th_moving_speed float Objects with speed greater than this will be judged as moving ones. 1.0 ≥0.0
trailer.th_moving_time float Objects keep moving longer duration than this will be excluded from avoidance target. 1.0 N/A
trailer.longitudinal_margin float Creates an additional longitudinal gap that will prevent the vehicle from getting to near to the obstacle. 0.0 N/A
lateral_margin.soft_margin float Lateral distance between ego and avoidance targets. 0.3 N/A
lateral_margin.hard_margin float Lateral distance between ego and avoidance targets. 0.2 N/A
lateral_margin.hard_margin_for_parked_vehicle float Lateral distance between ego and avoidance targets. 0.7 N/A
trailer.envelope_buffer_margin float The buffer between raw boundary box of detected objects and enveloped polygon that is used for avoidance path generation. 0.5 N/A
trailer.max_expand_ratio float This value will be applied envelope_buffer_margin according to the distance between the ego and object. 0.0 N/A
unknown.th_moving_speed float Objects with speed greater than this will be judged as moving ones. 1.0 ≥0.0
unknown.th_moving_time float Objects keep moving longer duration than this will be excluded from avoidance target. 1.0 N/A
unknown.longitudinal_margin float Creates an additional longitudinal gap that will prevent the vehicle from getting to near to the obstacle. 0.0 N/A
lateral_margin.soft_margin float Lateral distance between ego and avoidance targets. 0.7 N/A
lateral_margin.hard_margin float Lateral distance between ego and avoidance targets. -0.2 N/A
lateral_margin.hard_margin_for_parked_vehicle float Lateral distance between ego and avoidance targets. -0.2 N/A
unknown.envelope_buffer_margin float The buffer between raw boundary box of detected objects and enveloped polygon that is used for avoidance path generation. 0.1 N/A
unknown.max_expand_ratio float This value will be applied envelope_buffer_margin according to the distance between the ego and object. 0.0 N/A
motorcycle.th_moving_speed float Objects with speed greater than this will be judged as moving ones. 1.0 ≥0.0
motorcycle.th_moving_time float Objects keep moving longer duration than this will be excluded from avoidance target. 1.0 N/A
motorcycle.longitudinal_margin float Creates an additional longitudinal gap that will prevent the vehicle from getting to near to the obstacle. 0.0 N/A
lateral_margin.soft_margin float Lateral distance between ego and avoidance targets. 0.7 N/A
lateral_margin.hard_margin float Lateral distance between ego and avoidance targets. 0.5 N/A
lateral_margin.hard_margin_for_parked_vehicle float Lateral distance between ego and avoidance targets. 0.5 N/A
motorcycle.envelope_buffer_margin float The buffer between raw boundary box of detected objects and enveloped polygon that is used for avoidance path generation. 0.5 N/A
motorcycle.max_expand_ratio float This value will be applied envelope_buffer_margin according to the distance between the ego and object. 0.0 N/A
bicycle.th_moving_speed float Objects with speed greater than this will be judged as moving ones. 1.0 ≥0.0
bicycle.th_moving_time float Objects keep moving longer duration than this will be excluded from avoidance target. 1.0 N/A
bicycle.longitudinal_margin float Creates an additional longitudinal gap that will prevent the vehicle from getting to near to the obstacle. 0.0 N/A
lateral_margin.soft_margin float Lateral distance between ego and avoidance targets. 0.7 N/A
lateral_margin.hard_margin float Lateral distance between ego and avoidance targets. 0.3 N/A
lateral_margin.hard_margin_for_parked_vehicle float Lateral distance between ego and avoidance targets. 0.3 N/A
bicycle.envelope_buffer_margin float The buffer between raw boundary box of detected objects and enveloped polygon that is used for avoidance path generation. 0.5 N/A
bicycle.max_expand_ratio float This value will be applied envelope_buffer_margin according to the distance between the ego and object. 0.0 N/A
pedestrian.th_moving_speed float Objects with speed greater than this will be judged as moving ones. 1.0 ≥0.0
pedestrian.th_moving_time float Objects keep moving longer duration than this will be excluded from avoidance target. 1.0 N/A
pedestrian.longitudinal_margin float Creates an additional longitudinal gap that will prevent the vehicle from getting to near to the obstacle. 0.0 N/A
lateral_margin.soft_margin float Lateral distance between ego and avoidance targets. 0.7 N/A
lateral_margin.hard_margin float Lateral distance between ego and avoidance targets. 0.5 N/A
lateral_margin.hard_margin_for_parked_vehicle float Lateral distance between ego and avoidance targets. 0.5 N/A
pedestrian.envelope_buffer_margin float The buffer between raw boundary box of detected objects and enveloped polygon that is used for avoidance path generation. 0.5 N/A
pedestrian.max_expand_ratio float This value will be applied envelope_buffer_margin according to the distance between the ego and object. 0.0 N/A
target_object.lower_distance_for_polygon_expansion float If the distance between the ego and object is less than this, the expand ratio will be zero. 30.0 N/A
target_object.upper_distance_for_polygon_expansion float If the distance between the ego and object is larger than this, the expand ratio will be max_expand_ratio. 100.0 N/A
target_type.car boolean Enable avoidance maneuver for CAR. true N/A
target_type.truck boolean Enable avoidance maneuver for TRUCK. true N/A
target_type.bus boolean Enable avoidance maneuver for BUS. true N/A
target_type.trailer boolean Enable avoidance maneuver for TRAILER. true N/A
target_type.unknown boolean Enable avoidance maneuver for UNKNOWN. true N/A
target_type.bicycle boolean Enable avoidance maneuver for BICYCLE. true N/A
target_type.motorcycle boolean Enable avoidance maneuver for MOTORCYCLE. true N/A
target_type.pedestrian boolean Enable avoidance maneuver for PEDESTRIAN. true N/A
target_filtering.object_check_goal_distance float If the distance between object and goal position is less than this parameter, the module do not return center line. 20.0 N/A
target_filtering.object_check_return_pose_distance float If the distance between object and return position is less than this parameter, the module do not return center line. 20.0 N/A
target_filtering.max_compensation_time float For the compensation of the detection lost. The object is registered once it is observed as an avoidance target. When the detection loses, the timer will start and the object will be un-registered when the time exceeds this limit. 2.0 N/A
detection_area.static boolean If true, the detection area longitudinal range is calculated based on current ego speed. false N/A
detection_area.min_forward_distance float Minimum forward distance to search the avoidance target. 50.0 N/A
detection_area.max_forward_distance float Maximum forward distance to search the avoidance target. 150.0 N/A
detection_area.backward_distance float Backward distance to search the avoidance target. 10.0 N/A
parked_vehicle.th_offset_from_centerline float Vehicles around the center line within this distance will be excluded from avoidance target. 1.0 N/A
parked_vehicle.th_shiftable_ratio float Vehicles around the center line within this distance will be excluded from avoidance target. 0.8 ≥0.0
≤1.0
parked_vehicle.min_road_shoulder_width float Width considered as a road shoulder if the lane does not have a road shoulder target. 0.5 N/A
avoidance_for_ambiguous_vehicle.enable boolean Enable avoidance maneuver for ambiguous vehicles. true N/A
avoidance_for_ambiguous_vehicle.closest_distance_to_wait_and_see float Start avoidance maneuver after the distance to ambiguous vehicle is less than this param. 10.0 N/A
condition.th_stopped_time float Never avoid object whose stopped time is less than this param. 3.0 N/A
condition.th_moving_distance float Never avoid object which moves more than this param. 1.0 N/A
traffic_light.front_distance float If the distance between traffic light and vehicle is less than this parameter, this module will ignore it. 100.0 N/A
crosswalk.front_distance float If the front distance between crosswalk and vehicle is less than this parameter, this module will ignore it. 30.0 N/A
crosswalk.behind_distance float If the back distance between crosswalk and vehicle is less than this parameter, this module will ignore it. 30.0 N/A
intersection.yaw_deviation float Yaw deviation threshold param to judge if the object is not merging or deviating vehicle. 0.349 N/A
target_type.car boolean Enable safety_check for CAR. true N/A
target_type.truck boolean Enable safety_check for TRUCK. true N/A
target_type.bus boolean Enable safety_check for BUS. true N/A
target_type.trailer boolean Enable safety_check for TRAILER. true N/A
target_type.unknown boolean Enable safety_check for UNKNOWN. false N/A
target_type.bicycle boolean Enable safety_check for BICYCLE. true N/A
target_type.motorcycle boolean Enable safety_check for MOTORCYCLE. true N/A
target_type.pedestrian boolean Enable safety_check for PEDESTRIAN. true N/A
safety_check.enable boolean Enable to use safety check feature. true N/A
safety_check.check_current_lane boolean Check objects on current driving lane. true N/A
safety_check.check_shift_side_lane boolean Check objects on shift side lane. true N/A
safety_check.check_other_side_lane boolean Check objects on other side lane. true N/A
safety_check.check_unavoidable_object boolean Check collision between ego and unavoidable objects. true N/A
safety_check.check_other_object boolean Check collision between ego and non avoidance target objects. true N/A
safety_check.check_all_predicted_path boolean Check all prediction path of safety check target objects. true N/A
safety_check.safety_check_backward_distance float Backward distance to search the dynamic objects. 100.0 N/A
safety_check.hysteresis_factor_expand_rate float Hysteresis factor that be used for chattering prevention. 2.0 N/A
safety_check.hysteresis_factor_safe_count integer Hysteresis count that be used for chattering prevention. 10 N/A
safety_check.min_velocity float Minimum velocity of the ego vehicle's predicted path. 1.38 N/A
safety_check.max_velocity float Maximum velocity of the ego vehicle's predicted path. 50.0 N/A
safety_check.time_resolution float Time resolution for the ego vehicle's predicted path. 0.5 N/A
safety_check.time_horizon_for_front_object float Time horizon for predicting front objects. 3.0 N/A
safety_check.time_horizon_for_rear_object float Time horizon for predicting rear objects. 10.0 N/A
safety_check.delay_until_departure float Delay until the ego vehicle departs. 1.0 N/A
safety_check.extended_polygon_policy string See https://github.com/autowarefoundation/autoware.universe/pull/6336. along_path ['rectangle', 'along_path']
safety_check.expected_front_deceleration float The front object's maximum deceleration when the front vehicle perform sudden braking. -1.0 N/A
safety_check.expected_rear_deceleration float The rear object's maximum deceleration when the rear vehicle perform sudden braking. -1.0 N/A
safety_check.rear_vehicle_reaction_time float The reaction time of the rear vehicle driver which starts from the driver noticing the sudden braking of the front vehicle until the driver step on the brake. 2.0 N/A
safety_check.rear_vehicle_safety_time_margin float The time buffer for the rear vehicle to come into complete stop when its driver perform sudden braking. 1.0 N/A
safety_check.lateral_distance_max_threshold float The lateral distance threshold that is used to determine whether lateral distance between two object is enough and whether lane change is safe. 2.0 N/A
safety_check.longitudinal_distance_min_threshold float The longitudinal distance threshold that is used to determine whether longitudinal distance between two object is enough and whether lane change is safe. 3.0 N/A
safety_check.longitudinal_velocity_delta_time float The time multiplier that is used to compute the actual gap between vehicle at each predicted points (not RSS distance) 0.0 N/A
lateral.th_avoid_execution float The lateral distance deviation threshold between the current path and suggested avoidance point to execute avoidance. 0.09 N/A
lateral.th_small_shift_length float The shift lines whose lateral offset is less than this will be applied with other ones. 0.101 N/A
lateral.soft_drivable_bound_margin float Keep distance to drivable bound. 0.3 N/A
lateral.hard_drivable_bound_margin float Keep distance to drivable bound. 0.3 N/A
lateral.max_right_shift_length float Maximum shift length for right direction 5.0 N/A
lateral.max_left_shift_length float Maximum shift length for left direction. 5.0 N/A
lateral.max_deviation_from_lane float Use in validation phase to check if the avoidance path is in drivable area. 0.2 N/A
lateral.ratio_for_return_shift_approval float This parameter is added to allow waiting for the return of shift approval until the occlusion behind the avoid target is clear. 0.5 ≥0.0
≤1.0
longitudinal.min_prepare_time float Avoidance shift starts from point ahead of this time x ego speed at least. 1.0 N/A
longitudinal.max_prepare_time float Avoidance shift starts from point ahead of this time x ego speed if possible. 2.0 N/A
longitudinal.min_prepare_distance float Minimum prepare distance. 1.0 N/A
longitudinal.min_slow_down_speed float Minimum slow speed for avoidance prepare section. 1.38 N/A
longitudinal.buf_slow_down_speed float Buffer for controller tracking error. Basically, vehicle always cannot follow velocity profile precisely. Therefore, the module inserts lower speed than target speed that satisfies conditions to avoid object within accel/jerk constraints so that the avoidance path always can be output even if the current speed is a little bit higher than target speed. 0.56 N/A
longitudinal.nominal_avoidance_speed float Nominal avoidance speed. 8.33 N/A
longitudinal.consider_front_overhang boolean Flag to consider vehicle front overhang in shift line generation logic. True N/A
longitudinal.consider_rear_overhang boolean Flag to consider vehicle rear overhang in shift line generation logic. True N/A
goal.enable boolean Insert stop point in order to return original lane before reaching goal. true N/A
goal.buffer float Buffer distance to return original lane before reaching goal. 3.0 N/A
traffic_light.enable boolean Insert stop point in order to return original lane before reaching traffic light. true N/A
traffic_light.buffer float Buffer distance to return original lane before reaching traffic light. 3.0 N/A
stop.max_distance float Maximum stop distance in the situation where avoidance maneuver is not approved or in yield maneuver. 20.0 N/A
stop.stop_buffer float Buffer distance in the situation where avoidance maneuver is not approved or in yield maneuver. 1.0 N/A
yield.enable boolean Flag to enable yield maneuver. true N/A
yield.enable_during_shifting boolean Flag to enable yield maneuver during shifting. false N/A
cancel.enable boolean Flag to enable cancel maneuver. true N/A
policy.make_approval_request string policy for rtc request. select per_shift_line or per_avoidance_maneuver. per_shift_line: request approval for each shift line. per_avoidance_maneuver: request approval for avoidance maneuver (avoid + return). per_shift_line ['per_shift_line', 'per_avoidance_maneuver']
policy.deceleration string policy for vehicle slow down behavior. select best_effort or reliable. best_effort: slow down deceleration & jerk are limited by constraints but there is a possibility that the vehicle can't stop in front of the vehicle. reliable: insert stop or slow down point with ignoring decel/jerk constraints. make it possible to increase chance to avoid but uncomfortable deceleration maybe happen. best_effort ['reliable', 'best_effort']
policy.lateral_margin string policy for voidance lateral margin. select best_effort or reliable. best_effort: output avoidance path with shorten lateral margin when there is no enough longitudinal margin to avoid. reliable: module output avoidance path with safe (rtc cooperate) state only when the vehicle can avoid with expected lateral margin. best_effort ['reliable', 'best_effort']
policy.use_shorten_margin_immediately boolean if true, module doesn't wait deceleration and outputs avoidance path by best effort margin. true N/A
lateral.velocity array Velocity array to decide current lateral accel/jerk limit. [1.0, 1.38, 11.1] N/A
lateral.max_accel_values array Avoidance path gets sharp up to this accel limit when there is not enough distance from ego. [0.5, 0.5, 0.5] N/A
lateral.min_jerk_values array Avoidance path is generated with this jerk when there is enough distance from ego. [0.2, 0.2, 0.2] N/A
lateral.max_jerk_values array Avoidance path gets sharp up to this jerk limit when there is not enough distance from ego. [1.0, 1.0, 1.0] N/A
longitudinal.nominal_deceleration float Nominal deceleration limit. -1.0 N/A
longitudinal.nominal_jerk float Nominal jerk limit. 0.5 N/A
longitudinal.max_deceleration float Max deceleration limit. -1.5 N/A
longitudinal.max_jerk float Max jerk limit. 1.0 N/A
longitudinal.max_acceleration float Maximum acceleration during avoidance. 0.5 N/A
longitudinal.min_velocity_to_limit_max_acceleration float If the ego speed is faster than this param, the module applies acceleration limit max_acceleration. 2.78 N/A
trim.quantize_size float Lateral shift length quantize size. 0.1 N/A
trim.th_similar_grad_1 float Lateral shift length threshold to merge similar gradient shift lines. 0.1 N/A
trim.th_similar_grad_2 float Lateral shift length threshold to merge similar gradient shift lines. 0.2 N/A
trim.th_similar_grad_3 float Lateral shift length threshold to merge similar gradient shift lines. 0.5 N/A
debug.marker boolean Publish debug marker. false N/A

Future extensions / Unimplemented parts#

  • Planning on the intersection
    • If it is known that the ego vehicle is going to stop in the middle of avoidance execution (for example, at a red traffic light), sometimes the avoidance should not be executed until the vehicle is ready to move. This is because it is impossible to predict how the environment will change during the stop. This is especially important at intersections.

fig1

  • Safety Check

    • In the current implementation, it is only the jerk limit that permits the avoidance execution. It is needed to consider the collision with other vehicles when change the path shape.
  • Consideration of the speed of the avoidance target

    • In the current implementation, only stopped vehicle is targeted as an avoidance target. It is needed to support the overtaking function for low-speed vehicles, such as a bicycle. (It is actually possible to overtake the low-speed objects by changing the parameter, but the logic is not supported and thus the safety cannot be guaranteed.)
    • The overtaking (e.g., to overtake a vehicle running in front at 20 km/h at 40 km/h) may need to be handled outside the avoidance module. It should be discussed which module should handle it.
  • Cancel avoidance when target disappears

    • In the current implementation, even if the avoidance target disappears, the avoidance path will remain. If there is no longer a need to avoid, it must be canceled.
  • Improved performance of avoidance target selection

    • Essentially, avoidance targets are judged based on whether they are static objects or not. For example, a vehicle waiting at a traffic light should not be avoided because we know that it will start moving in the future. However this decision cannot be made in the current Autoware due to the lack of the perception functions. Therefore, the current avoidance module limits the avoidance target to vehicles parked on the shoulder of the road, and executes avoidance only for vehicles that are stopped away from the center of the lane. However, this logic cannot avoid a vehicle that has broken down and is stopped in the center of the lane, which should be recognized as a static object by the perception module. There is room for improvement in the performance of this decision.
  • Resampling path
    • Now the rough resolution resampling is processed to the output path in order to reduce the computational cost for the later modules. This resolution is set to a uniformly large value (e.g. 5m), but small resolution should be applied for complex paths.

How to debug#

Publishing Visualization Marker#

Developers can see what is going on in each process by visualizing all the avoidance planning process outputs. The example includes target vehicles, shift points for each object, shift points after each filtering process, etc.

fig1

To enable the debug marker, execute ros2 param set /planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner avoidance.publish_debug_marker true (no restart is needed) or simply set the publish_debug_marker to true in the avoidance.param.yaml for permanent effect (restart is needed). Then add the marker /planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/debug/avoidance in rviz2.

Echoing debug message to find out why the objects were ignored#

If for some reason, no shift point is generated for your object, you can check for the failure reason via ros2 topic echo.

avoidance_debug_message_array

To print the debug message, just run the following

ros2 topic echo /planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/debug/avoidance_debug_message_array