EmbeddedMath

LOGO

A C++ header only linear algebra math library for embedded device.

Purpose:

Bringing a smooth linear algebra development experience, with an Eigen-like interface, even on embedded devices!

Features:

Usage:

By simply aliasing Eigen to EmbeddedMath, you can use the same API as Eigen on microcontrollers with C++ support enabled.

#include <EmbeddedMath.hpp>

namespace Eigen = EmbeddedMath;  // Alias EmbeddedMath to Eigen

int main() {
    // Create a quaternion (w, x, y, z)
    Eigen::Quaternionf q(0.707f, 0.0f, 0.707f, 0.0f);  // 90-degree rotation around the Y axis

    // Convert quaternion to rotation matrix
    Eigen::Matrix3f rotation_matrix = q.toRotationMatrix();

    // Rotate a vector
    Eigen::Vector3f v(1.0f, 0.0f, 0.0f);
    Eigen::Vector3f rotated_v = rotation_matrix * v;

    // Create a transformation matrix
    Eigen::Matrix4f transformation_matrix = Eigen::Matrix4f::Identity();
    transformation_matrix.block<3, 3>(0, 0) = rotation_matrix;

    return 0;
}

Simply drag and drop the EmbeddedMath.hpp file into your project, and you’re all set to get started!

Example:

A typical example of this library is to implement a kalman filter, which can be found at Embedded-ESKF.

Dependencies:

Source:

Source: EmbeddedMath