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

fix(path_distance_calculator): do not calculate distance when too short path is subscribed #2892

Merged

Conversation

tkimura4
Copy link
Contributor

@tkimura4 tkimura4 commented Feb 15, 2023

Description

Do not calculate distance when too short path is subscribed to avoid process-death by invalid access here

    const double distance =
      motion_utils::calcSignedArcLength(path->points, pose->pose.position, path->points.size() - 1);

Related links

TERIV Internal

Tests performed

I confirmed that the path_distance_calculator node works normally using the planning simulator.
$ros2 launch path_distance_calculator path_distance_calculator.launch.xml

(But I didn't test that the node didn't die when a too short path is subscribed.)

Notes for reviewers

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

…rt path is subscribed

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
@tkimura4 tkimura4 requested a review from h-ohta February 15, 2023 10:49
@github-actions github-actions bot added the component:common Common packages from the autoware-common repository. (auto-assigned) label Feb 15, 2023
@codecov
Copy link

codecov bot commented Feb 15, 2023

Codecov Report

Base: 11.62% // Head: 11.62% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (85a3ab8) compared to base (14979d0).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2892   +/-   ##
=======================================
  Coverage   11.62%   11.62%           
=======================================
  Files        1321     1321           
  Lines       92140    92139    -1     
  Branches    24443    24443           
=======================================
  Hits        10714    10714           
+ Misses      70244    70243    -1     
  Partials    11182    11182           
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 11.62% <ø> (+<0.01%) ⬆️ Carriedforward from 575decb

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

Impacted Files Coverage Δ
...stance_calculator/src/path_distance_calculator.cpp 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tkimura4
Copy link
Contributor Author

@isamu-takagi @yabuta
Could you review this?

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
Copy link
Contributor

@isamu-takagi isamu-takagi left a comment

Choose a reason for hiding this comment

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

LGTM. I leave it up to you to reflect the comments.

@tkimura4 tkimura4 merged commit 477e859 into autowarefoundation:main Feb 16, 2023
@tkimura4 tkimura4 deleted the fix/path_distance_calculator_error branch February 16, 2023 07:32
h-ohta pushed a commit to tier4/autoware.universe that referenced this pull request Feb 16, 2023
…rt path is subscribed (autowarefoundation#2892)

* fix(path_distance_calculator): do not calculate distance when too short path is subscribed

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* unify conditions

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

---------

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
h-ohta pushed a commit to tier4/autoware.universe that referenced this pull request Feb 27, 2023
…rt path is subscribed (autowarefoundation#2892)

* fix(path_distance_calculator): do not calculate distance when too short path is subscribed

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* unify conditions

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

---------

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
h-ohta added a commit to tier4/autoware.universe that referenced this pull request Feb 27, 2023
#281)

* fix: path distance calculator (#975)

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* fix(path_distance_calculator): do not calculate distance when too short path is subscribed (autowarefoundation#2892)

* fix(path_distance_calculator): do not calculate distance when too short path is subscribed

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* unify conditions

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

---------

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

---------

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
Co-authored-by: Tomoya Kimura <tomoya.kimura@tier4.jp>
nabetetsu pushed a commit to xygyo77/autoware.universe that referenced this pull request Mar 1, 2023
…rt path is subscribed (autowarefoundation#2892)

* fix(path_distance_calculator): do not calculate distance when too short path is subscribed

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* unify conditions

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

---------

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
1222-takeshi pushed a commit to 1222-takeshi/autoware.universe that referenced this pull request Mar 6, 2023
…rt path is subscribed (autowarefoundation#2892)

* fix(path_distance_calculator): do not calculate distance when too short path is subscribed

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

* unify conditions

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>

---------

Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants