Skip to content

Feat: support coordinate road in TimeHeadway condition

This PR still uses branch version of mantle-api, but it is ready for review now. It will be updated after the PR in mantle-api merged.

This PR adds support for distance calculation in the road coordinate system. While it is primarily intended for use in the TimeHeadwayCondition, it can also be applied to other conditions.

🔗 [Definition of road coordinate system in TimeHeadwayCondition]

Code Overview:

  1. The core functionality is implemented in the GetLongitudinalRoadDistanceBetweenPositions function. This function performs the following steps:
  • Path Calculation: Computes the longest path between two positions.
  • Logical Lane Path Conversion: Transforms the lane path into a logical lane path to obtain the road reference line for distance computation.
  • Duplicate Removal: Removes duplicate reference lines, since multiple logical lanes may refer to the same road reference line.
  • Distance Computation: Calculates the longitudinal road distance based on the size of the path and the projection of the start and target points onto the road reference lines.
  1. The above function uses PathFinder for the path calculation. (See the related issue for the previous implementation.)
  2. In the conversion from map_api to gtgen, a mapping between lane IDs and logical lane IDs has been added to the gtgen map to support logical lane path extraction from the original lane path.

Limitation:

Currently not supported:

  • When either the start position or the target position is on a bidirectional road.

Related PRs:

  1. 🔗 API extension in mantle-api
  2. 🔗 Enhancement of the TimeHeadWay condition in osc1-engine
  3. 🔗 Integration tests within gtgen-simulator
Edited by Ziqi Zhou

Merge request reports

Loading