-
Notifications
You must be signed in to change notification settings - Fork 682
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(crosswalk): dyanmic timeout for no intention to walk decision #5188
feat(crosswalk): dyanmic timeout for no intention to walk decision #5188
Conversation
double InterpolateMap( | ||
const std::vector<double> & key_map, const std::vector<double> & value_map, const double query) | ||
{ | ||
// If the speed is out of range of the key_map, apply zero-order hold. | ||
if (query <= key_map.front()) { | ||
return value_map.front(); | ||
} | ||
if (query >= key_map.back()) { | ||
return value_map.back(); | ||
} | ||
|
||
// Apply linear interpolation | ||
for (size_t i = 0; i < key_map.size() - 1; ++i) { | ||
if (key_map.at(i) <= query && query <= key_map.at(i + 1)) { | ||
auto ratio = (query - key_map.at(i)) / std::max(key_map.at(i + 1) - key_map.at(i), 1.0e-5); | ||
ratio = std::clamp(ratio, 0.0, 1.0); | ||
const auto interp = value_map.at(i) + ratio * (value_map.at(i + 1) - value_map.at(i)); | ||
return interp; | ||
} | ||
} | ||
|
||
std::cerr << "Crosswalk's InterpolateMap interpolation logic is broken." | ||
"Please check the code." | ||
<< std::endl; | ||
return value_map.back(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from here
autoware.universe/control/mpc_lateral_controller/src/mpc.cpp
Lines 739 to 772 in b32f8ef
VectorXd MPC::calcSteerRateLimitOnTrajectory( | |
const MPCTrajectory & trajectory, const double current_velocity) const | |
{ | |
const auto interp = [&](const auto & steer_rate_limit_map, const auto & current) { | |
std::vector<double> reference, limits; | |
for (const auto & p : steer_rate_limit_map) { | |
reference.push_back(p.first); | |
limits.push_back(p.second); | |
} | |
// If the speed is out of range of the reference, apply zero-order hold. | |
if (current <= reference.front()) { | |
return limits.front(); | |
} | |
if (current >= reference.back()) { | |
return limits.back(); | |
} | |
// Apply linear interpolation | |
for (size_t i = 0; i < reference.size() - 1; ++i) { | |
if (reference.at(i) <= current && current <= reference.at(i + 1)) { | |
auto ratio = | |
(current - reference.at(i)) / std::max(reference.at(i + 1) - reference.at(i), 1.0e-5); | |
ratio = std::clamp(ratio, 0.0, 1.0); | |
const auto interp = limits.at(i) + ratio * (limits.at(i + 1) - limits.at(i)); | |
return interp; | |
} | |
} | |
std::cerr << "MPC::calcSteerRateLimitOnTrajectory() interpolation logic is broken. Command " | |
"filter is not working. Please check the code." | |
<< std::endl; | |
return reference.back(); | |
}; |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #5188 +/- ##
==========================================
- Coverage 14.77% 14.77% -0.01%
==========================================
Files 1636 1636
Lines 113635 113649 +14
Branches 34932 34940 +8
==========================================
Hits 16793 16793
- Misses 78001 78013 +12
- Partials 18841 18843 +2
*This pull request uses carry forward flags. Click here to find out more.
☔ View full report in Codecov by Sentry. |
7da6bec
to
67c3962
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
67c3962
to
1e81da2
Compare
…utowarefoundation#5188) * feat(crosswalk): dyanmic timeout for no intention to walk decision Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * update config Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * update Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * update config Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
…utowarefoundation#5188) (#902) feat(crosswalk): dyanmic timeout for no intention to walk decision (autowarefoundation#5188) * feat(crosswalk): dyanmic timeout for no intention to walk decision * update config * update * update config --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
…utowarefoundation#5188) (#902) feat(crosswalk): dyanmic timeout for no intention to walk decision (autowarefoundation#5188) * feat(crosswalk): dyanmic timeout for no intention to walk decision * update config * update * update config --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Description
Currently, the timeout parameter to decide if the pedestrian has the intention to walk to the crosswalk is constant.
In order not to be too conservative, this parameter should depend on the distance from the pedestrian to the crosswalk.
This PR implements the feature.
Tests performed
psim
scenario sim: https://evaluation.tier4.jp/evaluation/reports/18915c07-9a27-5ffc-8a34-5394fd2b4f2b?project_id=prd_jt
Effects on system behavior
nothing
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.
After all checkboxes are checked, anyone who has write access can merge the PR.