mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-09 19:01:37 +08:00
VTOL: rename VT_ELEV_MC_LOCK to VT_MC_CS_LOCK
It doesn't only lock elevons but all kind of control surfaces, so lets have the param name generic (CS for control surface) Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -255,5 +255,14 @@ bool param_modify_on_import(bson_node_t node)
|
||||
}
|
||||
}
|
||||
|
||||
// 2022-07-18: translate VT_ELEV_MC_LOCK->VT_MC_CS_LOCK
|
||||
{
|
||||
if (strcmp("VT_ELEV_MC_LOCK", node->name) == 0) {
|
||||
strcpy(node->name, "VT_MC_CS_LOCK");
|
||||
PX4_INFO("copying %s -> %s", "VT_ELEV_MC_LOCK", "VT_MC_CS_LOCK");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -644,7 +644,7 @@ mixer:
|
||||
label: 'Trim'
|
||||
parameters:
|
||||
- label: 'Lock control surfaces in hover'
|
||||
name: VT_ELEV_MC_LOCK
|
||||
name: VT_MC_CS_LOCK
|
||||
|
||||
3: # Tiltrotor VTOL
|
||||
title: 'Tiltrotor VTOL'
|
||||
@@ -685,7 +685,7 @@ mixer:
|
||||
label: 'Trim'
|
||||
parameters:
|
||||
- label: 'Lock control surfaces in hover'
|
||||
name: VT_ELEV_MC_LOCK
|
||||
name: VT_MC_CS_LOCK
|
||||
- actuator_type: 'servo'
|
||||
group_label: 'Tilt Servos'
|
||||
count: 'CA_SV_TL_COUNT'
|
||||
@@ -738,7 +738,7 @@ mixer:
|
||||
label: 'Trim'
|
||||
parameters:
|
||||
- label: 'Lock control surfaces in hover'
|
||||
name: VT_ELEV_MC_LOCK
|
||||
name: VT_MC_CS_LOCK
|
||||
|
||||
5: # Rover (Ackermann)
|
||||
title: 'Rover (Ackermann)'
|
||||
|
||||
@@ -341,9 +341,9 @@ void Standard::fill_actuator_outputs()
|
||||
mc_out[actuator_controls_s::INDEX_LANDING_GEAR] = landing_gear_s::GEAR_DOWN;
|
||||
|
||||
// FW out = 0, other than roll and pitch depending on elevon lock
|
||||
fw_out[actuator_controls_s::INDEX_ROLL] = _param_vt_elev_mc_lock.get() ? 0 :
|
||||
fw_out[actuator_controls_s::INDEX_ROLL] = _param_vt_mc_cs_lock.get() ? 0 :
|
||||
fw_in[actuator_controls_s::INDEX_ROLL];
|
||||
fw_out[actuator_controls_s::INDEX_PITCH] = _param_vt_elev_mc_lock.get() ? 0 :
|
||||
fw_out[actuator_controls_s::INDEX_PITCH] = _param_vt_mc_cs_lock.get() ? 0 :
|
||||
fw_in[actuator_controls_s::INDEX_PITCH];
|
||||
fw_out[actuator_controls_s::INDEX_YAW] = 0;
|
||||
fw_out[actuator_controls_s::INDEX_THROTTLE] = _pusher_throttle;
|
||||
|
||||
@@ -358,7 +358,7 @@ void Tailsitter::fill_actuator_outputs()
|
||||
mc_out[actuator_controls_s::INDEX_LANDING_GEAR] = landing_gear_s::GEAR_UP;
|
||||
}
|
||||
|
||||
if (_param_vt_elev_mc_lock.get() && _vtol_schedule.flight_mode == vtol_mode::MC_MODE) {
|
||||
if (_param_vt_mc_cs_lock.get() && _vtol_schedule.flight_mode == vtol_mode::MC_MODE) {
|
||||
fw_out[actuator_controls_s::INDEX_ROLL] = 0;
|
||||
fw_out[actuator_controls_s::INDEX_PITCH] = 0;
|
||||
|
||||
|
||||
@@ -518,7 +518,7 @@ void Tiltrotor::fill_actuator_outputs()
|
||||
// Fixed wing output
|
||||
fw_out[actuator_controls_s::INDEX_COLLECTIVE_TILT] = _tilt_control;
|
||||
|
||||
if (_param_vt_elev_mc_lock.get() && _vtol_schedule.flight_mode == vtol_mode::MC_MODE) {
|
||||
if (_param_vt_mc_cs_lock.get() && _vtol_schedule.flight_mode == vtol_mode::MC_MODE) {
|
||||
fw_out[actuator_controls_s::INDEX_ROLL] = 0;
|
||||
fw_out[actuator_controls_s::INDEX_PITCH] = 0;
|
||||
fw_out[actuator_controls_s::INDEX_YAW] = 0;
|
||||
|
||||
@@ -73,7 +73,7 @@ PARAM_DEFINE_INT32(VT_TYPE, 0);
|
||||
* @boolean
|
||||
* @group VTOL Attitude Control
|
||||
*/
|
||||
PARAM_DEFINE_INT32(VT_ELEV_MC_LOCK, 1);
|
||||
PARAM_DEFINE_INT32(VT_MC_CS_LOCK, 1);
|
||||
|
||||
/**
|
||||
* Duration of a front transition
|
||||
|
||||
@@ -274,7 +274,7 @@ protected:
|
||||
float _dt{0.0025f}; // time step [s]
|
||||
|
||||
DEFINE_PARAMETERS_CUSTOM_PARENT(ModuleParams,
|
||||
(ParamBool<px4::params::VT_ELEV_MC_LOCK>) _param_vt_elev_mc_lock,
|
||||
(ParamBool<px4::params::VT_MC_CS_LOCK>) _param_vt_mc_cs_lock,
|
||||
(ParamFloat<px4::params::VT_FW_MIN_ALT>) _param_vt_fw_min_alt,
|
||||
(ParamFloat<px4::params::VT_FW_ALT_ERR>) _param_vt_fw_alt_err,
|
||||
(ParamInt<px4::params::VT_FW_QC_P>) _param_vt_fw_qc_p,
|
||||
|
||||
Reference in New Issue
Block a user