Towards fully autonomous driving (WIP)

Overview

πŸš— openpilot

Crates.io docs License

openpilot is a comprehensive Rust crate designed to assist in building fully autonomous vehicles. The primary focus of this crate is to provide tools for constructing and simulating sensor models, and GPS sensors, and implementing Extended Kalman Filters (EKF). The library includes modules tailored for managing sensor readings, simple sensors, GPS sensors, and features a high-performance 1D Extended Kalman Filter (EKF) implementation.

In addition to these foundational functionalities, openpilot introduces the selfdrive package. This package is specifically designed for autonomous vehicle control, providing modules and structs that facilitate object tracking, cluster management, and detailed lead vehicle analysis.

πŸ¦€ Why Rust?

I Like Yo Cut G!

Python is mostly Kids Oriented Programming (KOP)!

Choosing Rust for openpilot is like strapping a jet engine to your autonomous vehicle's code. Rust brings a level of memory safety and concurrency control that turns potential coding nightmares into a serene drive through bug-free landscapes. With its high-performance 1D Extended Kalman Filter and modules tailored for sensor management and autonomous control, openpilot in Rust isn't just a toolbox; it's the James Bond of autonomous vehicle development. So, why Rust? Because when your code is navigating the streets, you want a language that won't just drive, it'll drive with the precision of a surgical robot and the reliability of a Swiss watch. Welcome to the fast lane of autonomy, where Rust is the steering wheel that ensures you reach your destination, bug-free and in style.

✨ Features

  • Autonomous Vehicle: The selfdrive package introduces modules and structs designed for autonomous vehicle control. This includes functionalities for object tracking, cluster management, and detailed lead vehicle analysis. These tools are crucial components for building a fully autonomous system.

Peak Auto Pilot Momentum

Look! My Honda is driving by itself!

  • Sensor Models: Easily construct and simulate sensor models with the flexibility to customize observation models and covariance matrices.

  • Simple Sensors: Create and utilize simple sensors for efficient data processing, allowing seamless integration into your autonomous system.

  • GPS Sensors: Implement GPS sensors with accurate readings, supporting latitude and longitude coordinates for precise location tracking.

  • 1D Extended Kalman Filter (EKF): Leverage the fast and efficient 1D EKF implementation for robust state estimation and tracking applications.

πŸš€ 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.4"
  1. Import the necessary modules and use the provided functionality in your Rust project:
use ndarray::arr2;
use openpilot::common::ext_kal_fltr::{SensorReading, SimpleSensor, GPS, EKF, FastEKF1D};
use openpilot::selfdrive::controls::radar_helpers::{Track, Cluster, Lead};

fn main() {
    // 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);
    println!("Simple Sensor Reading: {:?}", reading);

    // 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);
    println!("GPS Sensor Reading: {:?}", reading);

    // 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);
    println!("EKF Transfer Function: {:?}, Jacobian: {:?}", tf, tfj);

    // Use Track, Cluster, and Lead structs and functions
    let mut track = Track::new();
    track.update(10.0, -5.0, 20.0, 15.0, 30.0, 0.1, 0.5, 0.5, 15.0, 20.0, 10.0);
    let key = track.get_key_for_cluster();
    println!("Track Key for Cluster: {:?}", key);

    let mut cluster = Cluster::new();
    let track1 = Track::new();
    let track2 = Track::new();
    cluster.add(track1);
    cluster.add(track2);
    let d_rel = cluster.d_rel();
    println!("Cluster Relative Distance: {:?}", d_rel);

    let mut lead = Lead {
        d_rel: 0.0,
        y_rel: 0.0,
        v_rel: 0.0,
        a_rel: 0.0,
        v_lead: 0.0,
        a_lead: 0.0,
        d_path: 0.0,
        v_lat: 0.0,
        v_lead_k: 0.0,
        a_lead_k: 0.0,
        status: false,
        fcw: true,
    };
    cluster.to_live20(&mut lead);
    println!("Lead Vehicle Information: {:?}", lead);
}

πŸ§ͺ Testing

Run tests for the openpilot crate using:

cargo test

🌐 GitHub Repository

You can access the source code for openpilot 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.

πŸ’° Support

My Meet Ain't Meeting

If you like this project, consider tossing a coin into the virtual tip jar. Your donations help keep the coffee flowing and the code cracking. So, if you want to be the hero this project deserves, why not sprinkle some gold coins in the developer's virtual hat?

πŸ“˜ Documentation

Full documentation for openpilot is available on docs.rs.

πŸ“„ License

This project is licensed under the MIT License.

You might also like...
A low-level windowing system geared towards making audio plugin UIs.

baseview A low-level windowing system geared towards making audio plugin UIs. baseview abstracts the platform-specific windowing APIs (winapi, cocoa,

CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" format.

Lighthouse Groupie CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" form

CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a plotable format.

Lighthouse Aggregator CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" f

Aptos-core strives towards being the safest and most scalable layer one blockchain solution.
Aptos-core strives towards being the safest and most scalable layer one blockchain solution.

Aptos-core strives towards being the safest and most scalable layer one blockchain solution. Today, this powers the Aptos Devnet, tomorrow Mainnet in order to create universal and fair access to decentralized assets for billions of people.

πŸ€– Autonomous Twitter bot that posts analytics of the APYs available on the Solend Protocol.
πŸ€– Autonomous Twitter bot that posts analytics of the APYs available on the Solend Protocol.

Solend APY Twitter Bot Solana Ignition Hackathon 2021 View Demo Β· Report Bug Β· Request Feature Table of Contents About The Project Motivation Challeng

A simple and fast FRC autonomous path planner (designed for swerve drive)! (Desktop/Laptop only)

This is a website developed for planning autonomous paths for FRC robots. It is intended to be a simple and fast tool to create autos, which works offline at competitions.

Validity is a next-generation, deduction-based language for formally verified, context-aware, autonomous & reactive smart contracts.
Validity is a next-generation, deduction-based language for formally verified, context-aware, autonomous & reactive smart contracts.

Validity Language Validity is a next-generation, deduction-based language for formally verified, context-aware, autonomous & reactive smart contracts.

Decentralized Autonomous Applications (DAAs).  Building the Future with Self-Managing Applications.
Decentralized Autonomous Applications (DAAs). Building the Future with Self-Managing Applications.

Decentralized Autonomous Applications (DAAs) Building the Future with Self-Managing Applications. πŸ€– Straw Man Code Outline πŸ€– Reddit Group πŸ€– Twitter

CrustAGI is an Task-driven Autonomous Agent experiment written in Rust

CrustAGI πŸ¦€ CrustAGI is an experimental Rust-based implementation of an AI-powered task management system that uses OpenAI and Pinecone APIs to create

Meet Rustacean GPT, an experimental project transforming OpenAi's GPT into a helpful, autonomous software engineer to support senior developers and simplify coding life! πŸš€πŸ€–πŸ§ 
Meet Rustacean GPT, an experimental project transforming OpenAi's GPT into a helpful, autonomous software engineer to support senior developers and simplify coding life! πŸš€πŸ€–πŸ§ 

Rustacean GPT Welcome, fellow coding enthusiasts! πŸš€ πŸ€– I am excited to introduce you to Rustacean GPT, my humble yet ambitious project that aims to t

An extendable system made up of autonomous execution services known as nodes organized in a tree of processes. Inspired by Godot!

NodeTree NodeTree is a framework to create large scalable programs and games through a tree of processes. Each process is fully autonomous and is capa

A fully asynchronous, futures-based Kafka client library for Rust based on librdkafka

rust-rdkafka A fully asynchronous, futures-enabled Apache Kafka client library for Rust based on librdkafka. The library rust-rdkafka provides a safe

Fully async-await http server framework

Saphir is a fully async-await http server framework for rust The goal is to give low-level control to your web stack (as hyper does) without the time

An open-source and fully-featured Digital Audio Workstation, made by musicians, for musicians
An open-source and fully-featured Digital Audio Workstation, made by musicians, for musicians

Meadowlark An open-source and fully-featured Digital Audio Workstation, made by musicians, for musicians. *Current design mockup, not a functioning pr

Cucumber testing framework for Rust. Fully native, no external test runners or dependencies.

An implementation of the Cucumber testing framework for Rust. Fully native, no external test runners or dependencies.

A fully-featured lexer generator, implement as a proc macro

lexgen: A fully-featured lexer generator, implemented as a proc macro lexer! { // First line specifies name of the lexer and the token type return

An API for getting questions from http://either.io implemented fully in Rust, using reqwest and some regex magic. Provides asynchronous and blocking clients respectively.

eithers_rust An API for getting questions from http://either.io implemented fully in Rust, using reqwest and some regex magic. Provides asynchronous a

A simple implementation of Conway's Game of Life using Fully homomorphic Encryption

Game of life using Fully homomorphic encryption A simple implementation of Conway's Game of Life built using Zama's concrete-boolean library. Build Ju

Blackmarlin is a chess engine fully written in Rust.

Blackmarlin WIP UCI Chess Engine Blackmarlin is a chess engine fully written in Rust. Make sure to compile the chess engine with cargo build --release

Owner
Mahmoud
Rust all the things πŸ¦€
Mahmoud
Ecosystem of libraries and tools for writing and executing fast GPU code fully in Rust.

The Rust CUDA Project An ecosystem of libraries and tools for writing and executing extremely fast GPU code fully in Rust Guide | Getting Started | Fe

Rust GPU 2.1k Dec 30, 2022
SimConnect SDK in Rust. An opinionated SimConnect Client that encapsulates the C API fully and optimizes for developer experience.

SimConnect SDK An opinionated SimConnect Client that encapsulates the C API fully and optimizes for developer experience. Usage [dependencies] simconn

Mihai Dinculescu 6 Dec 4, 2022
SimConnect SDK in Rust. An opinionated SimConnect Client that encapsulates the C API fully and optimizes for developer experience.

SimConnect SDK An opinionated SimConnect Client that encapsulates the C API fully and optimizes for developer experience. Usage [dependencies] simconn

Mihai Dinculescu 4 Oct 31, 2022
Simple WIP GPGPU framework for Rust built on top of wgpu

gpgpu A simple GPU compute library based on wgpu. It is meant to be used alongside wgpu if desired. To start using gpgpu, just create a Framework inst

JerΓ³nimo SΓ‘nchez 97 Dec 26, 2022
[WIP] An experimental Java-like language and it's virtual machine, for learning Java and JVM.

Sky VM An experimental Java-like language and it's virtual machine, for learning Java and JVM. Dependencies Rust (rust-lang/rust) 2021 Edition, dual-l

Kk Shinkai 2 Jan 3, 2022
Neural Networks in Rust, without backpropagation. WIP

Deep Thought As of right now, this crate is far from a usable state. This crate implements feedforward-neural Networks in rust. Unlike the vast majori

null 5 Apr 10, 2022
Rust binding to LuisaCompute (WIP)

luisa-compute-rs Rust binding to LuisaCompute (WIP) Inside this crate: An almost safe binding to LuisaCompute An EDSL for writing kernels A new backen

Luisa Group 14 Jan 5, 2023
🚧 WIP 🚧 Vector database plugin for Postgres, written in Rust, specifically designed for LLM.

pgvecto.rs pgvecto.rs is a Postgres extension that provides vector similarity search functions. It is written in Rust and based on pgrx. Features cosi

TensorChord 74 Apr 26, 2023
Dataflow system for building self-driving car and robotics applications.

ERDOS ERDOS is a platform for developing self-driving cars and robotics applications. Getting started The easiest way to get ERDOS running is to use o

ERDOS 163 Dec 29, 2022
Cork is a simple command-line calculator, mainly targeted towards people who deal with hex numbers

Cork is a simple command-line calculator, mainly targeted towards people who deal with hex numbers. It deals only with integer arithmetic. Expressions may involve mixed bases (limited to decimal, hexadecimal, octal and binary numbers). The global output format may be set to a particular radix - by default it is hex.

Deep Majumder 50 Dec 22, 2022