forked from Archive/PX4-Autopilot
FlightTaskManualStabilized: allow attitude control with 0 throttle
With minimum throttle set to 0, it was not possible to control the attitude anymore at 0 throttle, the vehicle would just stay level.
This commit is contained in:
parent
b93d02aee7
commit
afada8ddb5
|
@ -123,9 +123,10 @@ void FlightTaskManualStabilized::_updateThrustSetpoints()
|
||||||
|
|
||||||
/* The final thrust setpoint is found by rotating the scaled unit vector pointing
|
/* The final thrust setpoint is found by rotating the scaled unit vector pointing
|
||||||
* upward by the Axis-Angle.
|
* upward by the Axis-Angle.
|
||||||
|
* Make sure that the attitude can be controlled even at 0 throttle.
|
||||||
*/
|
*/
|
||||||
Quatf q_sp = AxisAnglef(v(0), v(1), 0.0f);
|
Quatf q_sp = AxisAnglef(v(0), v(1), 0.0f);
|
||||||
_thrust_setpoint = q_sp.conjugate(Vector3f(0.0f, 0.0f, -1.0f)) * _throttle;
|
_thrust_setpoint = q_sp.conjugate(Vector3f(0.0f, 0.0f, -1.0f)) * math::max(_throttle, 0.0001f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlightTaskManualStabilized::_rotateIntoHeadingFrame(Vector2f &v)
|
void FlightTaskManualStabilized::_rotateIntoHeadingFrame(Vector2f &v)
|
||||||
|
|
Loading…
Reference in New Issue