From 58b4bc754bbb9f5197119cd0c124e49c05acff46 Mon Sep 17 00:00:00 2001 From: Dawsyn Schraiber <32221234+dawsynth@users.noreply.github.com> Date: Thu, 13 Jun 2024 14:30:58 -0400 Subject: Where to begin…. (#13) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +/- Reworked collection of altimeter related functions into altimeter class +/- Reworked bno055 class to be imu class with minimal functionality \- Removed external Kalman filter implementations in favor of own in house version \- Removed any/unused files \+ Added buffer logger for when sitting on pad for extended period of time in effort to prevent filling of flash chip \+ Added heartbeat LED for alive status --- src/SimpleKalmanFilter.cpp | 48 ---------------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 src/SimpleKalmanFilter.cpp (limited to 'src/SimpleKalmanFilter.cpp') diff --git a/src/SimpleKalmanFilter.cpp b/src/SimpleKalmanFilter.cpp deleted file mode 100644 index 88ba5d4..0000000 --- a/src/SimpleKalmanFilter.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SimpleKalmanFilter - a Kalman Filter implementation for single variable models. - * Created by Denys Sene, January, 1, 2017. - * Released under MIT License - see LICENSE file for details. - */ - -#include "SimpleKalmanFilter.h" -#include - -SimpleKalmanFilter::SimpleKalmanFilter(float mea_e, float est_e, float q) -{ - _err_measure=mea_e; - _err_estimate=est_e; - _q = q; -} - -float SimpleKalmanFilter::updateEstimate(float mea) -{ - _kalman_gain = _err_estimate/(_err_estimate + _err_measure); - _current_estimate = _last_estimate + _kalman_gain * (mea - _last_estimate); - _err_estimate = (1.0f - _kalman_gain)*_err_estimate + fabsf(_last_estimate-_current_estimate)*_q; - _last_estimate=_current_estimate; - - return _current_estimate; -} - -void SimpleKalmanFilter::setMeasurementError(float mea_e) -{ - _err_measure=mea_e; -} - -void SimpleKalmanFilter::setEstimateError(float est_e) -{ - _err_estimate=est_e; -} - -void SimpleKalmanFilter::setProcessNoise(float q) -{ - _q=q; -} - -float SimpleKalmanFilter::getKalmanGain() { - return _kalman_gain; -} - -float SimpleKalmanFilter::getEstimateError() { - return _err_estimate; -} -- cgit v1.2.3