aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-07-15 17:40:04 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-07-15 17:40:04 +0200
commit619433d36911b9c3923bae666d3632beb713935f (patch)
treef6f5babcee1d902bbc91fb862ea1cb00856d5d9e /src/modules
parente91a4217ad23a0f5190b0e34b7621a5170632a43 (diff)
parent61286451361c0e4547caf2385f56ee6cc8afffb1 (diff)
downloadpx4-firmware-619433d36911b9c3923bae666d3632beb713935f.tar.gz
px4-firmware-619433d36911b9c3923bae666d3632beb713935f.tar.bz2
px4-firmware-619433d36911b9c3923bae666d3632beb713935f.zip
Merge pull request #1178 from PX4/eff_plus_plus
C++ with a little more rigor
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp13
-rw-r--r--src/modules/ekf_att_pos_estimator/estimator_utilities.cpp7
-rw-r--r--src/modules/ekf_att_pos_estimator/module.mk2
3 files changed, 19 insertions, 3 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 40cb6043f..b3eb816f9 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
@@ -112,6 +112,10 @@ public:
*/
FixedwingEstimator();
+ /* we do not want people ever copying this class */
+ FixedwingEstimator(const FixedwingEstimator& that) = delete;
+ FixedwingEstimator operator=(const FixedwingEstimator&) = delete;
+
/**
* Destructor, also kills the sensors task.
*/
@@ -371,9 +375,10 @@ FixedwingEstimator::FixedwingEstimator() :
_mag_offsets({}),
#ifdef SENSOR_COMBINED_SUB
- _sensor_combined({}),
+ _sensor_combined{},
#endif
+ _pos_ref{},
_baro_ref(0.0f),
_baro_ref_offset(0.0f),
_baro_gps_offset(0.0f),
@@ -390,12 +395,18 @@ FixedwingEstimator::FixedwingEstimator() :
/* states */
_baro_init(false),
_gps_initialized(false),
+ _gps_start_time(0),
+ _filter_start_time(0),
+ _last_sensor_timestamp(0),
+ _last_run(0),
_gyro_valid(false),
_accel_valid(false),
_mag_valid(false),
_ekf_logging(true),
_debug(0),
_mavlink_fd(-1),
+ _parameters{},
+ _parameter_handles{},
_ekf(nullptr),
_velocity_xy_filtered(0.0f),
_velocity_z_filtered(0.0f),
diff --git a/src/modules/ekf_att_pos_estimator/estimator_utilities.cpp b/src/modules/ekf_att_pos_estimator/estimator_utilities.cpp
index 29a8c8d1e..77cc1eeeb 100644
--- a/src/modules/ekf_att_pos_estimator/estimator_utilities.cpp
+++ b/src/modules/ekf_att_pos_estimator/estimator_utilities.cpp
@@ -45,8 +45,11 @@ void Vector3f::zero(void)
z = 0.0f;
}
-Mat3f::Mat3f() {
- identity();
+Mat3f::Mat3f() :
+ x{1.0f, 0.0f, 0.0f},
+ y{0.0f, 1.0f, 0.0f},
+ z{0.0f, 0.0f, 1.0f}
+{
}
void Mat3f::identity() {
diff --git a/src/modules/ekf_att_pos_estimator/module.mk b/src/modules/ekf_att_pos_estimator/module.mk
index dc5220bf0..36d854ddd 100644
--- a/src/modules/ekf_att_pos_estimator/module.mk
+++ b/src/modules/ekf_att_pos_estimator/module.mk
@@ -41,3 +41,5 @@ SRCS = ekf_att_pos_estimator_main.cpp \
ekf_att_pos_estimator_params.c \
estimator_23states.cpp \
estimator_utilities.cpp
+
+EXTRACXXFLAGS = -Weffc++