diff --git a/localization/ekf_localizer/src/ekf_localizer.cpp b/localization/ekf_localizer/src/ekf_localizer.cpp index 3c3c38dcb1561..b39112b1d8d62 100644 --- a/localization/ekf_localizer/src/ekf_localizer.cpp +++ b/localization/ekf_localizer/src/ekf_localizer.cpp @@ -387,7 +387,7 @@ void EKFLocalizer::callbackTwistWithCovariance( { // Ignore twist if velocity is too small. // Note that this inequality must not include "equal". - if (msg->twist.twist.linear.x < params_.threshold_observable_velocity_mps) { + if (std::abs(msg->twist.twist.linear.x) < params_.threshold_observable_velocity_mps) { msg->twist.covariance[0 * 6 + 0] = 10000.0; } twist_queue_.push(msg);