Skip to content

Commit

Permalink
docs(bpp): separate behavior path planner documents (autowarefoundati…
Browse files Browse the repository at this point in the history
…on#5961)

* docs(bpp): separate avoidance document

Signed-off-by: satoshi-ota <[email protected]>

* docs(bpp): separate ablc document

Signed-off-by: satoshi-ota <[email protected]>

* docs(bpp): separate side shift document

Signed-off-by: satoshi-ota <[email protected]>

* docs(bpp): separate goal planner document

Signed-off-by: satoshi-ota <[email protected]>

* docs(bpp): separate start planner document

Signed-off-by: satoshi-ota <[email protected]>

* docs(bpp): fix invalid link

Signed-off-by: satoshi-ota <[email protected]>

* docs(bpp): move docs

Signed-off-by: satoshi-ota <[email protected]>

* docs(bpp): remove unused images

Signed-off-by: satoshi-ota <[email protected]>

---------

Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota authored and karishma1911 committed May 26, 2024
1 parent 00a7caf commit 7ae193a
Show file tree
Hide file tree
Showing 100 changed files with 111 additions and 111 deletions.
18 changes: 9 additions & 9 deletions planning/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ nav:
- 'Concept':
- 'Planner Manager': planning/behavior_path_planner/docs/behavior_path_planner_manager_design
- 'Scene Module Interface': planning/behavior_path_planner/docs/behavior_path_planner_interface_design
- 'Path Generation': planning/behavior_path_planner/docs/behavior_path_planner_path_generation_design
- 'Collision Assessment/Safety Check': planning/behavior_path_planner/docs/behavior_path_planner_safety_check
- 'Dynamic Drivable Area': planning/behavior_path_planner/docs/behavior_path_planner_drivable_area_design
- 'Turn Signal': planning/behavior_path_planner/docs/behavior_path_planner_turn_signal_design
- 'Path Generation': planning/behavior_path_planner_common/docs/behavior_path_planner_path_generation_design
- 'Collision Assessment/Safety Check': planning/behavior_path_planner_common/docs/behavior_path_planner_safety_check
- 'Dynamic Drivable Area': planning/behavior_path_planner_common/docs/behavior_path_planner_drivable_area_design
- 'Turn Signal': planning/behavior_path_planner_common/docs/behavior_path_planner_turn_signal_design
- 'Scene Module':
- 'Avoidance': planning/behavior_path_planner/docs/behavior_path_planner_avoidance_design
- 'Avoidance by Lane Change': planning/behavior_path_planner/docs/behavior_path_planner_avoidance_by_lane_change_design
- 'Avoidance': planning/behavior_path_avoidance_module
- 'Avoidance by Lane Change': planning/behavior_path_avoidance_by_lane_change_module
- 'Dynamic Avoidance': planning/behavior_path_planner/docs/behavior_path_planner_dynamic_avoidance_design
- 'Goal Planner': planning/behavior_path_planner/docs/behavior_path_planner_goal_planner_design
- 'Goal Planner': planning/behavior_path_goal_planner_module
- 'Lane Change': planning/behavior_path_lane_change_module
- 'Side Shift': planning/behavior_path_planner/docs/behavior_path_planner_side_shift_design
- 'Start Planner': planning/behavior_path_planner/docs/behavior_path_planner_start_planner_design
- 'Side Shift': planning/behavior_path_side_shift_module
- 'Start Planner': planning/behavior_path_start_planner_module
- 'Behavior Velocity Planner':
- 'About Behavior Velocity': planning/behavior_velocity_planner
- 'Template for Custom Module': planning/behavior_velocity_template_module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ This module is designed as one of the obstacle avoidance features and generates
- Exist lane changeable lanelet.
- Exist avoidance target objects on ego driving lane.

![avoidance_by_lane_change](../image/avoidance_by_lane_change/avoidance_by_lane_change.svg)
![avoidance_by_lane_change](./images/avoidance_by_lane_change.svg)

## Inner-workings / Algorithms

Basically, this module is implemented by reusing the avoidance target filtering logic of the existing [Normal Avoidance Module](./behavior_path_planner_avoidance_design.md) and the path generation logic of the [Normal Lane Change Module](./behavior_path_planner_lane_change_design.md). On the other hand, the conditions under which the module is activated differ from those of a normal avoidance module.
Basically, this module is implemented by reusing the avoidance target filtering logic of the existing [Normal Avoidance Module](../behavior_path_avoidance_module/README.md) and the path generation logic of the [Normal Lane Change Module](../behavior_path_lane_change_module/README.md). On the other hand, the conditions under which the module is activated differ from those of a normal avoidance module.

Check that the following conditions are satisfied after the filtering process for the avoidance target.

### Number of the avoidance target objects

This module is launched when the number of avoidance target objects on **EGO DRIVING LANE** is greater than `execute_object_num`. If there are no avoidance targets in the ego driving lane or their number is less than the parameter, the obstacle is avoided by normal avoidance behavior (if the normal avoidance module is registered).

![trigger_1](../image/avoidance_by_lane_change/avoidance_by_lc_trigger_1.svg)
![trigger_1](./images/avoidance_by_lc_trigger_1.svg)

### Lane change end point condition

Unlike the normal avoidance module, which specifies the shift line end point, this module does not specify its end point when generating a lane change path. On the other hand, setting `execute_only_when_lane_change_finish_before_object` to `true` will activate this module only if the lane change can be completed before the avoidance target object.

Although setting the parameter to `false` would increase the scene of avoidance by lane change, it is assumed that sufficient lateral margin may not be ensured in some cases because the vehicle passes by the side of obstacles during the lane change.

![trigger_2](../image/avoidance_by_lane_change/avoidance_by_lc_trigger_2.svg)
![trigger_2](./images/avoidance_by_lc_trigger_2.svg)

## Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This module executes avoidance over lanes, and the decision requires the lane st

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](../image/avoidance/avoidance_design.fig1.drawio.svg)
![fig1](./images/avoidance_design.fig1.drawio.svg)

### Flowchart

Expand Down Expand Up @@ -185,7 +185,7 @@ The avoidance target should be limited to stationary objects (you should not avo
- 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](../image/avoidance/target_vehicle_selection.svg)
![fig1](./images/target_vehicle_selection.svg)

### Parked-car detection

Expand All @@ -203,7 +203,7 @@ $$

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](../image/avoidance/parked-car-detection.svg)
![fig2](./images/parked-car-detection.svg)

### Compensation for detection lost

Expand Down Expand Up @@ -365,9 +365,9 @@ Therefore, in order to reduce the influence of the noise, avoidance module gener
object_envelope_buffer: 0.3 # [m]
```
![fig1](../image/avoidance/envelope_polygon.svg)
![fig1](./images/envelope_polygon.svg)
![fig1](../image/avoidance/shift_line_generation.svg)
![fig1](./images/shift_line_generation.svg)
### Computing Shift Length and Shift Points
Expand All @@ -388,7 +388,7 @@ else

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

![shift_point_and_its_constraints](../image/avoidance/avoidance_module-shift_point_and_its_constraints.drawio.png)
![shift_point_and_its_constraints](./images/avoidance_module-shift_point_and_its_constraints.drawio.png)

### Rationale of having safety buffer and safety margin

Expand All @@ -399,7 +399,7 @@ To compute the shift length, additional parameters that can be tune are `lateral
- 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](../image/shift_length_parameters.drawio.svg)
![shift_length_parameters](./images/shift_length_parameters.drawio.svg)

### Generating path only within lanelet boundaries

Expand All @@ -410,7 +410,7 @@ The shift length is set as a constant value before the feature is implemented. S

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](../image/avoidance/obstacle_to_road_shoulder_distance.drawio.svg)
![obstacle_to_road_shoulder_distance](./images/obstacle_to_road_shoulder_distance.drawio.svg)

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

Expand Down Expand Up @@ -565,7 +565,7 @@ To solve that, this module provides a parameter for the minimum avoidance speed,
- 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](../image/avoidance/how_to_decide_path_shape_one_object.drawio.svg)
![fig1](./images/how_to_decide_path_shape_one_object.drawio.svg)

#### Multiple obstacle case (one direction)

Expand All @@ -575,13 +575,13 @@ Generate shift points for multiple obstacles. All of them are merged to generate

For the details of the shift point filtering, see [filtering for shift points](#filtering-for-shift-points).

![fig1](../image/avoidance/how_to_decide_path_shape_multi_object_one_direction.drawio.svg)
![fig1](./images/how_to_decide_path_shape_multi_object_one_direction.drawio.svg)

#### 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](../image/avoidance/how_to_decide_path_shape_multi_object_both_direction.drawio.svg)
![fig1](./images/how_to_decide_path_shape_multi_object_both_direction.drawio.svg)

#### Filtering for shift points

Expand All @@ -608,23 +608,23 @@ use_hatched_road_markings: false

#### adjacent lane

![fig1](../image/avoidance/use_adjacent_lane.svg)
![fig1](./images/use_adjacent_lane.svg)

#### opposite lane

![fig1](../image/avoidance/use_opposite_lane.svg)
![fig1](./images/use_opposite_lane.svg)

#### intersection areas

The intersection area is defined on Lanelet map. See [here](https://github.com/autowarefoundation/autoware_common/blob/main/tmp/lanelet2_extension/docs/lanelet2_format_extension.md)

![fig1](../image/avoidance/use_intersection_areas.svg)
![fig1](./images/use_intersection_areas.svg)

#### hatched road markings

The hatched road marking is defined on Lanelet map. See [here](https://github.com/autowarefoundation/autoware_common/blob/main/tmp/lanelet2_extension/docs/lanelet2_format_extension.md#hatched-road-markings-area)

![fig1](../image/avoidance/use_hatched_road_markings.svg)
![fig1](./images/use_hatched_road_markings.svg)

### Safety check

Expand All @@ -647,23 +647,23 @@ safety_check_backward_distance: 50.0 # [m]
safety_check_accel_for_rss: 2.5 # [m/ss]
```

![fig1](../image/avoidance/safety_check_flowchart.svg)
![fig1](./images/safety_check_flowchart.svg)

`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](../image/avoidance/safety_check_step_1.svg)
![fig1](./images/safety_check_step_1.svg)

**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](../image/avoidance/safety_check_step_2.svg)
![fig1](./images/safety_check_step_2.svg)

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](../image/avoidance/safety_check_margin.svg)
![fig1](./images/safety_check_margin.svg)

The value of the longitudinal margin is calculated based on Responsibility-Sensitive Safety theory ([RSS](https://newsroom.intel.com/articles/rss-explained-five-rules-autonomous-vehicle-safety/#gs.ljzofv)). The `safety_check_idling_time` represents $T_{idle}$, and `safety_check_accel_for_rss` represents $a_{max}$.

Expand All @@ -673,7 +673,7 @@ $$

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](../image/avoidance/dynamic_lateral_margin.svg)
![fig1](./images/dynamic_lateral_margin.svg)

```yaml
target_velocity_matrix:
Expand All @@ -695,7 +695,7 @@ If an avoidance path can be generated and it is determined that avoidance maneuv
yield_velocity: 2.78 # [m/s]
```

![fig1](../image/avoidance/yield_maneuver.svg)
![fig1](./images/yield_maneuver.svg)

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

Expand Down Expand Up @@ -736,9 +736,9 @@ $$
SHIFT_{current} > L_{threshold}
$$

![fig1](../image/avoidance/yield_limitation.svg)
![fig1](./images/yield_limitation.svg)

![fig1](../image/avoidance/yield_maneuver_flowchart.svg)
![fig1](./images/yield_maneuver_flowchart.svg)

---

Expand Down Expand Up @@ -935,7 +935,7 @@ namespace: `avoidance.constraints.longitudinal.`
- **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](../image/avoidance/intersection_problem.drawio.svg)
![fig1](./images/intersection_problem.drawio.svg)

- **Safety Check**

Expand Down Expand Up @@ -963,15 +963,15 @@ namespace: `avoidance.constraints.longitudinal.`

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](../image/avoidance/avoidance-debug-marker.png)
![fig1](./images/avoidance-debug-marker.png)

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](../image/avoidance/avoidance_debug_message_array.png)
![avoidance_debug_message_array](./images/avoidance_debug_message_array.png)

To print the debug message, just run the following

Expand Down
Loading

0 comments on commit 7ae193a

Please sign in to comment.