mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-08 06:50:35 +08:00
tiltrotor: limmit the adapted thrust for tilt to [0,1]
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -401,6 +401,7 @@ float Tiltrotor::thrust_compensation_for_tilt()
|
||||
compensated_tilt = compensated_tilt < 0.0f ? 0.0f : compensated_tilt;
|
||||
compensated_tilt = compensated_tilt > 0.5f ? 0.5f : compensated_tilt;
|
||||
|
||||
return _v_att_sp->thrust_body[2] / cosf(compensated_tilt * M_PI_2_F);
|
||||
// increase vertical thrust by 1/cos(tilt), limmit to [0,1]
|
||||
return math::constrain(_v_att_sp->thrust_body[2] / cosf(compensated_tilt * M_PI_2_F), 0.0f, 1.0f);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user