Remove upward motor handling again

While in VehicleThrustSetpoint.msg we define the NaN = turn off motors
convention for all directions, there is not really a use case for
turning off upwards motors _due to low thrust_.

Either we do it only for forward which is actually used, or we revert
this but also introduce it for sideways rotors so all crazy vehicles
could work.
This commit is contained in:
Balduin 2026-02-18 14:19:27 +01:00
parent 6032cf16ca
commit caacd69d7e
2 changed files with 0 additions and 16 deletions

View File

@ -212,10 +212,6 @@ public:
stopped_motors_mask |= _forwards_motors_mask;
}
if (_upwards_motors_stopped_by_thrust) {
stopped_motors_mask |= _upwards_motors_mask;
}
// They can also be stopped in the ControlAllocator, due to
// motor failure. The difference is that the stopped mask in the
// allocator applies after the slew rate, and the mask here
@ -235,11 +231,6 @@ public:
_forwards_motors_stopped_by_thrust = stopped;
}
virtual void setUpwardsMotorsStoppedByThrust(bool stopped)
{
_upwards_motors_stopped_by_thrust = stopped;
}
protected:
uint32_t _upwards_motors_mask{};
uint32_t _forwards_motors_mask{};
@ -248,5 +239,4 @@ protected:
uint32_t _stopped_motors_mask_due_to_flight_phase{0};
bool _forwards_motors_stopped_by_thrust{false};
bool _upwards_motors_stopped_by_thrust{false};
};

View File

@ -399,21 +399,15 @@ ControlAllocator::Run()
// As defined in VehicleThrustSetpoint.msg, a thrust of NaN means stopping the motor.
// No sideways motors implemented for now...
const bool stop_forwards_motors = std::isnan(_thrust_sp(0));
const bool stop_upwards_motors = std::isnan(_thrust_sp(2));
// also only if it is actually about motors....
_actuator_effectiveness->setForwardsMotorsStoppedByThrust(stop_forwards_motors);
_actuator_effectiveness->setUpwardsMotorsStoppedByThrust(stop_upwards_motors);
// Now that the intent of stopping motors is stored, transform
// NaN to 0 to represent physical thrust again
if (stop_forwards_motors) {
_thrust_sp(0) = 0.f;
}
if (stop_upwards_motors) {
_thrust_sp(2) = 0.f;
}
}
if (do_update) {