Browse Source

AP_InertialSensor: use mavlink statustext for cal info

zr-v5.1
Andrew Tridgell 4 years ago
parent
commit
2843cfa42d
  1. 10
      libraries/AP_InertialSensor/AP_InertialSensor.cpp
  2. 6
      libraries/AP_InertialSensor/AP_InertialSensor_SITL.cpp

10
libraries/AP_InertialSensor/AP_InertialSensor.cpp

@ -1112,12 +1112,12 @@ bool AP_InertialSensor::_calculate_trim(const Vector3f &accel_sample, float& tri @@ -1112,12 +1112,12 @@ bool AP_InertialSensor::_calculate_trim(const Vector3f &accel_sample, float& tri
trim_roll = atan2f(-accel_sample.y, -accel_sample.z);
if (fabsf(trim_roll) > radians(10) ||
fabsf(trim_pitch) > radians(10)) {
hal.console->printf("trim over maximum of 10 degrees\n");
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "trim over maximum of 10 degrees");
return false;
}
hal.console->printf("Trim OK: roll=%.2f pitch=%.2f\n",
(double)degrees(trim_roll),
(double)degrees(trim_pitch));
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Trim OK: roll=%.2f pitch=%.2f",
(double)degrees(trim_roll),
(double)degrees(trim_pitch));
return true;
}
@ -2199,8 +2199,6 @@ MAV_RESULT AP_InertialSensor::simple_accel_cal() @@ -2199,8 +2199,6 @@ MAV_RESULT AP_InertialSensor::simple_accel_cal()
// flash leds to tell user to keep the IMU still
AP_Notify::flags.initialising = true;
hal.console->printf("Simple accel cal");
/*
we do the accel calibration with no board rotation. This avoids
having to rotate readings during the calibration

6
libraries/AP_InertialSensor/AP_InertialSensor_SITL.cpp

@ -111,7 +111,7 @@ void AP_InertialSensor_SITL::generate_accel() @@ -111,7 +111,7 @@ void AP_InertialSensor_SITL::generate_accel()
float freq_variation = 0.12f;
// add in sensor noise
accel += Vector3f(rand_float(), rand_float(), rand_float()) * accel_noise;
accel += Vector3f{rand_float(), rand_float(), rand_float()} * accel_noise;
bool motors_on = sitl->throttle > sitl->ins_noise_throttle_min;
@ -166,9 +166,7 @@ void AP_InertialSensor_SITL::generate_accel() @@ -166,9 +166,7 @@ void AP_InertialSensor_SITL::generate_accel()
Vector3f centripetal_accel = angular_rate % (angular_rate % pos_offset);
// apply corrections
accel.x += lever_arm_accel.x + centripetal_accel.x;
accel.y += lever_arm_accel.y + centripetal_accel.y;
accel.z += lever_arm_accel.z + centripetal_accel.z;
accel += lever_arm_accel + centripetal_accel;
}
if (fabsf(sitl->accel_fail[accel_instance]) > 1.0e-6f) {

Loading…
Cancel
Save