Skip to content

Commit

Permalink
fix(map_based_prediction): fix reversed vehicle prediction (tier4#1057)
Browse files Browse the repository at this point in the history
Signed-off-by: yutaka <[email protected]>
  • Loading branch information
purewater0901 authored and boyali committed Jul 1, 2022
1 parent 7ddd9b6 commit 66ae70b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,12 @@ bool MapBasedPredictionNode::checkCloseLaneletCondition(

// Step4. Check if the closest lanelet is valid, and add all
// of the lanelets that are below max_dist and max_delta_yaw
const double object_vel = object.kinematics.twist_with_covariance.twist.linear.x;
const bool is_yaw_reversed =
M_PI - delta_yaw_threshold_for_searching_lanelet_ < abs_norm_delta && object_vel < 0.0;
if (
lanelet.first < dist_threshold_for_searching_lanelet_ &&
(M_PI - delta_yaw_threshold_for_searching_lanelet_ < abs_norm_delta ||
abs_norm_delta < delta_yaw_threshold_for_searching_lanelet_)) {
(is_yaw_reversed || abs_norm_delta < delta_yaw_threshold_for_searching_lanelet_)) {
return true;
}

Expand Down

0 comments on commit 66ae70b

Please sign in to comment.