Addressed C99 compiler issues of initializing variables in header and unused included statements.

This commit is contained in:
waltjohnson
2016-05-19 09:58:18 -06:00
parent f5e2dabc2b
commit 7c158aa59b
7 changed files with 23 additions and 15 deletions
+3
View File
@@ -57,6 +57,9 @@
#endif
const float Ekf::_k_earth_rate = 0.000072921f;
const float Ekf::_gravity_mss = 9.80665f;
Ekf::Ekf():
_filter_initialised(false),
_earth_rate_initialised(false),
+2 -2
View File
@@ -133,8 +133,8 @@ public:
private:
static const uint8_t _k_num_states = 24;
const float _k_earth_rate = 0.000072921f;
const float _gravity_mss = 9.80665f;
static const float _k_earth_rate;
static const float _gravity_mss;
float _dt_ekf_avg; // average update rate of the ekf
+1 -1
View File
@@ -226,7 +226,7 @@ void EstimatorInterface::setRangeData(uint64_t time_usec, float *data)
}
if (time_usec - _time_last_range > 45000) {
rangeSample range_sample_new;
rangeSample range_sample_new = {};
range_sample_new.rng = *data;
rng = *data;
range_sample_new.time_us -= _params.range_delay_ms * 1000;
+5 -5
View File
@@ -260,11 +260,11 @@ protected:
bool _imu_updated; // true if the ekf should update (completed downsampling process)
bool _initialised; // true if the ekf interface instance (data buffering) is initialized
bool _NED_origin_initialised = false;
bool _gps_speed_valid = false;
float _gps_origin_eph = 0.0f; // horizontal position uncertainty of the GPS origin
float _gps_origin_epv = 0.0f; // vertical position uncertainty of the GPS origin
struct map_projection_reference_s _pos_ref = {}; // Contains WGS-84 position latitude and longitude (radians)
bool _NED_origin_initialised;
bool _gps_speed_valid;
float _gps_origin_eph; // horizontal position uncertainty of the GPS origin
float _gps_origin_epv; // vertical position uncertainty of the GPS origin
struct map_projection_reference_s _pos_ref; // Contains WGS-84 position latitude and longitude (radians)
bool _mag_healthy; // computed by mag innovation test
bool _airspeed_healthy; // computed by airspeed innovation test
+3 -2
View File
@@ -42,8 +42,8 @@
* @author Anton Babushkin <anton.babushkin@me.com>
*/
#ifdef POSIX_SHARED
#include <unistd.h>
#include <pthread.h>
//#include <unistd.h>
//#include <pthread.h>
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
@@ -95,6 +95,7 @@
*
*/
#include <stdint.h>
#include "geo.h"
/** set this always to the sampling in degrees for the table below */
+1 -1
View File
@@ -56,7 +56,7 @@ float max(float val1, float val2)
return (val1 > val2) ? val1 : val2;
}
float constrain(float &val, float min, float max)
float constrain(float val, float min, float max)
{
return (val < min) ? min : ((val > max) ? max : val);
}
+8 -4
View File
@@ -41,18 +41,22 @@
#ifndef MATHLIB_H
#define MATHLIB_H
#ifdef POSIX_SHARED
#include <Eigen/Dense>
#include <algorithm>
// #include <Eigen/Dense>
// #include <algorithm>
#define M_PI_F 3.14159265358979323846f
#ifndef M_PI
#define M_PI (3.14159265358979323846f)
#endif
namespace math
{
using namespace Eigen;
// using namespace Eigen;
using namespace std;
float min(float val1, float val2);
float max(float val1, float val2);
float constrain(float &val, float min, float max);
float constrain(float val, float min, float max);
float radians(float degrees);
float degrees(float radians);