From d7b89a2e4a217780a90cee65b3d8cb11a81c9856 Mon Sep 17 00:00:00 2001 From: Huizerd <15855769+Huizerd@users.noreply.github.com> Date: Thu, 16 Dec 2021 13:15:52 +0100 Subject: [PATCH] [dynamics] clamp with collective thrust --- flightlib/src/dynamics/quadrotor_dynamics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flightlib/src/dynamics/quadrotor_dynamics.cpp b/flightlib/src/dynamics/quadrotor_dynamics.cpp index 7a0ca96d8f..394e2ffba1 100644 --- a/flightlib/src/dynamics/quadrotor_dynamics.cpp +++ b/flightlib/src/dynamics/quadrotor_dynamics.cpp @@ -92,7 +92,7 @@ Vector<4> QuadrotorDynamics::clampThrust(const Vector<4> thrusts) const { } Scalar QuadrotorDynamics::clampThrust(const Scalar thrust) const { - return std::clamp(thrust, thrust_min_, thrust_max_); + return std::clamp(thrust, collective_thrust_min() / mass_, collective_thrust_max() / mass_); } Vector<4> QuadrotorDynamics::clampMotorOmega(const Vector<4>& omega) const {