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:
Mark Charlebois
2015-04-24 01:39:25 -07:00
parent 187f13cd70
commit a1332e699c
10 changed files with 42 additions and 19 deletions
+5 -4
View File
@@ -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) {
+3 -2
View File
@@ -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;
}
+5 -2
View File
@@ -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;
}