Comprehensive SDK for building autonomous vehicle systems with modular sensors, controllers, planners, and alert systems
Project description
Simple Autonomous Car SDK
A comprehensive Python SDK for building autonomous vehicle systems with modular sensors, controllers, planners, and alert systems. Designed for researchers, engineers, and developers working on autonomous vehicle systems.
Features
- ๐ Modular Car System: Add multiple sensors, controllers, and planners
- ๐ฏ Multiple Coordinate Frames: Global, Ego, Sensor, and Frenet frame support
- ๐๏ธ Modular Sensors: LiDAR and extensible sensor system (add Camera, Radar, etc.)
- ๐ฎ Control Systems: Built-in Pure Pursuit and PID controllers, extensible architecture
- ๐บ๏ธ Planning Systems: Track planner and extensible planning framework
- ๐จ Alert Systems: Track bounds alert system with extensible architecture
- ๐ Frame Conversions: Comprehensive utilities for coordinate transformations
- ๐ Visualization: Rich visualization tools for debugging and analysis
- ๐งช Well Tested: Comprehensive test suite with CI/CD
Installation
From PyPI
pip install simple_autonomous_car
From Source
git clone https://github.com/yourusername/simple_autonomous_car.git
cd simple_autonomous_car
pip install -e .
With uv (Recommended)
uv pip install simple_autonomous_car
Quick Start
from simple_autonomous_car import (
Track,
Car,
CarState,
LiDARSensor,
PurePursuitController,
TrackPlanner,
FrenetMap,
TrackBoundsAlert,
)
# Create track and car
track = Track.create_simple_track()
car = Car(initial_state=CarState(x=0.0, y=0.0, heading=0.0, velocity=8.0))
# Add sensors to car
ground_truth_map = GroundTruthMap(track)
perceived_map = PerceivedMap(ground_truth_map)
lidar = LiDARSensor(ground_truth_map, perceived_map, max_range=40.0)
car.add_sensor(lidar)
# Create planner and controller
planner = TrackPlanner(track)
controller = PurePursuitController(target_velocity=10.0)
# Control loop
for step in range(100):
plan = planner.plan(car.state)
perception_data = car.sense_all()
control = controller.compute_control(car.state, perception_data, plan)
car.update(dt=0.1, **control)
Architecture
Modular Design
Car
โโโ Sensors (LiDAR, Camera, Radar, etc.)
โโโ Controller (Pure Pursuit, PID, MPC, etc.)
โโโ Planner (Track Planner, A*, RRT, etc.)
Data Flow
Planner โ Plan โ Controller โ Control Commands โ Car
โ
Sensors โ Perception Data
Documentation
Comprehensive documentation is available in the docs/ directory:
- Getting Started - Installation and setup
- Quick Start - Get up and running quickly
- Building Controllers - Interactive controller tutorial
- Building Alert Systems - Guide for building alert systems
- Track Bounds Alert - Detailed alert system documentation
- Frame Conversions - Understanding coordinate systems
- API Reference - Complete API documentation
See the Documentation Index for a complete overview.
Key Concepts
Modular Components
- Car: Vehicle with dynamics, can have multiple sensors
- Sensors: Modular sensor system (LiDAR, Camera, Radar, etc.)
- Controllers: Control algorithms (Pure Pursuit, PID, MPC, etc.)
- Planners: Path planning algorithms (Track Planner, A*, RRT, etc.)
Coordinate Frames
- Global Frame: World coordinates (track reference)
- Ego Frame: Car-centered (x=forward, y=left)
- Sensor Frame: Sensor-centered coordinates
- Frenet Frame: Path-aligned (s=distance along path, d=lateral offset)
Tutorials and Examples
Jupyter Notebooks
Interactive tutorials are available in the notebooks/ directory:
- Building Controllers - Learn how to build controllers
- Costmap Tutorial - Learn about costmaps and obstacle representation
- Planner Tutorial - Learn how to build and use planners
- Track Bounds Alert - Learn how to build alert systems
Code Examples
- Unified Simulation Runner - Config-based simulation runner with enhanced visualization
- Run with:
python -m simulations.simulation simple_trackorpython -m simulations.simulation race_track - Supports custom configs via
--configflag
- Run with:
Notebooks
The SDK includes comprehensive Jupyter notebooks organized by category:
Tutorials (notebooks/tutorials/)
- Costmap Tutorial - Learn costmaps
- Planner Tutorial - Learn path planning
- Track Bounds Alert Tutorial - Learn alert systems
Building Custom Components (notebooks/building/)
- Building Simulations - Build complete simulations
- Building Controllers - Build custom controllers
- Building Custom Sensors - Build custom sensors
- Building Custom Planners - Build custom planners
Learning Notebooks (notebooks/learning/) - Fill-in-the-Blank
Incomplete notebooks where you fill in the code - perfect for hands-on learning:
- Learning: Build a Costmap - Implement your own costmap
- Learning: Build a Planner - Implement your own planner
- Learning: Build a Controller - Implement your own controller
- Learning: Build a Sensor - Implement your own sensor
- Learning: Advanced Planning - Implement A* and RRT
Examples
Adding Multiple Sensors
# Add front LiDAR
front_lidar = LiDARSensor(..., name="front_lidar", pose_ego=np.array([1.0, 0.0, 0.0]))
car.add_sensor(front_lidar)
# Add rear LiDAR
rear_lidar = LiDARSensor(..., name="rear_lidar", pose_ego=np.array([-1.0, 0.0, np.pi]))
car.add_sensor(rear_lidar)
# Get data from all sensors
perception_data = car.sense_all()
Using Controller with Planner
# Create planner and controller
planner = TrackPlanner(track)
controller = PurePursuitController(target_velocity=10.0)
# Control loop
plan = planner.plan(car.state)
control = controller.compute_control(car.state, perception_data, plan)
car.update(dt=0.1, **control)
Building Custom Components
# Custom sensor
class MySensor(BaseSensor):
def sense(self, car_state, environment_data):
# Your sensor logic
return PerceptionPoints(points, frame="ego")
# Custom controller
class MyController(BaseController):
def compute_control(self, car_state, perception_data, plan):
# Your control logic
return {"acceleration": 0.0, "steering_rate": 0.0}
# Custom planner
class MyPlanner(BasePlanner):
def plan(self, car_state, perception_data, goal):
# Your planning logic
return waypoints
Development
# Clone repository
git clone https://github.com/yourusername/simple_autonomous_car.git
cd simple_autonomous_car
# Install with uv
uv sync --dev
# Run tests
uv run pytest
# Run linting
uv run black src tests
uv run ruff check src tests
uv run mypy src
# Install pre-commit hooks
uv run pre-commit install
Project Structure
simple_autonomous_car/
โโโ src/simple_autonomous_car/
โ โโโ car/ # Car model with sensor support
โ โโโ sensors/ # Modular sensor system
โ โโโ control/ # Control algorithms
โ โโโ planning/ # Path planning algorithms
โ โโโ alerts/ # Alert systems
โ โโโ maps/ # Map representations
โ โโโ perception/ # Perception data structures
โ โโโ frames/ # Frame conversion utilities
โ โโโ track/ # Track generation
โ โโโ visualization/ # Visualization tools
โโโ docs/ # Documentation
โโโ notebooks/ # Jupyter notebooks
โโโ tests/ # Test suite
โโโ src/simulations/ # Example simulations
Contributing
Contributions are welcome! Please see Contributing Guidelines for details.
License
MIT License - see LICENSE file for details.
Citation
If you use this SDK in your research, please cite:
@software{simple_autonomous_car,
title = {Simple Autonomous Car SDK},
author = {Your Name},
year = {2024},
url = {https://github.com/yourusername/simple_autonomous_car}
}
Acknowledgments
Inspired by the AutonomousVehicleControlBeginnersGuide repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_autonomous_car-0.1.2.tar.gz.
File metadata
- Download URL: simple_autonomous_car-0.1.2.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83670d4cadadce523498e558d5de1d7e17155c4196d1dda0973c591b9300d849
|
|
| MD5 |
23fbd856dd6ddbfc3b1c6284ae3d8ec0
|
|
| BLAKE2b-256 |
b3d5c884a03702d02a5f8accddb6dda6c9105e597cab058a9abe18f444927d3b
|
Provenance
The following attestation bundles were made for simple_autonomous_car-0.1.2.tar.gz:
Publisher:
publish.yml on guilyx/simple_autonomous_car
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_autonomous_car-0.1.2.tar.gz -
Subject digest:
83670d4cadadce523498e558d5de1d7e17155c4196d1dda0973c591b9300d849 - Sigstore transparency entry: 918984752
- Sigstore integration time:
-
Permalink:
guilyx/simple_autonomous_car@d56240dc4b6b44457ca74fdbee89160378500fc8 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/guilyx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d56240dc4b6b44457ca74fdbee89160378500fc8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file simple_autonomous_car-0.1.2-py3-none-any.whl.
File metadata
- Download URL: simple_autonomous_car-0.1.2-py3-none-any.whl
- Upload date:
- Size: 75.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23886d9154fb67413c61f8345ba52c38cb90209c37d8463c098abe64f976964b
|
|
| MD5 |
9cb28c8d281daa413b1324eb60ee216f
|
|
| BLAKE2b-256 |
bc182c7269aba3acd82b75f86ba252847f51429bca12de7606dd0639bf325956
|
Provenance
The following attestation bundles were made for simple_autonomous_car-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on guilyx/simple_autonomous_car
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simple_autonomous_car-0.1.2-py3-none-any.whl -
Subject digest:
23886d9154fb67413c61f8345ba52c38cb90209c37d8463c098abe64f976964b - Sigstore transparency entry: 918984811
- Sigstore integration time:
-
Permalink:
guilyx/simple_autonomous_car@d56240dc4b6b44457ca74fdbee89160378500fc8 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/guilyx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d56240dc4b6b44457ca74fdbee89160378500fc8 -
Trigger Event:
release
-
Statement type: