mirror of https://github.com/ArduPilot/ardupilot
GCS_Mavlink: allow setting of AHRS_TRIM_Z
This commit is contained in:
parent
3715ce6d1a
commit
5dcfa95444
|
@ -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…
Reference in New Issue