Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(planning_evaluator): add evaluation feature of trajectory lateral displacement #9718

Conversation

kyoichi-sugahara
Copy link
Contributor

Description

This PR introduces a new trajectory lateral displacement metric and enhances the stability evaluation capabilities of the planning evaluator by incorporating ego vehicle velocity and evaluation time parameters.

The main purpose of this metric is to detect trajectory chattering (rapid oscillations in planned paths), which can lead to unstable vehicle behavior.

  • Added new metric trajectory_lateral_displacement to evaluate cumulative lateral displacement
  • Added ego odometry support to the metrics calculator for velocity-aware evaluations
  • Introduced evaluation_time_s parameter (default: 5.0s) for trajectory evaluation duration
  • Added utility function calc_lookahead_trajectory_distance to calculate distance from ego position to trajectory end

Implementation Details

  • The new trajectory lateral displacement metric:
    • Evaluates the cumulative absolute lateral displacement between two trajectories
    • Uses ego vehicle velocity and evaluation time to determine the evaluation section length
    • Samples points along trajectories to measure lateral offsets
    • Considers trajectory length constraints based on ego position

Related links

Parent Issue:

  • Link

How was this PR tested?

run simulator with foxglove visualization

2024-12-23_11.46.10.mp4

image

Notes for reviewers

None.

Interface changes

ROS Parameter Changes

Additions and removals

Change type Parameter Name Type Default Value Description
Added trajectory.evaluation_time_s double 5.0 time duration for trajectory evaluation in seconds

Effects on system behavior

None.

@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:evaluator Evaluation tools for planning, localization etc. (auto-assigned) labels Dec 23, 2024
Copy link

github-actions bot commented Dec 23, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@kyoichi-sugahara kyoichi-sugahara force-pushed the feat/planning_evaluator/evaluate_trajectory_lateral_displacement branch from 2f429fa to 2aa69b4 Compare December 23, 2024 08:09
Copy link
Contributor

@xtk8532704 xtk8532704 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~

@kyoichi-sugahara kyoichi-sugahara added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 23, 2024
…e and time from ego pose

Signed-off-by: Kyoichi Sugahara <[email protected]>
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 93.87755% with 3 lines in your changes missing coverage. Please review.

Project coverage is 29.76%. Comparing base (07db183) to head (2a221df).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...anning_evaluator/src/metrics/stability_metrics.cpp 86.66% 0 Missing and 2 partials ⚠️
...e_planning_evaluator/src/metrics/metrics_utils.cpp 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9718   +/-   ##
=======================================
  Coverage   29.75%   29.76%           
=======================================
  Files        1444     1445    +1     
  Lines      108689   108737   +48     
  Branches    42663    42677   +14     
=======================================
+ Hits        32336    32361   +25     
- Misses      73171    73192   +21     
- Partials     3182     3184    +2     
Flag Coverage Δ *Carryforward flag
differential 8.37% <93.87%> (?)
total 29.73% <ø> (-0.02%) ⬇️ Carriedforward from 9bc173c

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kyoichi-sugahara kyoichi-sugahara merged commit 97bc5a7 into autowarefoundation:main Dec 23, 2024
34 of 35 checks passed
@kyoichi-sugahara kyoichi-sugahara deleted the feat/planning_evaluator/evaluate_trajectory_lateral_displacement branch December 23, 2024 09:24
kminoda pushed a commit to kminoda/autoware.universe that referenced this pull request Dec 25, 2024
…l displacement (autowarefoundation#9718)

* feat(planning_evaluator): add evaluation feature of trajectory lateral displacement

Signed-off-by: Kyoichi Sugahara <[email protected]>

* feat(metrics_calculator): implement lookahead trajectory calculation and remove deprecated method

Signed-off-by: Kyoichi Sugahara <[email protected]>

* fix(planning_evaluator): rename lateral_trajectory_displacement to trajectory_lateral_displacement for consistency

Signed-off-by: Kyoichi Sugahara <[email protected]>

---------

Signed-off-by: Kyoichi Sugahara <[email protected]>
kyoichi-sugahara added a commit to kyoichi-sugahara/autoware.universe that referenced this pull request Dec 25, 2024
…l displacement (autowarefoundation#9718)

* feat(planning_evaluator): add evaluation feature of trajectory lateral displacement

Signed-off-by: Kyoichi Sugahara <[email protected]>

* feat(metrics_calculator): implement lookahead trajectory calculation and remove deprecated method

Signed-off-by: Kyoichi Sugahara <[email protected]>

* fix(planning_evaluator): rename lateral_trajectory_displacement to trajectory_lateral_displacement for consistency

Signed-off-by: Kyoichi Sugahara <[email protected]>

---------

Signed-off-by: Kyoichi Sugahara <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:evaluator Evaluation tools for planning, localization etc. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:documentation Creating or refining documentation. (auto-assigned)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants