Development Math

LinuxJohannes edited this page Jan 25, 2014 · 1 revision
Clone this wiki locally

Contributing to the math-related flight code

Low-level Math Libraries

Most of the low-level math functions are provided by the CMSIS DSP library.

Note: In order to speed up our builds, not all of the DSP library is included in every build. You can force a full-featured build of the DSP library by building your firmware like this:

make fw_freedom INCLUDE_ALL_DSP=YES

If your new code requires a new part of the DSP Library, you'll need to add the .c file to the list in the makefile used to build the CMSIS library.

Tau Labs Math Libraries

There are also a number of commonly used flight-related math functions provided in the math library.

These math functions are documented.

Unit Tests

Many of the Tau Labs math libraries are now covered by dedicated unit tests. Tests should be written for any new math library functions that you add and can be re-run to verify that any changes you've made still pass all existing tests.

Unit tests currently exist for these libraries:

You can set up your unit test infrastructure like this:

make gtest_install

And then you can run these unit tests like this:

make ut_coordinate_conversions
make ut_misc_math
make ut_sin_lookup

Note: All unit tests must pass before any code submissions will be allowed.

Note: New math functions will require unit tests before being accepted for merge.