|
|
@ -1166,7 +1166,7 @@ AP_InertialSensor::detect_backends(void) |
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_ESP32 |
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_ESP32 |
|
|
|
ADD_BACKEND(AP_InertialSensor_NONE::detect(*this, INS_NONE_SENSOR_A)); |
|
|
|
ADD_BACKEND(AP_InertialSensor_NONE::detect(*this, INS_NONE_SENSOR_A)); |
|
|
|
#else |
|
|
|
#else |
|
|
|
hal.console->printf("INS: unable to initialise driver\n"); |
|
|
|
DEV_PRINTF("INS: unable to initialise driver\n"); |
|
|
|
GCS_SEND_TEXT(MAV_SEVERITY_DEBUG, "INS: unable to initialise driver"); |
|
|
|
GCS_SEND_TEXT(MAV_SEVERITY_DEBUG, "INS: unable to initialise driver"); |
|
|
|
AP_BoardConfig::config_error("INS: unable to initialise driver"); |
|
|
|
AP_BoardConfig::config_error("INS: unable to initialise driver"); |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -1446,7 +1446,7 @@ AP_InertialSensor::_init_gyro() |
|
|
|
AP_Notify::flags.initialising = true; |
|
|
|
AP_Notify::flags.initialising = true; |
|
|
|
|
|
|
|
|
|
|
|
// cold start
|
|
|
|
// cold start
|
|
|
|
hal.console->printf("Init Gyro"); |
|
|
|
DEV_PRINTF("Init Gyro"); |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
we do the gyro calibration with no board rotation. This avoids |
|
|
|
we do the gyro calibration with no board rotation. This avoids |
|
|
@ -1497,7 +1497,7 @@ AP_InertialSensor::_init_gyro() |
|
|
|
|
|
|
|
|
|
|
|
memset(diff_norm, 0, sizeof(diff_norm)); |
|
|
|
memset(diff_norm, 0, sizeof(diff_norm)); |
|
|
|
|
|
|
|
|
|
|
|
hal.console->printf("*"); |
|
|
|
DEV_PRINTF("*"); |
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t k=0; k<num_gyros; k++) { |
|
|
|
for (uint8_t k=0; k<num_gyros; k++) { |
|
|
|
gyro_sum[k].zero(); |
|
|
|
gyro_sum[k].zero(); |
|
|
@ -1550,10 +1550,10 @@ AP_InertialSensor::_init_gyro() |
|
|
|
|
|
|
|
|
|
|
|
// we've kept the user waiting long enough - use the best pair we
|
|
|
|
// we've kept the user waiting long enough - use the best pair we
|
|
|
|
// found so far
|
|
|
|
// found so far
|
|
|
|
hal.console->printf("\n"); |
|
|
|
DEV_PRINTF("\n"); |
|
|
|
for (uint8_t k=0; k<num_gyros; k++) { |
|
|
|
for (uint8_t k=0; k<num_gyros; k++) { |
|
|
|
if (!converged[k]) { |
|
|
|
if (!converged[k]) { |
|
|
|
hal.console->printf("gyro[%u] did not converge: diff=%f dps (expected < %f)\n", |
|
|
|
DEV_PRINTF("gyro[%u] did not converge: diff=%f dps (expected < %f)\n", |
|
|
|
(unsigned)k, |
|
|
|
(unsigned)k, |
|
|
|
(double)ToDeg(best_diff[k]), |
|
|
|
(double)ToDeg(best_diff[k]), |
|
|
|
(double)GYRO_INIT_MAX_DIFF_DPS); |
|
|
|
(double)GYRO_INIT_MAX_DIFF_DPS); |
|
|
@ -2164,7 +2164,7 @@ void AP_InertialSensor::_acal_save_calibrations() |
|
|
|
if (fabsf(_trim_rad.x) > radians(HAL_INS_TRIM_LIMIT_DEG) || |
|
|
|
if (fabsf(_trim_rad.x) > radians(HAL_INS_TRIM_LIMIT_DEG) || |
|
|
|
fabsf(_trim_rad.y) > radians(HAL_INS_TRIM_LIMIT_DEG) || |
|
|
|
fabsf(_trim_rad.y) > radians(HAL_INS_TRIM_LIMIT_DEG) || |
|
|
|
fabsf(_trim_rad.z) > radians(HAL_INS_TRIM_LIMIT_DEG)) { |
|
|
|
fabsf(_trim_rad.z) > radians(HAL_INS_TRIM_LIMIT_DEG)) { |
|
|
|
hal.console->printf("ERR: Trim over maximum of %.1f degrees!!", float(HAL_INS_TRIM_LIMIT_DEG)); |
|
|
|
DEV_PRINTF("ERR: Trim over maximum of %.1f degrees!!", float(HAL_INS_TRIM_LIMIT_DEG)); |
|
|
|
_new_trim = false; //we have either got faulty level during acal or highly misaligned accelerometers
|
|
|
|
_new_trim = false; //we have either got faulty level during acal or highly misaligned accelerometers
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2302,7 +2302,7 @@ MAV_RESULT AP_InertialSensor::simple_accel_cal() |
|
|
|
|
|
|
|
|
|
|
|
memset(diff_norm, 0, sizeof(diff_norm)); |
|
|
|
memset(diff_norm, 0, sizeof(diff_norm)); |
|
|
|
|
|
|
|
|
|
|
|
hal.console->printf("*"); |
|
|
|
DEV_PRINTF("*"); |
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t k=0; k<num_accels; k++) { |
|
|
|
for (uint8_t k=0; k<num_accels; k++) { |
|
|
|
accel_sum[k].zero(); |
|
|
|
accel_sum[k].zero(); |
|
|
@ -2350,7 +2350,7 @@ MAV_RESULT AP_InertialSensor::simple_accel_cal() |
|
|
|
_board_orientation = saved_orientation; |
|
|
|
_board_orientation = saved_orientation; |
|
|
|
|
|
|
|
|
|
|
|
if (result == MAV_RESULT_ACCEPTED) { |
|
|
|
if (result == MAV_RESULT_ACCEPTED) { |
|
|
|
hal.console->printf("\nPASSED\n"); |
|
|
|
DEV_PRINTF("\nPASSED\n"); |
|
|
|
for (uint8_t k=0; k<num_accels; k++) { |
|
|
|
for (uint8_t k=0; k<num_accels; k++) { |
|
|
|
// remove rotated gravity
|
|
|
|
// remove rotated gravity
|
|
|
|
new_accel_offset[k] -= rotated_gravity; |
|
|
|
new_accel_offset[k] -= rotated_gravity; |
|
|
@ -2366,7 +2366,7 @@ MAV_RESULT AP_InertialSensor::simple_accel_cal() |
|
|
|
// force trim to zero
|
|
|
|
// force trim to zero
|
|
|
|
AP::ahrs().set_trim(Vector3f(0, 0, 0)); |
|
|
|
AP::ahrs().set_trim(Vector3f(0, 0, 0)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
hal.console->printf("\nFAILED\n"); |
|
|
|
DEV_PRINTF("\nFAILED\n"); |
|
|
|
// restore old values
|
|
|
|
// restore old values
|
|
|
|
for (uint8_t k=0; k<num_accels; k++) { |
|
|
|
for (uint8_t k=0; k<num_accels; k++) { |
|
|
|
_accel_offset[k] = saved_offsets[k]; |
|
|
|
_accel_offset[k] = saved_offsets[k]; |
|
|
|