-
Notifications
You must be signed in to change notification settings - Fork 673
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(autonomous_emergency_braking): check if ego_path is empty #6045
fix(autonomous_emergency_braking): check if ego_path is empty #6045
Conversation
Signed-off-by: beyza <[email protected]>
Signed-off-by: beyza <[email protected]>
double current_x = 0.0; | ||
double current_y = 0.0; | ||
double current_yaw = 0.0; | ||
const double current_w = angular_velocity_ptr_->z; | ||
// calculate RSS | ||
const auto current_p = tier4_autoware_utils::createPoint( | ||
ego_path[0].position.x, ego_path[0].position.y, ego_path[0].position.z); | ||
geometry_msgs::msg::Pose current_p; | ||
constexpr double epsilon = 1e-6; | ||
const double & dt = imu_prediction_time_interval_; | ||
const double & horizon = imu_prediction_time_horizon_; | ||
for (double t = 0.0; t < horizon + epsilon; t += dt) { | ||
current_x = current_x + current_v * std::cos(current_yaw) * dt; | ||
current_y = current_y + current_v * std::sin(current_yaw) * dt; | ||
current_yaw = current_yaw + current_w * dt; | ||
|
||
current_p.position = tier4_autoware_utils::createPoint(current_x, current_y, 0.0); | ||
current_p.orientation = tier4_autoware_utils::createQuaternionFromYaw(current_yaw); | ||
} |
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.
Thank you for the PR 👍 ! I believe there's no need for an implementation like this. This function is invoked when using the calculated predicted path (output of control) without relying on the IMU. Additionally, AEB can check for collisions with either the IMU or Control. Therefore, I think it's enough to:
if (ego_path.empty()) {
RCLCPP_ERROR_STREAM(get_logger(), "[AEB] ego_path is empty");
return false;
}
This situation occurs when ego goes off lanelet2 map. (This is not releated with AEB)
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.
What I want to do here is to minimize the effect of ego_path on the calculation of other variables, and even if the path is not generated, EGO will still have a current pose. Of course, this current pose will not be useful for any calculations.
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.
@tkimura4 -san Can you check this PR when you available? Thanks in advance
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.
@ismetatabay
Sorry for the delayed response.
I believe there's no need for an implementation like this.
I agree with this.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #6045 +/- ##
==========================================
- Coverage 15.25% 15.22% -0.03%
==========================================
Files 1759 1767 +8
Lines 121475 121703 +228
Branches 37020 37020
==========================================
Hits 18534 18534
- Misses 82129 82357 +228
Partials 20812 20812
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@tkimura4-san could you review this PR? |
@beyzanurkaya @ismetatabay I believe at least this issue is already fixed in #6346. Can you merge/rebase latest branch and them compare ? Thx |
@soblin After I rebased my branch, this problem was solved. I am closing this PR because it is not needed. |
Description
fixes: #6043
Tests performed
aeb-ego-path-empty.mp4
Effects on system behavior
Not applicable.
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.