Skip to content

koledickarlo/ESKF-ESP32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Error-state Kalman Filter for IMU, optical flow and time-of-flight fusion for Arduino and ESP32 MCU

Problem

Goal is to obtain accurate, drift-less estimations of 3D position, velocity and rotation of an autonomous drone, similarly designed as the CrayzFlie drone in the following image:

Drone contains IMU, optical flow (OF) and time-of-flight (ToF) sensors. Due to the nature of IMU noise and bias, trajectories drift without fusion with complementary sensors.

Solution should be real-time and usable on time-constrained Arduino and ESP32 MCUs

Requirements

  • c++17 compiler
  • Eigen (header-only library included in external/ for ease of compilation)

Method

In order to reduce the drift, OF and ToF measuements are fused with the Error-state Kalman Filter. This is a variation of EKF, which propagates nominal states and error-states, which are then updated when OF and ToF measurements arrive. Error-state formulation decreases linearization errors in Jacobian calculation, and allows seamless representation of rotation propagation and update as errors in the $so(3)$ tangent space. Filter implementation is based on the following papares, where you can read more:

ESKF is implemented in ESKF.cpp. Simple estimator reads IMU, OF and ToF measurements from CSV data for testing. To use the repository as a library, simply change CMakeLists to compile a shared or a static library.

Measurements

  • Measurements of simple testing trajectories are provided in serial_data.csv.

Compilation

Compile with:

mkdir build && cd build
cmake ..
make -j8

Execution

Simply provide paths to csv file containing measurements and output file for storing results, e.g.:

./estimator measurements/serial_data.csv results.txt

This will create a results.txt file with positions, velocities and rotations (as quaternions) at each timestamp.

Results

Filter completely eliminates drift due to IMU noise and bias. Left -- IMU dead reckoning. Right -- ESKF.

Estimated positions:

Estimated velocities:

Arduino and ESP32 compatibility

Repository is compatible with Arduino and ESP32-based MCUs. Only requirement is the Eigen library, which can be easily deployed as in:

TODO

  • Adding cross-correlation elements to process noise
  • Adding rotation variance to process noise
  • Adding bias error-states

About

Error-state Kalman filter for fusion of accelerometer, gyroscope, optical flow and time-of-flight measurements for Arduino and ESP32 microcontrollers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors