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

feat(intersection): consider object velocity direction #4651

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,11 @@ IntersectionModule::DecisionResult IntersectionModule::modifyPathVelocityDetail(
util::isOverTargetIndex(*path, closest_idx, current_pose, pass_judge_line_idx);
const bool is_over_default_stop_line =
util::isOverTargetIndex(*path, closest_idx, current_pose, default_stop_line_idx);
const double vel = std::fabs(planner_data_->current_velocity->twist.linear.x);
const bool keep_detection = (vel < planner_param_.collision_detection.keep_detection_vel_thr);
const double vel_norm = std::hypot(
planner_data_->current_velocity->twist.linear.x,
planner_data_->current_velocity->twist.linear.y);
const bool keep_detection =
(vel_norm < planner_param_.collision_detection.keep_detection_vel_thr);
// if ego is over the pass judge line and not stopped
if (is_peeking_) {
// do nothing
Expand Down Expand Up @@ -871,7 +874,9 @@ IntersectionModule::DecisionResult IntersectionModule::modifyPathVelocityDetail(
target_objects.objects.begin(), target_objects.objects.end(),
std::back_inserter(parked_attention_objects),
[thresh = planner_param_.occlusion.ignore_parked_vehicle_speed_threshold](const auto & object) {
return std::fabs(object.kinematics.initial_twist_with_covariance.twist.linear.x) <= thresh;
return std::hypot(
object.kinematics.initial_twist_with_covariance.twist.linear.x,
object.kinematics.initial_twist_with_covariance.twist.linear.y) <= thresh;
});
const bool is_occlusion_cleared =
(enable_occlusion_detection_ && !occlusion_attention_lanelets.empty() && !tl_arrow_solid_on)
Expand Down
6 changes: 4 additions & 2 deletions planning/behavior_velocity_intersection_module/src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,10 @@ bool checkStuckVehicleInIntersection(
if (!isTargetStuckVehicleType(object)) {
continue; // not target vehicle type
}
const auto obj_v = std::fabs(object.kinematics.initial_twist_with_covariance.twist.linear.x);
if (obj_v > stuck_vehicle_vel_thr) {
const auto obj_v_norm = std::hypot(
object.kinematics.initial_twist_with_covariance.twist.linear.x,
object.kinematics.initial_twist_with_covariance.twist.linear.y);
if (obj_v_norm > stuck_vehicle_vel_thr) {
continue; // not stop vehicle
}

Expand Down