From 8dd988c733a6feb75d3f85a6c38e4251e3e6b319 Mon Sep 17 00:00:00 2001 From: Balduin Date: Wed, 21 Jan 2026 15:10:06 +0100 Subject: [PATCH] first working draft - produce upward thrust setpoint in vtol_att_control/standard - enable spinning motors by never having allocator stop motors TODO - find if this makes it also use the rotors to allocate torques... - no, only exactly the thrust of 0.1 makes it to all motor outputs - make controllable by param - check logs to find good thrust value --- .../ActuatorEffectivenessStandardVTOL.cpp | 3 ++- src/modules/vtol_att_control/standard.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessStandardVTOL.cpp b/src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessStandardVTOL.cpp index 0b7d3934c1..41a1e0e291 100644 --- a/src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessStandardVTOL.cpp +++ b/src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessStandardVTOL.cpp @@ -102,7 +102,8 @@ void ActuatorEffectivenessStandardVTOL::setFlightPhase(const FlightPhase &flight // update stopped motors switch (flight_phase) { case FlightPhase::FORWARD_FLIGHT: - _stopped_motors_mask |= _upwards_motors_mask; + // _stopped_motors_mask |= _upwards_motors_mask; + _stopped_motors_mask = 0; break; case FlightPhase::HOVER_FLIGHT: diff --git a/src/modules/vtol_att_control/standard.cpp b/src/modules/vtol_att_control/standard.cpp index eac79a88b1..ace1676f84 100644 --- a/src/modules/vtol_att_control/standard.cpp +++ b/src/modules/vtol_att_control/standard.cpp @@ -361,7 +361,17 @@ void Standard::fill_actuator_outputs() _torque_setpoint_1->xyz[2] = _vehicle_torque_setpoint_virtual_fw->xyz[2]; _thrust_setpoint_0->xyz[0] = _vehicle_thrust_setpoint_virtual_fw->xyz[0]; + // simulate toggling some param on and off just to test + const int period_sec = 10; + const int on_sec = 5; + if ((now / 1_s) % period_sec < on_sec) { + _thrust_setpoint_0->xyz[2] = -0.1; + } + + // TODO bypass the off motors mask or whatever in the allocator + // OR do it straight from the allocator? + // ActuatorEffectivenessStandardVTOL::setFlightPhase break; }