diff --git a/libraries/AP_HAL_PX4/RCOutput.cpp b/libraries/AP_HAL_PX4/RCOutput.cpp index 23a5270104..64cce64b78 100644 --- a/libraries/AP_HAL_PX4/RCOutput.cpp +++ b/libraries/AP_HAL_PX4/RCOutput.cpp @@ -297,6 +297,12 @@ void PX4RCOutput::_publish_actuators(void) { struct actuator_direct_s actuators; + if (_esc_pwm_min == 0 || + _esc_pwm_max == 0) { + // not initialised yet + return; + } + actuators.nvalues = _max_channel; if (actuators.nvalues > actuators.NUM_ACTUATORS_DIRECT) { actuators.nvalues = actuators.NUM_ACTUATORS_DIRECT; @@ -307,9 +313,14 @@ void PX4RCOutput::_publish_actuators(void) if (actuators.nvalues > 8) { actuators.nvalues = 8; } + bool armed = hal.util->get_soft_armed(); actuators.timestamp = hrt_absolute_time(); for (uint8_t i=0; i