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(pure_pursuit): return zero curvature when neighboring idx isn't found #2891

Conversation

kyoichi-sugahara
Copy link
Contributor

@kyoichi-sugahara kyoichi-sugahara commented Feb 15, 2023

Description

When candidate point for the curvature calculation isn't found, 0 is returned to avoid unnecessary warnings.

But there is a still space to solve this probelem by

  • shifting closest point so that enough distance can be gotten.
  • changing distane from the closest point between forward direction and backward direction.

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.

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.

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

@kyoichi-sugahara kyoichi-sugahara requested review from TakaHoribe and a team as code owners February 15, 2023 10:18
@github-actions github-actions bot added the component:control Vehicle control algorithms and mechanisms. (auto-assigned) label Feb 15, 2023
…ound

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
@kyoichi-sugahara kyoichi-sugahara force-pushed the fix/pure-pursuit-calculate-curvature branch from 1b29b9c to 29b337c Compare February 15, 2023 11:22
@codecov
Copy link

codecov bot commented Feb 15, 2023

Codecov Report

Base: 11.80% // Head: 11.83% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (71001b3) compared to base (1fdcab3).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2891      +/-   ##
==========================================
+ Coverage   11.80%   11.83%   +0.02%     
==========================================
  Files        1319     1319              
  Lines       92309    92109     -200     
  Branches    24794    24719      -75     
==========================================
- Hits        10899    10898       -1     
+ Misses      70051    69916     -135     
+ Partials    11359    11295      -64     
Flag Coverage Δ *Carryforward flag
differential 13.52% <ø> (?)
total 11.83% <ø> (+0.02%) ⬆️ Carriedforward from 5dafa4c

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

Impacted Files Coverage Δ
...c/pure_pursuit/pure_pursuit_lateral_controller.cpp 0.00% <ø> (ø)
...vehicle_model/sim_model_ideal_steer_acc_geared.cpp 85.71% <0.00%> (-2.39%) ⬇️
planning/obstacle_stop_planner/src/node.cpp 0.00% <0.00%> (ø)
...erception/traffic_light_classifier/src/nodelet.cpp 0.00% <0.00%> (ø)
...lanning/obstacle_stop_planner/src/debug_marker.cpp 0.00% <0.00%> (ø)
...anning/obstacle_stop_planner/src/planner_utils.cpp 0.00% <0.00%> (ø)
planning/obstacle_avoidance_planner/src/node.cpp 0.12% <0.00%> (+<0.01%) ⬆️
control/mpc_lateral_controller/src/mpc_utils.cpp 57.27% <0.00%> (+0.26%) ⬆️
...path_planner/test/test_drivable_area_expansion.cpp 59.30% <0.00%> (+25.30%) ⬆️

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.

@kyoichi-sugahara kyoichi-sugahara changed the title fix(pure_pursuit):return zero curvature when neighboring idx isn't found fix(pure_pursuit): return zero curvature when neighboring idx isn't found Feb 15, 2023
Copy link
Member

@brkay54 brkay54 left a comment

Choose a reason for hiding this comment

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

Thank you for your work! LGTM!

if (trajectory_resampled_->points.size() - 1 >= closest_idx + idx_dist) {
next_idx = closest_idx + idx_dist;
} else {
// return zero curvature because next_idx can't be found
Copy link
Contributor

Choose a reason for hiding this comment

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

@kyoichi-sugahara
IMO
I think it's better to use prev_idx and next_idx a certain distance far from closest_idx with threshold.
What do you think?

 prev_index,<--->closest index <--->next_idx

Copy link
Contributor Author

@kyoichi-sugahara kyoichi-sugahara Feb 16, 2023

Choose a reason for hiding this comment

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

@taikitanaka3
I think your proposal method is expected behavior in the current implementation

@taikitanaka3
Copy link
Contributor

@kyoichi-sugahara
TODO: write down TODOs for calculating curvature.

@kyoichi-sugahara
Copy link
Contributor Author

checked warnings are not outputted

pure_pursuit_without_warnings.mp4

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Copy link
Contributor

@taikitanaka3 taikitanaka3 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 enabled auto-merge (squash) February 16, 2023 06:07
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Copy link
Contributor

@TakaHoribe TakaHoribe left a comment

Choose a reason for hiding this comment

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

thank you!

@kyoichi-sugahara kyoichi-sugahara merged commit a872dd1 into autowarefoundation:main Feb 16, 2023
nabetetsu pushed a commit to xygyo77/autoware.universe that referenced this pull request Mar 1, 2023
…ound (autowarefoundation#2891)

* fix(pure_pursuit): return zero curvature when neighboring idx isn't found

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

* modify comment and add TODO

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

* fix comments

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

---------

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
1222-takeshi pushed a commit to 1222-takeshi/autoware.universe that referenced this pull request Mar 6, 2023
…ound (autowarefoundation#2891)

* fix(pure_pursuit): return zero curvature when neighboring idx isn't found

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

* modify comment and add TODO

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

* fix comments

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

---------

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
@kyoichi-sugahara kyoichi-sugahara deleted the fix/pure-pursuit-calculate-curvature branch April 15, 2023 03:23
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants