From 670c6ca0191be3028d27cf2703ff4c51be161281 Mon Sep 17 00:00:00 2001 From: Roman Bapst Date: Mon, 6 Jun 2016 09:40:32 +0200 Subject: [PATCH] change state reset information interface for more convenient handling on firmware side --- EKF/ekf.h | 14 ++++++++++---- EKF/estimator_interface.h | 6 +++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/EKF/ekf.h b/EKF/ekf.h index 88237bd3f3..35f7b2589e 100644 --- a/EKF/ekf.h +++ b/EKF/ekf.h @@ -134,15 +134,21 @@ class Ekf : public EstimatorInterface void get_velD_reset(float *delta, uint8_t *counter) {*delta = _state_reset_status.velD_change; *counter = _state_reset_status.velD_counter;} // return the amount the local horizontal position changed in the last reset and the number of reset events - void get_posNE_reset(Vector2f *delta, uint8_t *counter) {*delta = _state_reset_status.posNE_change; *counter = _state_reset_status.posNE_counter;} + void get_posNE_reset(float delta[2], uint8_t *counter){ + memcpy(delta, &_state_reset_status.posNE_change._data[0], sizeof(_state_reset_status.posNE_change._data)); + *counter = _state_reset_status.posNE_counter; + } // return the amount the local horizontal velocity changed in the last reset and the number of reset events - void get_velNE_reset(Vector2f *delta, uint8_t *counter) {*delta = _state_reset_status.velNE_change; *counter = _state_reset_status.velNE_counter;} + void get_velNE_reset(float delta[2], uint8_t *counter) { + memcpy(delta, &_state_reset_status.velNE_change._data[0], sizeof(_state_reset_status.velNE_change._data)); + *counter = _state_reset_status.velNE_counter; + } // return the amount the quaternion has changed in the last reset and the number of reset events - void get_quat_reset(Quaternion *delta, uint8_t *counter) + void get_quat_reset(float delta_quat[4], uint8_t *counter) { - *delta = _state_reset_status.quat_change; + memcpy(delta_quat, &_state_reset_status.quat_change._data[0], sizeof(_state_reset_status.quat_change._data)); *counter = _state_reset_status.quat_counter; } diff --git a/EKF/estimator_interface.h b/EKF/estimator_interface.h index 34d8bc8596..4fc0a5b736 100644 --- a/EKF/estimator_interface.h +++ b/EKF/estimator_interface.h @@ -224,13 +224,13 @@ class EstimatorInterface virtual void get_velD_reset(float *delta, uint8_t *counter) = 0; // return the amount the local horizontal position changed in the last reset and the number of reset events - virtual void get_posNE_reset(Vector2f *delta, uint8_t *counter) = 0; + virtual void get_posNE_reset(float delta[2], uint8_t *counter) = 0; // return the amount the local horizontal velocity changed in the last reset and the number of reset events - virtual void get_velNE_reset(Vector2f *delta, uint8_t *counter) = 0; + virtual void get_velNE_reset(float delta[2], uint8_t *counter) = 0; // return the amount the quaternion has changed in the last reset and the number of reset events - virtual void get_quat_reset(Quaternion *delta, uint8_t *counter) = 0; + virtual void get_quat_reset(float delta_quat[4], uint8_t *counter) = 0; // get EKF innovation consistency check status virtual void get_innovation_test_status(uint16_t *val)