From 37201fb0713760f5d669108ff15609513ae9a7d2 Mon Sep 17 00:00:00 2001 From: kamilritz Date: Tue, 21 Jan 2020 14:50:39 +0100 Subject: [PATCH] Remove legacy imu interface --- EKF/common.h | 2 +- EKF/estimator_interface.cpp | 13 ------------- EKF/estimator_interface.h | 2 -- test/sensor_simulator/mag.cpp | 4 +--- 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/EKF/common.h b/EKF/common.h index e9a3667599..8c4b2d7de9 100644 --- a/EKF/common.h +++ b/EKF/common.h @@ -67,7 +67,7 @@ struct gps_message { float epv; ///< GPS vertical position accuracy in m float sacc; ///< GPS speed accuracy in m/s float vel_m_s; ///< GPS ground speed (m/sec) - Vector3f vel_ned; ///< GPS ground speed NED - TODO: make Vector3f + Vector3f vel_ned; ///< GPS ground speed NED bool vel_ned_valid; ///< GPS ground speed is valid uint8_t nsats; ///< number of satellites used float pdop; ///< position dilution of precision diff --git a/EKF/estimator_interface.cpp b/EKF/estimator_interface.cpp index c3b203bb15..5d5e89c44a 100644 --- a/EKF/estimator_interface.cpp +++ b/EKF/estimator_interface.cpp @@ -123,21 +123,8 @@ bool EstimatorInterface::checkIfVehicleAtRest(float dt) } } -void EstimatorInterface::setIMUData(uint64_t time_usec, uint64_t delta_ang_dt, uint64_t delta_vel_dt, - float (&delta_ang)[3], float (&delta_vel)[3]) -{ - imuSample imu_sample_new; - imu_sample_new.delta_ang = Vector3f(delta_ang); - imu_sample_new.delta_vel = Vector3f(delta_vel); void EstimatorInterface::setMagData(const magSample &mag_sample) - imu_sample_new.delta_ang_dt = delta_ang_dt / 1e6f; - imu_sample_new.delta_vel_dt = delta_vel_dt / 1e6f; - imu_sample_new.time_us = time_usec; - - setIMUData(imu_sample_new); -} - { if (!_initialised || _mag_buffer_fail) { return; diff --git a/EKF/estimator_interface.h b/EKF/estimator_interface.h index 06a03154b0..c520e2516b 100644 --- a/EKF/estimator_interface.h +++ b/EKF/estimator_interface.h @@ -174,8 +174,6 @@ public: void setIMUData(const imuSample &imu_sample); - // legacy interface for compatibility (2018-09-14) - void setIMUData(uint64_t time_usec, uint64_t delta_ang_dt, uint64_t delta_vel_dt, float (&delta_ang)[3], float (&delta_vel)[3]); void setMagData(const magSample &mag_sample); diff --git a/test/sensor_simulator/mag.cpp b/test/sensor_simulator/mag.cpp index c5a9744d98..3665feffc9 100644 --- a/test/sensor_simulator/mag.cpp +++ b/test/sensor_simulator/mag.cpp @@ -15,9 +15,7 @@ Mag::~Mag() void Mag::send(uint64_t time) { - magSample mag_sample; - mag_sample.mag = _mag_data; - mag_sample.time_us = time; + const magSample mag_sample {_mag_data, time}; _ekf->setMagData(mag_sample); }