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(occlusion spot): consider object velocity direction #4650

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 @@ -186,15 +186,19 @@
bool isStuckVehicle(const PredictedObject & obj, const double min_vel)
{
if (!isVehicle(obj)) return false;
const auto & obj_vel = obj.kinematics.initial_twist_with_covariance.twist.linear.x;
return std::abs(obj_vel) <= min_vel;
const auto & obj_vel_norm = std::hypot(
obj.kinematics.initial_twist_with_covariance.twist.linear.x,
obj.kinematics.initial_twist_with_covariance.twist.linear.y);
return obj_vel_norm <= min_vel;

Check warning on line 192 in planning/behavior_velocity_occlusion_spot_module/src/occlusion_spot_utils.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_velocity_occlusion_spot_module/src/occlusion_spot_utils.cpp#L189-L192

Added lines #L189 - L192 were not covered by tests
}

bool isMovingVehicle(const PredictedObject & obj, const double min_vel)
{
if (!isVehicle(obj)) return false;
const auto & obj_vel = obj.kinematics.initial_twist_with_covariance.twist.linear.x;
return std::abs(obj_vel) > min_vel;
const auto & obj_vel_norm = std::hypot(
obj.kinematics.initial_twist_with_covariance.twist.linear.x,
obj.kinematics.initial_twist_with_covariance.twist.linear.y);
return obj_vel_norm > min_vel;

Check warning on line 201 in planning/behavior_velocity_occlusion_spot_module/src/occlusion_spot_utils.cpp

View check run for this annotation

Codecov / codecov/patch

planning/behavior_velocity_occlusion_spot_module/src/occlusion_spot_utils.cpp#L198-L201

Added lines #L198 - L201 were not covered by tests
}

std::vector<PredictedObject> extractVehicles(
Expand Down
Loading