PX4 Autopilot Software
Go to file
bresch a685987082 GNSS yaw: unset yaw_align if fusion stops before takeoff
We do not want to rely on a potentially badly initialized heading as it
could lead to a flyaway directly after takeoff

Also remove the resetMagHeading() call from the GPS fusion control logic
as this is properly handled in mag_control.
2021-05-12 08:33:07 +10:00
.github/workflows Auto update change indication by github actions 2020-12-08 18:05:28 -05:00
AlphaFilter AlphaFilter add constructor that takes alpha and use in EKF 2020-12-16 13:55:59 -05:00
EKF GNSS yaw: unset yaw_align if fusion stops before takeoff 2021-05-12 08:33:07 +10:00
airdata WindEstimator: Fix incorrect _state accessing, clarify enums (#906) 2020-09-05 08:48:51 +02:00
docs doxygen cmake and Jenkins support 2018-05-04 01:22:10 -04:00
geo geo: purge old globallocal_converter 2021-03-15 14:43:53 -04:00
geo_lookup Update geo_lookup WMM to latest Sun Mar 28 11:48:06 UTC 2021 2021-03-28 21:22:25 -04:00
mathlib clang-format set BreakBeforeBraces to Linux style 2020-06-25 13:23:52 -04:00
test GNSS yaw: unset yaw_align if fusion stops before takeoff 2021-05-12 08:33:07 +10:00
tools move TECS, L1, and validation to PX4/Firmware 2020-06-18 18:48:36 -04:00
.clang-format clang-format set BreakBeforeBraces to Linux style 2020-06-25 13:23:52 -04:00
.editorconfig Enforce tabs via editorcofig 2020-06-25 08:55:21 -04:00
.gitignore Add airspeed sensor to sensor_simulator 2020-01-14 15:16:25 +03:00
.travis.yml travis-ci basic build script 2018-05-05 15:25:54 -04:00
CMakeLists.txt cmake: respect MAX_CUSTOM_OPT_LEVEL if set 2020-10-27 08:53:58 -04:00
CONTRIBUTING.md Update CONTRIBUTING.md 2020-01-27 10:42:17 +03:00
LICENSE Initial commit 2015-10-26 15:41:25 +01:00
Makefile Auto Formatting with clang-format-6.0 (#727) 2020-01-23 20:56:10 +11:00
README.md README: fix zenodo badge (rename ecl -> PX4-ECL) 2020-12-16 10:47:21 -05:00
ecl.h EKF: Use debug prints for NuttX builds 2021-03-05 19:06:59 -05:00

README.md

ECL

Very lightweight Estimation & Control Library.

DOI

This library solves the estimation & control problems of a number of robots and drones. It accepts GPS, vision and inertial sensor inputs. It is extremely lightweight and efficient and yet has the rugged field-proven performance.

The library is BSD 3-clause licensed.

EKF Documentation

Building EKF

Prerequisites:

By following the steps mentioned below you can create a static library which can be included in projects:

make
// OR
mkdir build/
cd build/
cmake ..
make

Testing ECL

By following the steps you can run the unit tests

make test

Change Indicator / Unit Tests

Change indication is the concept of running the EKF on different data-sets and compare the state of the EKF to a previous version. If a contributor makes a functional change that is run during the change_indication tests, this will produce a different output of the EKF's state. As the tests are run in CI, this checks if a contributor forgot to run the checks themselves and add the new EKF's state outputs to the pull request.

The unit tests include a check to see if the pull request results in a difference to the output data csv file when replaying the sensor data csv file. If a pull request results in an expected difference, then it is important that the output reference file be re-generated and included as part of the pull request. A non-functional pull request should not result in changes to this file, however the default test case does not exercise all sensor types so this test passing is a necessary, but not sufficient requirement for a non-functional pull request.

The functionality that supports this test consists of:

  • Python scripts that extract sensor data from ulog files and writes them to a sensor data csv file. The default sensor data csv file used by the unit test was generated from a ulog created from an iris SITL flight.
  • A script file using functionality provided by the sensor simulator, that loads sensor data from the sensor data csv file , replays the EKF with it and logs the EKF's state and covariance data to the output data csv file.
  • CI action that checks if the logs of the test running with replay data is changing. This helps to see if there are functional changes.

How to run the Change Indicator test during development on your own logs:

  • create sensor_data.csv file from ulog file 'cd test/sensor_simulator/ python3 createSensorDataFile.py <path/to/ulog> ../replay_data/<descriptive_name>.csv'
  • Setup the test file to use the EKF with the created sensor data by copy&paste an existing test case in test/test_EKF_withReplayData.cpp and adapt the paths to load the right sensor data and write it to the right place, eg _sensor_simulator.loadSensorDataFromFile("../../../test/replay_data/<descriptive_name>.csv"); _ekf_logger.setFilePath("../../../test/change_indication/<descriptive_name>.csv");
  • You can feed the EKF with the data in the csv file, by running '_sensor_simulator.runReplaySeconds(duration_in_seconds)'. Be aware that replay sensor data will only be available when the corresponding sensor simulation are running. By default only imu, baro and mag sensor simulators are running. You can start a sensor simulation by calling sensor_simulator..start(). Be also aware that you still have to setup the EKF yourself. This includes setting the bit mask (fusion_mode in common.h) according to what you intend to fuse.
  • In between _sensor_simulator.runReplaySeconds(duration_in_seconds) calls, write the state and covariances to the change_indication file by including a _ekf_logger.writeStateToFile(); line.
  • Run the EKF with your data and all the other tests by running 'make test' from the ecl directory. The default output data csv file changes can then be included in the PR if differences are causing the CI test to fail.

Known Issues

If compiler versions other than GCC 7.5 are used to generate the output data file, then is is possible that the file will cause CI failures due to small numerical differences to file generated by the CI test.