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(autoware_trajectory): update autoware_trajectory interfaces #10034

Merged
merged 5 commits into from
Jan 30, 2025

Conversation

yhisaki
Copy link
Contributor

@yhisaki yhisaki commented Jan 28, 2025

Description

This PR contains many changes, but the major changes are described in the following list.

  • Move key functions from member to external.

    • before

      double s = trajectory.closest(p);
    • after

      double s = utils::closest(trajectory, p);
  • Add shift function

    autoware::trajectory::ShiftInterval shift_interval1;
    shift_interval1.start = trajectory->length() / 4.0;
    shift_interval1.end = trajectory->length() * 2.0 / 4.0;
    shift_interval1.length = 0.5;
    
    autoware::trajectory::ShiftInterval shift_interval2;
    shift_interval2.start = trajectory->length() * 2.0 / 4.0;
    shift_interval2.end = trajectory->length() * 3.0 / 4.0;
    shift_interval2.length = -0.5;
    
    auto shifted_trajectory =
      autoware::trajectory::shift(*trajectory, {shift_interval1, shift_interval2});    

    Figure_1

  • Add find_intervals function

    const std::vector<autoware::trajectory::Interval> intervals =
      autoware::trajectory::find_intervals(
        *trajectory, [](const tier4_planning_msgs::msg::PathPointWithLaneId & point) {
          return point.lane_ids[0] == 1;
        });  

    Figure_1

  • And some style changes...

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added component:planning Route planning, decision-making, and navigation. (auto-assigned) component:common Common packages from the autoware-common repository. (auto-assigned) labels Jan 28, 2025
Copy link

github-actions bot commented Jan 28, 2025

Thank you for contributing to the Autoware project!

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

Please ensure:

@yhisaki yhisaki force-pushed the feat/autoware_trajectory branch from f8a7525 to 9cd2ce9 Compare January 28, 2025 09:02
@yhisaki yhisaki marked this pull request as ready for review January 28, 2025 09:03
@yhisaki yhisaki added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jan 28, 2025
detail::to_point(shifted_points.back()).y -= std::cos(azimuth) * shift_length;
}
auto shifted_trajectory = reference_trajectory;
bool valid = shifted_trajectory.build(shifted_points);
Copy link
Contributor

Choose a reason for hiding this comment

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

add const

yhisaki and others added 2 commits January 29, 2025 12:16
Signed-off-by: Y.Hisaki <[email protected]>
Signed-off-by: Y.Hisaki <[email protected]>
@yhisaki yhisaki requested a review from takayuki5168 January 29, 2025 05:24
Signed-off-by: Y.Hisaki <[email protected]>
Signed-off-by: Y.Hisaki <[email protected]>
@yhisaki yhisaki enabled auto-merge (squash) January 30, 2025 06:57
@yhisaki yhisaki disabled auto-merge January 30, 2025 06:58
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 37.93103% with 216 lines in your changes missing coverage. Please review.

Project coverage is 29.75%. Comparing base (8b0b9a7) to head (eb03048).
Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
common/autoware_trajectory/src/utils/shift.cpp 0.00% 94 Missing ⚠️
common/autoware_trajectory/src/pose.cpp 10.71% 25 Missing ⚠️
common/autoware_trajectory/src/point.cpp 35.13% 24 Missing ⚠️
common/autoware_trajectory/src/path_point.cpp 36.36% 21 Missing ⚠️
common/autoware_trajectory/src/detail/types.cpp 20.00% 16 Missing ⚠️
.../autoware/trajectory/detail/interpolated_array.hpp 20.00% 6 Missing and 2 partials ⚠️
common/autoware_trajectory/src/utils/crossed.cpp 66.66% 2 Missing and 5 partials ⚠️
common/autoware_trajectory/src/detail/logging.cpp 0.00% 6 Missing ⚠️
...utoware_trajectory/src/path_point_with_lane_id.cpp 76.19% 5 Missing ⚠️
common/autoware_trajectory/src/utils/closest.cpp 84.21% 1 Missing and 2 partials ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10034      +/-   ##
==========================================
- Coverage   29.78%   29.75%   -0.03%     
==========================================
  Files        1436     1451      +15     
  Lines      108308   108544     +236     
  Branches    42956    43016      +60     
==========================================
+ Hits        32256    32301      +45     
- Misses      72920    73105     +185     
- Partials     3132     3138       +6     
Flag Coverage Δ *Carryforward flag
differential 14.95% <37.93%> (?)
total 29.71% <ø> (-0.07%) ⬇️ Carriedforward from 8b0b9a7

*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.

@yhisaki yhisaki merged commit d682048 into autowarefoundation:main Jan 30, 2025
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:common Common packages from the autoware-common repository. (auto-assigned) component:planning Route planning, decision-making, and navigation. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants