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

refactor(lane_departure_checker): move member functions to util functions #9547

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kyoichi-sugahara
Copy link
Contributor

@kyoichi-sugahara kyoichi-sugahara commented Dec 3, 2024

Description

minor refactoring changes to improve testability and prepare the lane_departure_checker module for unit testing implementation. The changes are minimal and do not affect the core functionality.

  • Moved createVehiclePassingAreas(), getCandidateLanelets() and createVehiclePassingAreas() from LaneDepartureChecker class to utility functions
  • Added proper documentation for utility functions using Doxygen style comments
  • Add proper handling for edge cases in createVehiclePassingAreas
    • Handle empty input vector
    • Handle single footprint case
    • Pre-reserve vector capacity for better performance

Related links

Parent Issue:

  • Link

How was this PR tested?

run psim

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@kyoichi-sugahara kyoichi-sugahara added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 3, 2024
@github-actions github-actions bot added the component:control Vehicle control algorithms and mechanisms. (auto-assigned) label Dec 3, 2024
Copy link

github-actions bot commented Dec 3, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.

Project coverage is 29.50%. Comparing base (e511605) to head (32b35d8).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
..._checker/src/lane_departure_checker_node/utils.cpp 0.00% 23 Missing ⚠️
..._departure_checker_node/lane_departure_checker.cpp 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9547      +/-   ##
==========================================
- Coverage   29.51%   29.50%   -0.01%     
==========================================
  Files        1444     1450       +6     
  Lines      108528   108563      +35     
  Branches    41404    41400       -4     
==========================================
+ Hits        32032    32036       +4     
- Misses      73376    73405      +29     
- Partials     3120     3122       +2     
Flag Coverage Δ *Carryforward flag
differential 21.54% <0.00%> (?)
total 29.52% <ø> (+0.01%) ⬆️ Carriedforward from 961c55d

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

Comment on lines +177 to +182
for (const auto & route_lanelet : route_lanelets) {
const auto poly = route_lanelet.polygon2d().basicPolygon();
if (!boost::geometry::disjoint(poly, footprint_hull)) {
candidate_lanelets.push_back(route_lanelet);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like a good place to use std::copy_if

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:control Vehicle control algorithms and mechanisms. (auto-assigned) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants