Skip to content

Commit

Permalink
feat(occlusion spot): consider object velocity direction (autowarefou…
Browse files Browse the repository at this point in the history
…ndation#4650)

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
  • Loading branch information
takayuki5168 authored Aug 17, 2023
1 parent 2da561f commit 420af00
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,19 @@ bool isVehicle(const PredictedObject & obj)
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;
}

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;
}

std::vector<PredictedObject> extractVehicles(
Expand Down

0 comments on commit 420af00

Please sign in to comment.