Skip to content

Commit

Permalink
add new document
Browse files Browse the repository at this point in the history
Signed-off-by: Masaya Kataoka <[email protected]>
  • Loading branch information
hakuturu583 committed Feb 16, 2024
1 parent c74f839 commit 4907472
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Lane pose caluculation when getting longitudianl distance

Check warning on line 1 in docs/developer_guide/lane_pose_calculation/GetLongitudinalDistance.md

View workflow job for this annotation

GitHub Actions / spell-check

Unknown word (caluculation)

Check warning on line 1 in docs/developer_guide/lane_pose_calculation/GetLongitudinalDistance.md

View workflow job for this annotation

GitHub Actions / spell-check

Unknown word (longitudianl)

Attempts to calculate the pose for adjacent lane coordinate systems when measuring longitudinal distance.
The length of the horizontal bar must intersect with the adjacent lanelet, [so it is always 10 m regardless of the entity type.](https://github.com/tier4/scenario_simulator_v2/blob/5f19d39ef29243396f26225976975f0c27914c12/simulation/traffic_simulator/src/entity/entity_manager.cpp#L375C21-L442)

![Get longitudinal distance](../../image/longitudinal_distance.png "Getting longitudinal distance.")

The shorter of the two blue arrows shown in the figure above is the longitudinal distance between entities.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
The calculation method of the lane coordinate system differs from Entity to Entity, and the process of determining which lane to match is complex, including fallback.
In this document, we will show how the pose calculation of the lane coordinate system is performed for each Entity.

There are two possible times when the lane coordinate system may be computed for all Entities.
These are the [timing immediately after the spawn of the Entity](Spawn.md) and the [timing of the frame update](UpdateFrame.md).
There are 3 possible timings when the lane coordinate system may be computed for all Entities.
These are the [timing immediately after the spawn of the Entity](Spawn.md), the [timing of the frame update](UpdateFrame.md) the [timing of the getting longitudinal distance](GetLongitudinalDistance.md)

!!! Note
If you are not a simulator developer but a scenario writer, it is sufficient to check [this document](UpdateFrame.md) and [this section](#lane-coordinate-system-calculation-algorithm-for-a-specific-lane), since the distance measurement via condition in used in the OpenSCENARIO is basically done after frame update.
Expand All @@ -13,18 +13,18 @@ These are the [timing immediately after the spawn of the Entity](Spawn.md) and t

!!! summary
- The calculation of the pose in the lane coordinate system involves two steps: first, filtering by "which lanes can be matched," and then "calculating the pose in the specific lane coordinate system.
- The parameter that most affects the matching results is the length of the horizontal bar. This length depends on the type of Entity and the timing of the calculation. If you want to check the length quickly, please check [this section](#quick-guide-to-horizontal-bar-lengths).
- The parameter that most affects the matching results is the length of the horizontal bar. This length depends on the type of entity and the timing of the calculation. If you want to check the length quickly, please check [this section](#quick-guide-to-horizontal-bar-lengths).

### Quick guide to horizontal bar lengths

The unit of the table is meter.

| EntityType \ Timing of caluculation | [Spawn](Spawn.md) | [UpdateFrame](UpdateFrame.md) |
| ----------------------------------- | ----------------- | -------------------------------------------------------------------------------------- |
| EgoEntity | 2.0 | [(tread of the entity) + 2.0](UpdateFrame.md#calculate-pose-in-lane-coordinate-system) |
| VehicleEntity | 2.0 | N/A |
| PedestrianEntity | 2.0 | [2.0 or 4.0](UpdateFrame.md#pedestrian-entity-with-behavior-tree) |
| MiscObject | 2.0 | N/A |
| EntityType \ Timing of caluculation | [Spawn](Spawn.md) | [UpdateFrame](UpdateFrame.md) | [Fetting longitudinal distance](GetLongitudinalDistance.md) |

Check warning on line 22 in docs/developer_guide/lane_pose_calculation/LanePoseCalculation.md

View workflow job for this annotation

GitHub Actions / spell-check

Unknown word (caluculation)

Check warning on line 22 in docs/developer_guide/lane_pose_calculation/LanePoseCalculation.md

View workflow job for this annotation

GitHub Actions / spell-check

Unknown word (Fetting)
| ----------------------------------- | ----------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| EgoEntity | 2.0 | [(tread of the entity) + 2.0](UpdateFrame.md#calculate-pose-in-lane-coordinate-system) | 10 |
| VehicleEntity | 2.0 | N/A | 10 |
| PedestrianEntity | 2.0 | [2.0 or 4.0](UpdateFrame.md#pedestrian-entity-with-behavior-tree) | 10 |
| MiscObject | 2.0 | N/A | 10 |

### Detail of the lane coordinate system calculation algorithm for a specific lane

Expand Down
Binary file added docs/image/longitudinal_distance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ nav:
Timing of lane pose calculation: developer_guide/lane_pose_calculation/LanePoseCalculation.md
Process of lane pose calculation when spawning entity: developer_guide/lane_pose_calculation/Spawn.md
Process of lane pose calculation when updating frame: developer_guide/lane_pose_calculation/UpdateFrame.md
Process of lane pose calculation when getting longitudinal distance: developer_guide/lane_pose_calculation/GetLongitudinalDistance.md
# cspell: ignore TIERIV
- developer_guide/TIERIVScenarioFormatVersion2.md
- developer_guide/CONTRIBUTING.md
Expand Down

0 comments on commit 4907472

Please sign in to comment.