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(autonomous_emergency_braking): check if ego_path is empty #6045

Closed

Conversation

beyzanurkaya
Copy link
Contributor

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.

  • 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.

@github-actions github-actions bot added the component:control Vehicle control algorithms and mechanisms. (auto-assigned) label Jan 10, 2024
@beyzanurkaya beyzanurkaya changed the title Bnk/dev/control dies fix(autonomous_emergency_braking): check if ego_path is empty Jan 10, 2024
@beyzanurkaya beyzanurkaya self-assigned this Jan 10, 2024
Comment on lines +364 to +380
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);
}
Copy link
Member

@ismetatabay ismetatabay Jan 10, 2024

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)

Copy link
Contributor Author

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.

Copy link
Member

@ismetatabay ismetatabay Jan 12, 2024

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

Copy link
Contributor

@tkimura4 tkimura4 Feb 16, 2024

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.

@beyzanurkaya beyzanurkaya added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jan 17, 2024
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

Attention: 231 lines in your changes are missing coverage. Please review.

Comparison is base (39e9acc) 15.25% compared to head (a192456) 15.22%.
Report is 53 commits behind head on main.

Files Patch % Lines
...le_stop_module/src/scene_dynamic_obstacle_stop.cpp 0.00% 82 Missing ⚠️
...elocity_dynamic_obstacle_stop_module/src/debug.cpp 0.00% 39 Missing ⚠️
...ocity_dynamic_obstacle_stop_module/src/manager.cpp 0.00% 26 Missing ⚠️
...ity_dynamic_obstacle_stop_module/src/footprint.cpp 0.00% 25 Missing ⚠️
...amic_obstacle_stop_module/src/object_filtering.cpp 0.00% 25 Missing ⚠️
...ity_dynamic_obstacle_stop_module/src/collision.cpp 0.00% 18 Missing ⚠️
control/autonomous_emergency_braking/src/node.cpp 0.00% 11 Missing ⚠️
...elocity_dynamic_obstacle_stop_module/src/types.hpp 0.00% 3 Missing ⚠️
...ocity_dynamic_obstacle_stop_module/src/manager.hpp 0.00% 2 Missing ⚠️
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              
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 15.23% <0.00%> (-0.03%) ⬇️ Carriedforward from 2a6c16b

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@beyzanurkaya
Copy link
Contributor Author

@tkimura4-san could you review this PR?

@soblin
Copy link
Contributor

soblin commented Feb 16, 2024

@beyzanurkaya @ismetatabay I believe at least this issue is already fixed in #6346. Can you merge/rebase latest branch and them compare ? Thx

@beyzanurkaya
Copy link
Contributor Author

@soblin After I rebased my branch, this problem was solved. I am closing this PR because it is not needed.

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) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

control container dies due to AEB
4 participants