Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/modules/commander/esc_calibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,13 @@ bool check_battery_disconnected(orb_advert_t *mavlink_log_pub)

const bool recent_battery_measurement = hrt_absolute_time() < (battery_status_sub.get().timestamp + 1_s);

if (!recent_battery_measurement) {
// We have to send this message for now because "battery unavailable" gets ignored by QGC
if (recent_battery_measurement && battery_status_sub.get().connected) {
calibration_log_critical(mavlink_log_pub, CAL_QGC_FAILED_MSG, "Disconnect battery and try again");
return false;
}

// Make sure battery is reported to be disconnected
if (recent_battery_measurement && !battery_status_sub.get().connected) {
} else {
return true;
}

calibration_log_critical(mavlink_log_pub, CAL_QGC_FAILED_MSG, "Disconnect battery and try again");
return false;
}

static void set_motor_actuators(uORB::Publication<actuator_test_s> &publisher, float value, bool release_control)
Expand Down
Loading