diff --git a/mission/controller/acs/Guidance.cpp b/mission/controller/acs/Guidance.cpp index fe0ba4dd..bf834d12 100644 --- a/mission/controller/acs/Guidance.cpp +++ b/mission/controller/acs/Guidance.cpp @@ -460,13 +460,13 @@ void Guidance::targetRotationRate(const int8_t timeElapsedMax, const double time if (VectorOperations::norm(savedQuaternion, 4) == 0) { std::memcpy(savedQuaternion, quatInertialTarget, sizeof(savedQuaternion)); } - if (timeDelta < timeElapsedMax) { + if (timeDelta < timeElapsedMax and timeDelta != 0.0) { double q[4] = {0, 0, 0, 0}, qS[4] = {0, 0, 0, 0}; QuaternionOperations::inverse(quatInertialTarget, q); QuaternionOperations::inverse(savedQuaternion, qS); double qDiff[4] = {0, 0, 0, 0}; VectorOperations::subtract(q, qS, qDiff, 4); - VectorOperations::mulScalar(qDiff, 1 / timeDelta, qDiff, 4); + VectorOperations::mulScalar(qDiff, 1. / timeDelta, qDiff, 4); double tgtQuatVec[3] = {q[0], q[1], q[2]}; double qDiffVec[3] = {qDiff[0], qDiff[1], qDiff[2]};