diff --git a/src/modules/simulation/gz_bridge/GZGimbal.cpp b/src/modules/simulation/gz_bridge/GZGimbal.cpp index 2d7ed9e069..451f846563 100644 --- a/src/modules/simulation/gz_bridge/GZGimbal.cpp +++ b/src/modules/simulation/gz_bridge/GZGimbal.cpp @@ -240,6 +240,11 @@ float GZGimbal::computeJointSetpoint(const float att_stp, const float rate_stp, { if (PX4_ISFINITE(rate_stp)) { + if (math::abs_t(rate_stp) < FLT_EPSILON) { + // Handle zero velocity by sending the last target angle + return last_stp; + } + const float rate_diff = dt * rate_stp; const float stp_from_rate = last_stp + rate_diff;