Browse Source

GCS_Mavlink: allow setting of AHRS_TRIM_Z

gps-1.3.1
Andrew Tridgell 4 years ago
parent
commit
5dcfa95444
  1. 6
      libraries/GCS_MAVLink/GCS_Common.cpp

6
libraries/GCS_MAVLink/GCS_Common.cpp

@ -3776,12 +3776,12 @@ MAV_RESULT GCS_MAVLINK::_handle_command_preflight_calibration(const mavlink_comm @@ -3776,12 +3776,12 @@ MAV_RESULT GCS_MAVLINK::_handle_command_preflight_calibration(const mavlink_comm
if (!calibrate_gyros()) {
return MAV_RESULT_FAILED;
}
float trim_roll, trim_pitch;
if (!AP::ins().calibrate_trim(trim_roll, trim_pitch)) {
Vector3f trim_rad = AP::ahrs().get_trim();
if (!AP::ins().calibrate_trim(trim_rad)) {
return MAV_RESULT_FAILED;
}
// reset ahrs's trim to suggested values from calibration routine
AP::ahrs().set_trim(Vector3f(trim_roll, trim_pitch, 0));
AP::ahrs().set_trim(trim_rad);
return MAV_RESULT_ACCEPTED;
}

Loading…
Cancel
Save