Giter VIP home page Giter VIP logo

altitudekf's Introduction

AltitudeKF

A linear Kalman filter estimating altitude and vertical velocity by doing sensor fusion of acceleration and any altitude measurement sensor such as e.g. barometer or SONAR.

Instantiate by calling:

Altitude_KF alt_estimator(ALT_KF_Q_ACCEL, ALT_KF_R_PT);

Where ALT_KF_Q_ACCEL is the covariance of your accelerometer measurement, and ALT_KF_R_PT is your altitude measurement (in this case PT refers to pressure transducer). I have played around with values around 0.1 for both parameters, but a higher value for the acceleration covariance is probably needed if you have a lot of vibrations in your application.

Then, generally speaking, accelerometers can be sampled at a much higher frequency than e.g. a pressure sensor. For every accelerometer measurement you call:

alt_estimator.propagate(accel_vertical - EARTH_GRAVITY, dt);

Where accel_vertical is the vertical acceleration in the Earth frame (positive direction towards zenith). Earth gravity is whatever acceleration mother Earth pulls your system with (e.g. 9.80665 m/s^2). Last parameter is the sampling interval.

Whenever you have an altitude measurement you call:

alt_estimator.update(altitude);

Another note on vibrations and the accelerometer measurement. I often pre-filter the measurements with a low-pass filter, some would argue that you shall tune your KF accordingly. However, I find it very hard to see what the covariance parameters exactly does in the frequency domain. I personally find it much easier to just put my measurements through an IIR filter if there are any frequencies that needs to be rejected. Engineering and theory don't always play well together.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.