openpilot 0.0.1

Towards fully autonomous driving
Documentation

๐Ÿš— openpilot

Crates.io docs License

openpilot provides functionalities for building and simulating sensor models, GPS sensors, and Extended Kalman Filters (EKF) in Rust. It includes modules for representing sensor readings, simple sensors, GPS sensors, and a fast 1D Extended Kalman Filter (EKF) implementation.

๐Ÿš€ Quick Start

Get started with the openpilot library by following these simple steps:

  1. Install the openpilot crate by adding the following line to your Cargo.toml file:
[dependencies]
openpilot = "0.0.1"
  1. Import the necessary modules and use the provided functionality in your Rust project:
use ndarray::{arr2, Array2, s};
use openpilot::ext_kal_fltr::{SensorReading, SimpleSensor, GPS, EKF, FastEKF1D};

// Example usage
let data = arr2(&[[1.0, 2.0], [3.0, 4.0]]);
let obs_model = arr2(&[[1.0, 0.0], [0.0, 1.0]]);
let covar = arr2(&[[0.1, 0.0], [0.0, 0.1]]);
let sensor_reading = SensorReading::new(data.clone(), obs_model.clone(), covar.clone());

// Create a simple sensor
let simple_sensor = SimpleSensor::new(obs_model.clone(), covar.clone(), 2);
let reading = simple_sensor.read(data.clone(), None);

// Create a GPS sensor
let gps_sensor = GPS::new((0, 1), 2, 0.01);
let latlon = &[37.7749, -122.4194];
let reading = gps_sensor.read(latlon, None);

// Create and use a fast 1D Extended Kalman Filter
let mut fast_ekf_1d = FastEKF1D::new(0.1, 0.01, 0.001);
fast_ekf_1d.update_scalar(&sensor_reading);
fast_ekf_1d.predict(0.1);
let (tf, tfj) = fast_ekf_1d.calc_transfer_fun(0.1);

๐Ÿงช Testing

Run tests for the openpilot crate using:

cargo test

๐ŸŒ GitHub Repository

You can access the source code for the openpilot crate on GitHub.

๐Ÿค Contributing

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.

๐Ÿ“˜ Documentation

Full documentation for openpilot is available on docs.rs.

๐Ÿ“„ License

This project is licensed under the MIT License.