mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
mag cal, scaling of throttle
This commit is contained in:
@@ -306,8 +306,8 @@ void do_mag_calibration(int status_pub, struct vehicle_status_s *status)
|
||||
calibration_counter++;
|
||||
} else {
|
||||
/* any poll failure for 1s is a reason to abort */
|
||||
mavlink_log_info(mavlink_fd, "[commander] mag calibration aborted, please retry.");
|
||||
break;
|
||||
//mavlink_log_info(mavlink_fd, "[commander] mag calibration aborted, please retry.");
|
||||
//break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,9 +376,9 @@ void do_mag_calibration(int status_pub, struct vehicle_status_s *status)
|
||||
printf("\nFINAL:\nmag min: %d\t%d\t%d\nmag max: %d\t%d\t%d\n", (int)min_avg[0], (int)min_avg[1], (int)min_avg[2], (int)max_avg[0], (int)max_avg[1], (int)max_avg[2]);
|
||||
|
||||
float mag_offset[3];
|
||||
mag_offset[0] = (max_avg[0] - min_avg[0])/2;
|
||||
mag_offset[1] = (max_avg[1] - min_avg[1])/2;
|
||||
mag_offset[2] = (max_avg[2] - min_avg[2])/2;
|
||||
mag_offset[0] = (max_avg[0] - min_avg[0]);
|
||||
mag_offset[1] = (max_avg[1] - min_avg[1]);
|
||||
mag_offset[2] = (max_avg[2] - min_avg[2]);
|
||||
|
||||
global_data_parameter_storage->pm.param_values[PARAM_SENSOR_MAG_XOFFSET] = mag_offset[0];
|
||||
global_data_parameter_storage->pm.param_values[PARAM_SENSOR_MAG_YOFFSET] = mag_offset[1];
|
||||
|
||||
Reference in New Issue
Block a user