diff --git a/ROMFS/px4fmu_common/init.d/airframes/13013_deltaquad b/ROMFS/px4fmu_common/init.d/airframes/13013_deltaquad index 1448257981..08790de1ca 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/13013_deltaquad +++ b/ROMFS/px4fmu_common/init.d/airframes/13013_deltaquad @@ -31,6 +31,8 @@ param set-default BAT1_R_INTERNAL 0.0025 param set-default CBRK_AIRSPD_CHK 162128 param set-default CBRK_IO_SAFETY 22027 +param set-default COM_FW_PERM_STAB 1 + param set-default EKF2_GPS_POS_X -0.12 param set-default EKF2_IMU_POS_X -0.12 param set-default EKF2_TAU_VEL 0.5 @@ -131,7 +133,6 @@ param set-default VT_F_TRANS_DUR 1 param set-default VT_IDLE_PWM_MC 1025 param set-default VT_B_REV_OUT 0.5 param set-default VT_B_TRANS_THR 0.7 -param set-default VT_FW_PERM_STAB 1 param set-default VT_TRANS_TIMEOUT 22 param set-default VT_F_TRANS_RAMP 4 diff --git a/msg/vehicle_status.msg b/msg/vehicle_status.msg index 6c92ae83fd..47515c5df2 100644 --- a/msg/vehicle_status.msg +++ b/msg/vehicle_status.msg @@ -75,7 +75,6 @@ uint8 vehicle_type # Type of vehicle (fixed-wing, rotary wing, ground) bool is_vtol # True if the system is VTOL capable bool is_vtol_tailsitter # True if the system performs a 90° pitch down rotation during transition from MC to FW -bool vtol_fw_permanent_stab # True if VTOL should stabilize attitude for fw in manual mode bool in_transition_mode # True if VTOL is doing a transition bool in_transition_to_fw # True if VTOL is doing a transition from MC to FW diff --git a/msg/vtol_vehicle_status.msg b/msg/vtol_vehicle_status.msg index 7bc79768b5..05591fd49b 100644 --- a/msg/vtol_vehicle_status.msg +++ b/msg/vtol_vehicle_status.msg @@ -11,4 +11,3 @@ bool vtol_in_rw_mode # true: vtol vehicle is in rotating wing mode bool vtol_in_trans_mode bool in_transition_to_fw # True if VTOL is doing a transition from MC to FW bool vtol_transition_failsafe # vtol in transition failsafe mode -bool fw_permanent_stab # In fw mode stabilize attitude even if in manual mode diff --git a/src/lib/parameters/param_translation.cpp b/src/lib/parameters/param_translation.cpp index d024a303b9..7e2b1eb632 100644 --- a/src/lib/parameters/param_translation.cpp +++ b/src/lib/parameters/param_translation.cpp @@ -174,6 +174,14 @@ bool param_modify_on_import(bson_node_t node) if (strcmp("IMU_GYRO_NF_BW", node->name) == 0) { strcpy(node->name, "IMU_GYRO_NF0_BW"); PX4_INFO("copying %s -> %s", "IMU_GYRO_NF_BW", "IMU_GYRO_NF0_BW"); + } + } + + // 2022-01-20: translate VT_FW_PERM_STAB to COM_FW_PERM_STAB + { + if (strcmp("VT_FW_PERM_STAB", node->name) == 0) { + strcpy(node->name, "COM_FW_PERM_STAB"); + PX4_INFO("copying %s -> %s", "VT_FW_PERM_STAB", "COM_FW_PERM_STAB"); return true; } } diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index c62266be03..6e18f7a100 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -2232,7 +2232,6 @@ Commander::run() if (_vtol_vehicle_status_sub.updated()) { /* vtol status changed */ _vtol_vehicle_status_sub.copy(&_vtol_status); - _status.vtol_fw_permanent_stab = _vtol_status.fw_permanent_stab; /* Make sure that this is only adjusted if vehicle really is of type vtol */ if (is_vtol(_status)) { @@ -3449,11 +3448,9 @@ Commander::update_control_mode() bool Commander::stabilization_required() { - return (_status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING || // is a rotary wing, or - _status.vtol_fw_permanent_stab || // is a VTOL in fixed wing mode and stabilisation is on, or - (_vtol_status.vtol_in_trans_mode && // is currently a VTOL transitioning AND - _status.vehicle_type == - vehicle_status_s::VEHICLE_TYPE_FIXED_WING)); // is a fixed wing, ie: transitioning back to rotary wing mode + // is a rotary-wing or fixed-wing/VTOL in fixed-wing mode and stabilistion is on + return (_status.vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING || + _param_com_fw_perm_stab.get()); } void diff --git a/src/modules/commander/Commander.hpp b/src/modules/commander/Commander.hpp index 62a3b43b7c..2b85b5919e 100644 --- a/src/modules/commander/Commander.hpp +++ b/src/modules/commander/Commander.hpp @@ -227,6 +227,7 @@ private: // Quadchute (ParamInt) _param_com_qc_act, + (ParamBool) _param_com_fw_perm_stab, // Offboard (ParamFloat) _param_com_of_loss_t, diff --git a/src/modules/commander/commander_params.c b/src/modules/commander/commander_params.c index d2e672ea25..d0b261e8ee 100644 --- a/src/modules/commander/commander_params.c +++ b/src/modules/commander/commander_params.c @@ -1077,3 +1077,15 @@ PARAM_DEFINE_INT32(COM_ARM_SDCARD, 1); * @unit m/s */ PARAM_DEFINE_FLOAT(COM_WIND_WARN, -1.f); + +/** + * Permanent stabilization in fixed-wing mode + * + * If set to true this parameter will cause permanent attitude stabilization + * for fixed-wing planes or VTOLs in fixed-wing mode. + * This parameter has been introduced for pure convenience sake. + * + * @boolean + * @group Commander + */ +PARAM_DEFINE_INT32(COM_FW_PERM_STAB, 0); diff --git a/src/modules/vtol_att_control/vtol_att_control_main.cpp b/src/modules/vtol_att_control/vtol_att_control_main.cpp index 5e0af42ca8..527a8fc544 100644 --- a/src/modules/vtol_att_control/vtol_att_control_main.cpp +++ b/src/modules/vtol_att_control/vtol_att_control_main.cpp @@ -235,8 +235,6 @@ VtolAttitudeControl::parameters_update() if (_vtol_type != nullptr) { _vtol_type->parameters_update(); } - - _vtol_vehicle_status.fw_permanent_stab = _param_vt_fw_perm_stab.get(); } void diff --git a/src/modules/vtol_att_control/vtol_att_control_main.h b/src/modules/vtol_att_control/vtol_att_control_main.h index 3af35dcdb7..c4e759ee70 100644 --- a/src/modules/vtol_att_control/vtol_att_control_main.h +++ b/src/modules/vtol_att_control/vtol_att_control_main.h @@ -230,7 +230,6 @@ private: void parameters_update(); DEFINE_PARAMETERS( - (ParamInt) _param_vt_type, - (ParamBool) _param_vt_fw_perm_stab + (ParamInt) _param_vt_type ) }; diff --git a/src/modules/vtol_att_control/vtol_att_control_params.c b/src/modules/vtol_att_control/vtol_att_control_params.c index 2a3e1c0284..76b2a43ea6 100644 --- a/src/modules/vtol_att_control/vtol_att_control_params.c +++ b/src/modules/vtol_att_control/vtol_att_control_params.c @@ -51,17 +51,6 @@ */ PARAM_DEFINE_INT32(VT_IDLE_PWM_MC, 900); -/** - * Permanent stabilization in fw mode - * - * If set to one this parameter will cause permanent attitude stabilization in fw mode. - * This parameter has been introduced for pure convenience sake. - * - * @boolean - * @group VTOL Attitude Control - */ -PARAM_DEFINE_INT32(VT_FW_PERM_STAB, 0); - /** * VTOL Type (Tailsitter=0, Tiltrotor=1, Standard=2) *