GetLaneOrientation() Issue for Road Crossing Scenarios and Similar Cases
**Issue Description: **
- A scenario involves a pedestrian crossing a road as depicted in the provided map image.
- The pedestrian's behavior is defined using FollowTrajectoryAction in the OpenSCENARIO file.
- Expected vs. Actual Behavior:
- Expected: The pedestrian should maintain a constant yaw angle while moving.
- Actual: The pedestrian exhibits unexpected yaw changes, as shown in the following video: pedestrian_crossing_issue
**Issue Identification: **
-
The issue originates from the function call in
open_scenario_engine/src/Conversion/OscToMantle/ConvertScenarioPosition.cpp
:
-
This function calls
FindBestLaneCandidate()
inlane_location_provider.cpp
in GtGenEnvironment (link): -
In the above scenario where the number of found candidate lanes is two (two roads intersecting), the function returns lanes.front() every time in this case, as indicated in the marked part of the image.
-
This results in the selected lane for the pedestrian being inconsistent, causing the pedestrian to rotate unexpectedly as shown in the video. Specifically, the pedestrian's yaw angle is determined by the sum of the relative angle specified in the scenario file and the lane orientation at the corresponding point. Due to the fluctuating selection of lanes for the pedestrian, the lane orientation also varies, leading to unpredictable changes in the pedestrian's yaw angle.
Would it be necessary to improve the FindBestLaneCandidate()
mechanism or add additional logic to handle this or similar use case?