mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-07 02:51:36 +08:00
VTOL: add flap and spoiler support
- including slew rate limiting - adds option to set spoiler setting during the Land phase (hover) Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -109,6 +109,7 @@ VtolAttitudeControl::VtolAttitudeControl() :
|
||||
|
||||
_params_handles.land_pitch_min_rad = param_find("VT_LND_PTCH_MIN");
|
||||
|
||||
_params_handles.vt_spoiler_mc_ld = param_find("VT_SPOILER_MC_LD");
|
||||
/* fetch initial parameter values */
|
||||
parameters_update();
|
||||
|
||||
@@ -372,6 +373,8 @@ VtolAttitudeControl::parameters_update()
|
||||
param_get(_params_handles.mpc_land_alt1, &_params.mpc_land_alt1);
|
||||
param_get(_params_handles.mpc_land_alt2, &_params.mpc_land_alt2);
|
||||
|
||||
param_get(_params_handles.vt_spoiler_mc_ld, &_params.vt_spoiler_mc_ld);
|
||||
|
||||
// update the parameters of the instances of base VtolType
|
||||
if (_vtol_type != nullptr) {
|
||||
_vtol_type->parameters_update();
|
||||
@@ -401,6 +404,7 @@ VtolAttitudeControl::Run()
|
||||
|
||||
#endif // !ENABLE_LOCKSTEP_SCHEDULER
|
||||
|
||||
const float dt = math::min((now - _last_run_timestamp) / 1e6f, kMaxVTOLAttitudeControlTimeStep);
|
||||
_last_run_timestamp = now;
|
||||
|
||||
if (!_initialized) {
|
||||
@@ -415,6 +419,8 @@ VtolAttitudeControl::Run()
|
||||
}
|
||||
}
|
||||
|
||||
_vtol_type->setDt(dt);
|
||||
|
||||
perf_begin(_loop_perf);
|
||||
|
||||
const bool updated_fw_in = _actuator_inputs_fw.update(&_actuators_fw_in);
|
||||
|
||||
Reference in New Issue
Block a user