Skip to content

Commit e331079

Browse files
sfuhrerbkueng
authored andcommitted
tiltrotor: limmit the adapted thrust for tilt to [0,1]
Signed-off-by: Silvan Fuhrer <[email protected]>
1 parent a26e914 commit e331079

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modules/vtol_att_control/tiltrotor.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ float Tiltrotor::thrust_compensation_for_tilt()
401401
compensated_tilt = compensated_tilt < 0.0f ? 0.0f : compensated_tilt;
402402
compensated_tilt = compensated_tilt > 0.5f ? 0.5f : compensated_tilt;
403403

404-
return _v_att_sp->thrust_body[2] / cosf(compensated_tilt * M_PI_2_F);
404+
// increase vertical thrust by 1/cos(tilt), limmit to [0,1]
405+
return math::constrain(_v_att_sp->thrust_body[2] / cosf(compensated_tilt * M_PI_2_F), 0.0f, 1.0f);
405406

406407
}

0 commit comments

Comments
 (0)