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(ad_api_adaptors): fix to merge waypoint #2215

Conversation

isamu-takagi
Copy link
Contributor

@isamu-takagi isamu-takagi commented Nov 4, 2022

Description

Fix the bug where consecutive waypoints would be ignored.

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.

@codecov
Copy link

codecov bot commented Nov 4, 2022

Codecov Report

Base: 11.09% // Head: 11.09% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (343a357) compared to base (d10310d).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2215      +/-   ##
==========================================
- Coverage   11.09%   11.09%   -0.01%     
==========================================
  Files        1202     1202              
  Lines       86169    86219      +50     
  Branches    20682    20682              
==========================================
  Hits         9564     9564              
- Misses      66523    66573      +50     
  Partials    10082    10082              
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 11.07% <0.00%> (ø) Carriedforward from 2e0cc19

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

Impacted Files Coverage Δ
...on_planner/src/mission_planner/mission_planner.cpp 0.00% <0.00%> (ø)
...pi_helpers/ad_api_adaptors/src/routing_adaptor.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.

this, get_clock(), rate.period(), std::bind(&RoutingAdaptor::on_timer, this));

state_ = RouteState::Message::UNKNOWN;
route_ = std::make_shared<SetRoutePoints::Service::Request>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Setting nullptr first sounds better to me.
If you don't think it's good, just ignore please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This value is always used and does not need to be nullptr.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then why do you make route_ shared pointer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the async_send_request function only supports shared pointer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. Thank you

Comment on lines 46 to 52
constexpr int delay_count = 3;
if (0 < request_control_ && request_control_ < delay_count) {
++request_control_;
}
if (request_control_ != delay_count) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this algorithm well.
Why 3 is chosen?

What does merge waypoints mean.

request_control_ seems to have additional meaning, not only what the variable name expresses.
Could you write a comment of what request_control_ means.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 343a357.

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Copy link
Contributor

@takayuki5168 takayuki5168 left a comment

Choose a reason for hiding this comment

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

LGTM

@isamu-takagi isamu-takagi merged commit 5bdfcad into autowarefoundation:main Nov 8, 2022
@isamu-takagi isamu-takagi deleted the fix/routing-adaptor-merge-waypoints branch November 8, 2022 04:16
HansRobo pushed a commit to HansRobo/autoware.universe that referenced this pull request Dec 16, 2022
* fix(ad_api_adaptors): fix to merge waypoint

* fix(ad_api_adaptors): update comments and variable name

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
YoshiRi pushed a commit to YoshiRi/autoware.universe that referenced this pull request Jan 11, 2023
* fix(ad_api_adaptors): fix to merge waypoint

* fix(ad_api_adaptors): update comments and variable name

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>

Signed-off-by: Takagi, Isamu <isamu.takagi@tier4.jp>
Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants