Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
Signed-off-by: MasatoSaeki <[email protected]>
  • Loading branch information
MasatoSaeki committed Dec 31, 2024
1 parent c8e0040 commit 5fcffc1
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 12 deletions.
58 changes: 46 additions & 12 deletions perception/autoware_crosswalk_traffic_light_estimator/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# crosswalk_traffic_light_estimator
# autoware_crosswalk_traffic_light_estimator

## Purpose

`crosswalk_traffic_light_estimator` is a module that estimates pedestrian traffic signals from HDMap and detected vehicle traffic signals.
`autoware_crosswalk_traffic_light_estimator` has the following two functions.

- If the pedestrian traffic signals are not detected by perception pipeline, estimates the color from detected vehicle traffic signals, HDMap, and route.
- The assumption is that `~/input/route` is subscribed and the conflicting crosswalk to route is known.
- Include the pedestrian traffic signals are invalid(`no detection`, `backlight`, or `occlusion`)
- This means that it is not perception pipeline can not detect, does not detect caused by not met conditions.
- Estimates whether the pedestrian traffic signals are flashing or not, and overwrite the results.

## Inputs / Outputs

### Input

| Name | Type | Description |
| ------------------------------------ | ------------------------------------------------ | ------------------ |
| `~/input/vector_map` | `autoware_map_msgs::msg::LaneletMapBin` | vector map |
| `~/input/route` | `autoware_planning_msgs::msg::LaneletRoute` | route |
| `~/input/classified/traffic_signals` | `tier4_perception_msgs::msg::TrafficSignalArray` | classified signals |
| Name | Type | Description |
| ------------------------------------ | ------------------------------------------------------- | ------------------ |
| `~/input/vector_map` | `autoware_map_msgs::msg::LaneletMapBin` | vector map |
| `~/input/route` | `autoware_planning_msgs::msg::LaneletRoute` | optional: route |
| `~/input/classified/traffic_signals` | `autoware_perception_msgs::msg::TrafficLightGroupArray` | classified signals |

### Output

Expand All @@ -25,16 +31,22 @@
| Name | Type | Description | Default value |
| :---------------------------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
| `use_last_detect_color` | `bool` | If this parameter is `true`, this module estimates pedestrian's traffic signal as RED not only when vehicle's traffic signal is detected as GREEN/AMBER but also when detection results change GREEN/AMBER to UNKNOWN. (If detection results change RED or AMBER to UNKNOWN, this module estimates pedestrian's traffic signal as UNKNOWN.) If this parameter is `false`, this module use only latest detection results for estimation. (Only when the detection result is GREEN/AMBER, this module estimates pedestrian's traffic signal as RED.) | `true` |
| `last_detect_color_hold_time` | `double` | The time threshold to hold for last detect color. | `2.0` |
| `last_detect_color_hold_time` | `double` | The time threshold to hold for last detect color. The unit is second. | `2.0` |
| `last_colors_hold_time` | `double` | The time threshold to hold for history detected pedestrian traffic light color. The unit is second. | `1.0` |

## Inner-workings / Algorithms

1. Estimate the color of pedestrian traffic light from HDMap and detected vehicle traffic signals.
2. If pedestrian traffic signals are flashing or invalid, overwrite the classification results.

### Estimate the color of pedestrian traffic signals

```plantuml
start
:subscribe detected traffic signals & HDMap;
:subscribe detected traffic signals, HDMap, and route;
:extract crosswalk lanelets from HDMap;
:extract road lanelets that conflicts crosswalk;
:extract road lanelets that conflicts crosswalk from route;
:initialize non_red_lanelets(lanelet::ConstLanelets);
if (Latest detection result is **GREEN** or **AMBER**?) then (yes)
:push back non_red_lanelets;
Expand All @@ -58,7 +70,7 @@ end

If traffic between pedestrians and vehicles is controlled by traffic signals, the crosswalk traffic signal maybe **RED** in order to prevent pedestrian from crossing when the following conditions are satisfied.

### Situation1
#### Situation1

- crosswalk conflicts **STRAIGHT** lanelet
- the lanelet refers **GREEN** or **AMBER** traffic signal (The following pictures show only **GREEN** case)
Expand All @@ -70,7 +82,7 @@ If traffic between pedestrians and vehicles is controlled by traffic signals, th
<img src="images/intersection1.svg" width=80%>
</div>

### Situation2
#### Situation2

- crosswalk conflicts different turn direction lanelets (STRAIGHT and LEFT, LEFT and RIGHT, RIGHT and STRAIGHT)
- the lanelets refer **GREEN** or **AMBER** traffic signal (The following pictures show only **GREEN** case)
Expand All @@ -79,6 +91,28 @@ If traffic between pedestrians and vehicles is controlled by traffic signals, th
<img src="images/intersection2.svg" width=80%>
</div>

### Estimate whether pedestrian traffic signals are flashing

```plantumul
start
if (the pedestrian traffic light classification result exists)then
: update the flashing flag according to the classification result(in_signal) and last_signals
if (the traffic light is flashing?)then(yes)
: update the traffic light state
else(no)
: the traffic light state is the same with the classification result
if (the classification result not exists)
: the traffic light state is the same with the estimation
: output the current traffic light state
end
```

#### Update flashing flag

<div align="center">
<img src="images/flashing_state.png" width=50%>
</div>

## Assumptions / Known limits

## Future extensions / Unimplemented parts
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5fcffc1

Please sign in to comment.