mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-30 12:40:35 +08:00
QuRT and POSIX changes - part 5
Last part of the main QuRT related changes Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -42,11 +42,12 @@
|
||||
#include "commander_helper.h"
|
||||
|
||||
#include <px4_posix.h>
|
||||
#include <px4_time.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include <string.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <uORB/topics/sensor_combined.h>
|
||||
@@ -193,9 +194,9 @@ int do_gyro_calibration(int mavlink_fd)
|
||||
/* maximum allowable calibration error in radians */
|
||||
const float maxoff = 0.0055f;
|
||||
|
||||
if (!isfinite(gyro_scale[0].x_offset) ||
|
||||
!isfinite(gyro_scale[0].y_offset) ||
|
||||
!isfinite(gyro_scale[0].z_offset) ||
|
||||
if (!PX4_ISFINITE(gyro_scale[0].x_offset) ||
|
||||
!PX4_ISFINITE(gyro_scale[0].y_offset) ||
|
||||
!PX4_ISFINITE(gyro_scale[0].z_offset) ||
|
||||
fabsf(xdiff) > maxoff ||
|
||||
fabsf(ydiff) > maxoff ||
|
||||
fabsf(zdiff) > maxoff) {
|
||||
|
||||
@@ -43,12 +43,13 @@
|
||||
#include "calibration_messages.h"
|
||||
|
||||
#include <px4_posix.h>
|
||||
#include <px4_time.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <poll.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include <fcntl.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <drivers/drv_accel.h>
|
||||
@@ -376,7 +377,7 @@ int mag_calibrate_all(int mavlink_fd, int32_t (&device_ids)[max_mags])
|
||||
&sphere_x[cur_mag], &sphere_y[cur_mag], &sphere_z[cur_mag],
|
||||
&sphere_radius[cur_mag]);
|
||||
|
||||
if (!isfinite(sphere_x[cur_mag]) || !isfinite(sphere_y[cur_mag]) || !isfinite(sphere_z[cur_mag])) {
|
||||
if (!PX4_ISFINITE(sphere_x[cur_mag]) || !PX4_ISFINITE(sphere_y[cur_mag]) || !PX4_ISFINITE(sphere_z[cur_mag])) {
|
||||
mavlink_and_console_log_info(mavlink_fd, "ERROR: NaN in sphere fit for mag #%u", cur_mag);
|
||||
result = ERROR;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
* Remote Control calibration routine
|
||||
*/
|
||||
|
||||
#include <px4_posix.h>
|
||||
#include <px4_time.h>
|
||||
|
||||
#include "rc_calibration.h"
|
||||
#include "commander_helper.h"
|
||||
|
||||
@@ -82,11 +85,11 @@ int do_trim_calibration(int mavlink_fd)
|
||||
|
||||
if (save_ret != 0) {
|
||||
mavlink_log_critical(mavlink_fd, "TRIM: SAVE FAIL");
|
||||
close(sub_man);
|
||||
px4_close(sub_man);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
mavlink_log_info(mavlink_fd, "trim cal done");
|
||||
close(sub_man);
|
||||
px4_close(sub_man);
|
||||
return OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user