mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
Allow new modes for forward thrust
This commit is contained in:
committed by
Daniel Agar
parent
1b8a3079e6
commit
a8a9832b59
@@ -53,6 +53,8 @@
|
||||
* @value 2 Enable FW forward actuation in hover in altitude, position and auto modes if above MPC_LAND_ALT1.
|
||||
* @value 3 Enable FW forward actuation in hover in altitude, position and auto modes if above MPC_LAND_ALT2.
|
||||
* @value 4 Enable FW forward actuation in hover in altitude, position and auto modes.
|
||||
* @value 5 Enable FW forward actuation in hover in altitude, position and auto modes if above MPC_LAND_ALT1 (except LANDING).
|
||||
* @value 6 Enable FW forward actuation in hover in altitude, position and auto modes if above MPC_LAND_ALT2 (except LANDING).
|
||||
*
|
||||
* @group VTOL Attitude Control
|
||||
*/
|
||||
|
||||
@@ -497,6 +497,26 @@ float VtolType::pusher_assist()
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ENABLE_ABOVE_MPC_LAND_ALT1_WITHOUT_LAND: // disable if below MPC_LAND_ALT1 or in land mode
|
||||
if ((_attc->get_pos_sp_triplet()->current.valid
|
||||
&& _attc->get_pos_sp_triplet()->current.type == position_setpoint_s::SETPOINT_TYPE_LAND
|
||||
&& _v_control_mode->flag_control_auto_enabled) ||
|
||||
(!PX4_ISFINITE(dist_to_ground) || (dist_to_ground < _params->mpc_land_alt1))) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ENABLE_ABOVE_MPC_LAND_ALT2_WITHOUT_LAND: // disable if below MPC_LAND_ALT2 or in land mode
|
||||
if ((_attc->get_pos_sp_triplet()->current.valid
|
||||
&& _attc->get_pos_sp_triplet()->current.type == position_setpoint_s::SETPOINT_TYPE_LAND
|
||||
&& _v_control_mode->flag_control_auto_enabled) ||
|
||||
(!PX4_ISFINITE(dist_to_ground) || (dist_to_ground < _params->mpc_land_alt2))) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,9 @@ enum VtolForwardActuationMode {
|
||||
ENABLE_WITHOUT_LAND,
|
||||
ENABLE_ABOVE_MPC_LAND_ALT1,
|
||||
ENABLE_ABOVE_MPC_LAND_ALT2,
|
||||
ENABLE_ALL_MODES
|
||||
ENABLE_ALL_MODES,
|
||||
ENABLE_ABOVE_MPC_LAND_ALT1_WITHOUT_LAND,
|
||||
ENABLE_ABOVE_MPC_LAND_ALT2_WITHOUT_LAND
|
||||
};
|
||||
|
||||
// these are states that can be applied to a selection of multirotor motors.
|
||||
|
||||
Reference in New Issue
Block a user