mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-08 10:50:19 +08:00
Commander: Provide better calibration errors
This commit is contained in:
@@ -520,15 +520,15 @@ calibrate_return mag_calibrate_all(int mavlink_fd, int32_t (&device_ids)[max_mag
|
||||
&sphere_radius[cur_mag]);
|
||||
|
||||
if (!PX4_ISFINITE(sphere_x[cur_mag]) || !PX4_ISFINITE(sphere_y[cur_mag]) || !PX4_ISFINITE(sphere_z[cur_mag])) {
|
||||
mavlink_and_console_log_critical(mavlink_fd, "[cal] ERROR: NaN in sphere fit mag, #%u", cur_mag);
|
||||
mavlink_and_console_log_emergency(mavlink_fd, "ERROR: Retry calibration (sphere NaN, #%u)", cur_mag);
|
||||
result = calibrate_return_error;
|
||||
}
|
||||
|
||||
if (sqrtf(sphere_x[cur_mag] * sphere_x[cur_mag] +
|
||||
sphere_y[cur_mag] * sphere_y[cur_mag] + sphere_z[cur_mag] * sphere_z[cur_mag])
|
||||
> MAG_MAX_OFFSET_LEN) {
|
||||
mavlink_and_console_log_critical(mavlink_fd, "[cal] ERROR: Excessive offset mag, #%u", cur_mag);
|
||||
mavlink_and_console_log_critical(mavlink_fd, "[cal] Offsets: %8.4f,%8.4f,%8.4f", sphere_x[cur_mag],
|
||||
mavlink_and_console_log_emergency(mavlink_fd, "ERROR: Replace board, fault in mag #%u", cur_mag);
|
||||
mavlink_and_console_log_emergency(mavlink_fd, "Offsets: %8.4f, %8.4f, %8.4f", sphere_x[cur_mag],
|
||||
sphere_y[cur_mag], sphere_z[cur_mag]);
|
||||
result = calibrate_return_error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user