Skip to content

Commit f13f354

Browse files
authored
feat(map_based_prediction): fix object flipping via update function (#6083)
feat: fix object flipping via update function Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
1 parent 7917330 commit f13f354

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

perception/map_based_prediction/src/map_based_prediction_node.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,13 @@ void MapBasedPredictionNode::updateObjectData(TrackedObject & object)
13091309
// assumption: the object vx is much larger than vy
13101310
if (object.kinematics.twist_with_covariance.twist.linear.x >= 0.0) return;
13111311

1312+
// calculate absolute velocity and do nothing if it is too slow
1313+
const double abs_object_speed = std::hypot(
1314+
object.kinematics.twist_with_covariance.twist.linear.x,
1315+
object.kinematics.twist_with_covariance.twist.linear.y);
1316+
constexpr double min_abs_speed = 1e-1; // 0.1 m/s
1317+
if (abs_object_speed < min_abs_speed) return;
1318+
13121319
switch (object.kinematics.orientation_availability) {
13131320
case autoware_auto_perception_msgs::msg::DetectedObjectKinematics::SIGN_UNKNOWN: {
13141321
const auto original_yaw =

0 commit comments

Comments
 (0)