preflight check: more self explanatory code

This commit is contained in:
Balduin
2025-02-17 17:46:39 +01:00
parent 761810884e
commit ad42a5b2f9
@@ -502,16 +502,18 @@ void ControlAllocator::preflight_check_overwrite_torque_sp(matrix::Vector<float,
// for now, no collective tilt if tiltrotor. will need to look a bit different.
int max_phase = 3 * 2;
// is this the proper way to do it?
// bool tiltrotor = _effectiveness_source_id == EffectivenessSource::TILTROTOR_VTOL;
bool tiltrotor = dynamic_cast<ActuatorEffectivenessTiltrotorVTOL*>(_actuator_effectiveness) != nullptr;
int n_axes = 3;
if (tiltrotor) {
max_phase = 4 * 2;
n_axes = 4;
}
int max_phase = 2 * n_axes;
hrt_abstime now = hrt_absolute_time();
if (now - _last_preflight_check_update >= 500_ms) {
_preflight_check_phase++;