mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 09:14:07 +08:00
VTOL: remove pusher reverse feature
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
parent
c09bf66639
commit
4be74befd2
@ -122,16 +122,12 @@ param set-default VT_TRANS_MIN_TM 15
|
||||
param set-default VT_B_TRANS_DUR 8
|
||||
param set-default VT_FWD_THRUST_SC 4
|
||||
param set-default VT_F_TRANS_DUR 1
|
||||
param set-default VT_B_REV_OUT 0.5
|
||||
param set-default VT_B_TRANS_THR 0.7
|
||||
param set-default VT_TRANS_TIMEOUT 22
|
||||
param set-default VT_F_TRANS_RAMP 4
|
||||
|
||||
param set-default COM_RC_OVERRIDE 0
|
||||
|
||||
|
||||
|
||||
|
||||
param set-default CA_AIRFRAME 2
|
||||
|
||||
param set-default CA_ROTOR_COUNT 5
|
||||
|
||||
@ -348,10 +348,9 @@ MissionBlock::is_mission_item_reached_or_completed()
|
||||
_navigator->get_local_position()->vy * _navigator->get_local_position()->vy);
|
||||
|
||||
const float back_trans_dec = _navigator->get_vtol_back_trans_deceleration();
|
||||
const float reverse_delay = _navigator->get_vtol_reverse_delay();
|
||||
|
||||
if (back_trans_dec > FLT_EPSILON && velocity > FLT_EPSILON) {
|
||||
acceptance_radius = ((velocity / back_trans_dec / 2) * velocity) + reverse_delay * velocity;
|
||||
acceptance_radius = (velocity / back_trans_dec / 2) * velocity;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -314,7 +314,6 @@ public:
|
||||
float get_lndmc_alt_max() const { return _param_lndmc_alt_max.get(); }
|
||||
|
||||
float get_vtol_back_trans_deceleration() const { return _param_back_trans_dec_mss; }
|
||||
float get_vtol_reverse_delay() const { return _param_reverse_delay; }
|
||||
|
||||
bool force_vtol();
|
||||
|
||||
@ -401,12 +400,10 @@ private:
|
||||
NavigatorMode *_navigation_mode_array[NAVIGATOR_MODE_ARRAY_SIZE] {}; /**< array of navigation modes */
|
||||
|
||||
param_t _handle_back_trans_dec_mss{PARAM_INVALID};
|
||||
param_t _handle_reverse_delay{PARAM_INVALID};
|
||||
param_t _handle_mpc_jerk_auto{PARAM_INVALID};
|
||||
param_t _handle_mpc_acc_hor{PARAM_INVALID};
|
||||
|
||||
float _param_back_trans_dec_mss{0.f};
|
||||
float _param_reverse_delay{0.f};
|
||||
float _param_mpc_jerk_auto{4.f}; /**< initialized with the default jerk auto value to prevent division by 0 if the parameter is accidentally set to 0 */
|
||||
float _param_mpc_acc_hor{3.f}; /**< initialized with the default horizontal acc value to prevent division by 0 if the parameter is accidentally set to 0 */
|
||||
|
||||
|
||||
@ -96,7 +96,6 @@ Navigator::Navigator() :
|
||||
}
|
||||
|
||||
_handle_back_trans_dec_mss = param_find("VT_B_DEC_MSS");
|
||||
_handle_reverse_delay = param_find("VT_B_REV_DEL");
|
||||
|
||||
_handle_mpc_jerk_auto = param_find("MPC_JERK_AUTO");
|
||||
_handle_mpc_acc_hor = param_find("MPC_ACC_HOR");
|
||||
@ -127,10 +126,6 @@ void Navigator::params_update()
|
||||
param_get(_handle_back_trans_dec_mss, &_param_back_trans_dec_mss);
|
||||
}
|
||||
|
||||
if (_handle_reverse_delay != PARAM_INVALID) {
|
||||
param_get(_handle_reverse_delay, &_param_reverse_delay);
|
||||
}
|
||||
|
||||
if (_handle_mpc_jerk_auto != PARAM_INVALID) {
|
||||
param_get(_handle_mpc_jerk_auto, &_param_mpc_jerk_auto);
|
||||
}
|
||||
|
||||
@ -76,7 +76,6 @@ void Standard::update_vtol_state()
|
||||
// Failsafe event, engage mc motors immediately
|
||||
_vtol_mode = vtol_mode::MC_MODE;
|
||||
_pusher_throttle = 0.0f;
|
||||
_reverse_output = 0.0f;
|
||||
|
||||
} else if (!_attc->is_fixed_wing_requested()) {
|
||||
|
||||
@ -85,20 +84,17 @@ void Standard::update_vtol_state()
|
||||
// in mc mode
|
||||
_vtol_mode = vtol_mode::MC_MODE;
|
||||
mc_weight = 1.0f;
|
||||
_reverse_output = 0.0f;
|
||||
|
||||
} else if (_vtol_mode == vtol_mode::FW_MODE) {
|
||||
// Regular backtransition
|
||||
resetTransitionStates();
|
||||
_vtol_mode = vtol_mode::TRANSITION_TO_MC;
|
||||
_reverse_output = _param_vt_b_rev_out.get();
|
||||
|
||||
} else if (_vtol_mode == vtol_mode::TRANSITION_TO_FW) {
|
||||
// failsafe back to mc mode
|
||||
_vtol_mode = vtol_mode::MC_MODE;
|
||||
mc_weight = 1.0f;
|
||||
_pusher_throttle = 0.0f;
|
||||
_reverse_output = 0.0f;
|
||||
|
||||
} else if (_vtol_mode == vtol_mode::TRANSITION_TO_MC) {
|
||||
// speed exit condition: use ground if valid, otherwise airspeed
|
||||
@ -250,12 +246,6 @@ void Standard::update_transition_state()
|
||||
|
||||
_pusher_throttle = 0.0f;
|
||||
|
||||
if (_time_since_trans_start >= _param_vt_b_rev_del.get()) {
|
||||
// Handle throttle reversal for active breaking
|
||||
_pusher_throttle = math::constrain((_time_since_trans_start - _param_vt_b_rev_del.get())
|
||||
* _param_vt_psher_slew.get(), 0.0f, _param_vt_b_trans_thr.get());
|
||||
}
|
||||
|
||||
// continually increase mc attitude control as we transition back to mc mode
|
||||
if (_param_vt_b_trans_ramp.get() > FLT_EPSILON) {
|
||||
mc_weight = _time_since_trans_start / _param_vt_b_trans_ramp.get();
|
||||
@ -335,7 +325,6 @@ void Standard::fill_actuator_outputs()
|
||||
fw_out[actuator_controls_s::INDEX_THROTTLE] = _pusher_throttle;
|
||||
fw_out[actuator_controls_s::INDEX_FLAPS] = _flaps_setpoint_with_slewrate.getState();
|
||||
fw_out[actuator_controls_s::INDEX_SPOILERS] = _spoiler_setpoint_with_slewrate.getState();
|
||||
fw_out[actuator_controls_s::INDEX_AIRBRAKES] = _reverse_output;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@ -75,7 +75,6 @@ private:
|
||||
vtol_mode _vtol_mode{vtol_mode::MC_MODE}; /**< vtol flight mode, defined by enum vtol_mode */
|
||||
|
||||
float _pusher_throttle{0.0f};
|
||||
float _reverse_output{0.0f};
|
||||
float _airspeed_trans_blend_margin{0.0f};
|
||||
|
||||
void parameters_update() override;
|
||||
@ -83,9 +82,7 @@ private:
|
||||
DEFINE_PARAMETERS_CUSTOM_PARENT(VtolType,
|
||||
(ParamFloat<px4::params::VT_PSHER_SLEW>) _param_vt_psher_slew,
|
||||
(ParamFloat<px4::params::VT_B_TRANS_RAMP>) _param_vt_b_trans_ramp,
|
||||
(ParamFloat<px4::params::FW_PSP_OFF>) _param_fw_psp_off,
|
||||
(ParamFloat<px4::params::VT_B_REV_OUT>) _param_vt_b_rev_out,
|
||||
(ParamFloat<px4::params::VT_B_REV_DEL>) _param_vt_b_rev_del
|
||||
(ParamFloat<px4::params::FW_PSP_OFF>) _param_fw_psp_off
|
||||
)
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -87,32 +87,6 @@ PARAM_DEFINE_FLOAT(VT_FWD_THRUST_SC, 0.7f);
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(VT_B_TRANS_RAMP, 3.0f);
|
||||
|
||||
/**
|
||||
* Reverse thrust output during back transition
|
||||
*
|
||||
* @min 0
|
||||
* @max 1
|
||||
* @increment 0.01
|
||||
* @decimal 2
|
||||
* @group VTOL Attitude Control
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(VT_B_REV_OUT, 0.0f);
|
||||
|
||||
|
||||
/**
|
||||
* Delay in seconds before applying back transition throttle
|
||||
*
|
||||
* Set this to a value greater than 0 to give the motor time to spin down.
|
||||
*
|
||||
* @unit s
|
||||
* @min 0
|
||||
* @max 10
|
||||
* @increment 1
|
||||
* @decimal 2
|
||||
* @group VTOL Attitude Control
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(VT_B_REV_DEL, 0.0f);
|
||||
|
||||
/**
|
||||
* Pusher throttle ramp up slew rate
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user