MCPcopy Index your code
hub / github.com/OrlandoQuintana/rust-ekf

github.com/OrlandoQuintana/rust-ekf @v2.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.1.0 ↗ · + Follow
15 symbols 30 edges 3 files 8 documented · 53%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

For a deep dive into this Rust Extended Kalman Filter, read my Medium article here.

How to Use rust-ekf

The rust-ekf library can be used in your Rust projects to implement an Extended Kalman Filter for state estimation. Follow the steps below to integrate it into your project.

Adding rust-ekf as a Dependency

You can include rust-ekf as a dependency in your Cargo.toml by referencing the GitHub repository. Add the following lines to your Cargo.toml:

[dependencies]
rust-ekf = { git = "https://github.com/OrlandoQuintana/rust-ekf" }

This tells Cargo to pull the library directly from the GitHub repository and use it in your project.


Importing rust-ekf into Your Code

To use the library in your Rust code, import the EKF struct at the top of your file.

Example:

use rust_ekf::EKF;

This makes the EKF struct available for use in your code.


Using the rust-ekf Code Locally

If you prefer to clone the rust-ekf repository and use it as a local dependency, follow these steps:

  1. Clone the repository to your local machine:
    git clone https://github.com/OrlandoQuintana/rust-ekf.git
    
    1. Place the cloned repository in a desired location on your computer.
    2. Add the local path to your Cargo.toml dependencies:

      [dependencies] rust-ekf = { path = "../path/to/rust-ekf" } Replace ../path/to/rust-ekf with the actual relative path to the rust-ekf folder.

Example Usage in Your Code

Here’s an example of how you might use the rust-ekf library:

use rust_ekf::EKF;

fn main() {
    // Create a new EKF instance
    let mut ekf = EKF::new();

    // Example gyroscope data (roll rate, pitch rate, yaw rate in rad/s)
    let gyro_data = [0.01, -0.02, 0.03];
    let dt = 0.005;

    // Prediction phase
    ekf.predict(gyro_data, dt);

    // Example accelerometer data (x, y, z acceleration in m/s^2)
    let accel_data = [0.0, 9.81, 0.0];

    // Update phase
    ekf.update(accel_data);

    // Get the updated state vector
    let state = ekf.get_state();
    println!("Updated State Vector: {:?}", state);
}

Core symbols most depended-on inside this repo

get_state
called by 3
src/rust_ekf_quaternion.rs
predict
called by 2
src/rust_ekf_quaternion.rs
lock_yaw
called by 2
src/rust_ekf_quaternion.rs
update
called by 1
src/rust_ekf_quaternion.rs
compute_f_jacobian
called by 1
src/rust_ekf_quaternion.rs
compute_h_jacobian
called by 1
src/rust_ekf_quaternion.rs
remove_yaw_from_quaternion
called by 1
src/rust_ekf_quaternion.rs
new
called by 0
src/rust_ekf_quaternion.rs

Shape

Method 11
Function 3
Class 1

Languages

Rust100%

Modules by API surface

src/rust_ekf_quaternion.rs12 symbols
tests/ekf_tests.rs3 symbols

For agents

$ claude mcp add rust-ekf \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page