aboutsummaryrefslogtreecommitdiff
path: root/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-06-29 11:27:09 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-06-29 11:27:09 +0200
commit336fc2fcf5020f296ec760ca44c2c706b57c61ec (patch)
treeabb050a833cb2c080dcc118961cc769b26b68e85 /src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
parent0a78206d71f4c008fdad3a1170ab2bf7904548ed (diff)
downloadpx4-firmware-336fc2fcf5020f296ec760ca44c2c706b57c61ec.tar.gz
px4-firmware-336fc2fcf5020f296ec760ca44c2c706b57c61ec.tar.bz2
px4-firmware-336fc2fcf5020f296ec760ca44c2c706b57c61ec.zip
Fix compile warnings in estimator
Diffstat (limited to 'src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp')
-rw-r--r--src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp b/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
index 987b4f1c3..e4f805dc0 100644
--- a/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
+++ b/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp
@@ -49,11 +49,11 @@
#include <math.h>
#include <poll.h>
#include <time.h>
-#include <drivers/drv_hrt.h>
+#include <float.h>
#define SENSOR_COMBINED_SUB
-
+#include <drivers/drv_hrt.h>
#include <drivers/drv_gyro.h>
#include <drivers/drv_accel.h>
#include <drivers/drv_mag.h>
@@ -146,7 +146,7 @@ public:
*
* @param debug Desired debug level - 0 to disable.
*/
- int set_debuglevel(unsigned debug) { _debug = debug; }
+ int set_debuglevel(unsigned debug) { _debug = debug; return 0; }
private:
@@ -1256,9 +1256,9 @@ FixedwingEstimator::task_main()
float gps_dt = (_gps.timestamp_position - last_gps) / 1e6f;
// Calculate acceleration predicted by GPS velocity change
- if ((_ekf->velNED[0] != _gps.vel_n_m_s ||
- _ekf->velNED[1] != _gps.vel_e_m_s ||
- _ekf->velNED[2] != _gps.vel_d_m_s) && (gps_dt > 0.00001f)) {
+ if (((fabsf(_ekf->velNED[0] - _gps.vel_n_m_s) > FLT_EPSILON) ||
+ (fabsf(_ekf->velNED[1] - _gps.vel_e_m_s) > FLT_EPSILON) ||
+ (fabsf(_ekf->velNED[2] - _gps.vel_d_m_s) > FLT_EPSILON)) && (gps_dt > 0.00001f)) {
_ekf->accelGPSNED[0] = (_ekf->velNED[0] - _gps.vel_n_m_s) / gps_dt;
_ekf->accelGPSNED[1] = (_ekf->velNED[1] - _gps.vel_e_m_s) / gps_dt;