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(map_based_prediction): fix reversed vehicle prediction #1057

Merged
Merged
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 @@ -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