Crate openpilot

source ·
Expand description


openpilot is a Rust crate that provides functionalities related to autonomous driving and sensor fusion. This crate includes modules for working with sensor readings, simple sensors, GPS sensors, and an implementation of a 1D Extended Kalman Filter (EKF). These components are designed to be used in the development of autonomous vehicle systems and sensor fusion applications.


openpilot is organized into several modules, each serving a specific purpose:

  • SensorReading: Represents a sensor reading with observed data, observation model, and covariance matrix.

  • SimpleSensor: Represents a simple sensor with an observation model and covariance matrix.

  • GPS: Represents a GPS sensor with specific parameters for position calculations.

  • EKF Trait: Defines a trait for Extended Kalman Filter (EKF) functionality.

  • FastEKF1D: Represents a fast 1D Extended Kalman Filter (EKF) implementation.


To use the openpilot crate in your project, add the following line to your Cargo.toml file:

openpilot = "0.0.4"

Then, you can import the necessary modules and use the provided functionalities in your code.


use openpilot::common::ext_kal_fltr::{EKF, FastEKF1D, SensorReading};
use ndarray::{arr2, arr1};

// Create a FastEKF1D instance
let mut fast_ekf_1d = FastEKF1D::new(0.1, 0.01, 0.001);

// Create a sensor reading
let reading = SensorReading::new(arr2(&[[1.0]]), arr2(&[[0.1]]), arr2(&[[0.01]]));

// Update the FastEKF1D with the sensor reading

// Access the updated state and covariance
let updated_state = fast_ekf_1d.state;
let updated_covar = fast_ekf_1d.covar;

// Perform other operations as needed
// ...


Contributions and feedback are welcome! If you’d like to contribute, report an issue, or suggest an enhancement, please engage with the project on GitHub. Your contributions help improve this crate for the community.


This project is licensed under the MIT License.