Production-grade Advanced Driver Assistance System with ACC, LKA, tracking, and ROS2 integration
Project description
ADAS Core - Production-Grade Advanced Driver Assistance System
A production-ready Advanced Driver Assistance System (ADAS) implementation designed for edge deployment on platforms like NVIDIA Jetson. This system provides adaptive cruise control, lane keeping assistance, and object tracking with comprehensive safety monitoring.
🚗 Features
Core Capabilities
- Adaptive Cruise Control (ACC): Maintains safe following distance with dynamic speed control
- Lane Keeping Assist (LKA): Automatic lane centering with proportional steering control
- Multi-Object Tracking: Persistent track IDs with data association
- Safety Monitor: Real-time safety constraint enforcement and command sanitization
- ROS2 Integration: Complete ROS2 bridge with standard topics and message types
- Replay Tools: Record and replay pipeline data for debugging and analysis
Production Features
- ✅ Comprehensive Error Handling: Domain-specific exceptions with graceful degradation
- ✅ Structured Logging: Production-grade logging with performance metrics
- ✅ Configuration Validation: Type-checked configuration with range validation
- ✅ Safety Enforcement: Multi-layer safety checks and bounds enforcement
- ✅ Stateless Design: Thread-safe components for concurrent execution
- ✅ Metrics & Observability: Performance tracking and health monitoring
- ✅ Docker Support: Production-ready containerization
- ✅ Comprehensive Tests: Unit tests for all critical components
- ✅ ROS2 Integration: Full ROS2 bridge for robotics integration
- ✅ Debug Tools: Record/replay functionality for offline analysis
🏗️ Architecture
Camera → Perception → Tracking → Planning → Control → Safety Monitor → Actuators
Key Components:
- Perception: Object detection + lane estimation
- Tracking: Multi-object tracker with persistent IDs
- Planning: Behavior planner (ACC + lane keeping)
- Control: PID controller for speed and steering
- Safety: Multi-layer safety validation and enforcement
See ARCHITECTURE.md for detailed architecture documentation.
📦 Installation
Quick Start
# Clone repository
git clone https://github.com/jakhon37/ADAS.git
cd ADAS
# Install package
pip install -e .
# Run synthetic test
adas-run --frames 60
Docker Deployment
# Build image
docker build -t adas-core:latest .
# Run container
docker-compose up -d
# View logs
docker-compose logs -f
See DEPLOYMENT.md for complete deployment guide.
🚀 Usage
Command Line Interface
# Run with default configuration
adas-run --frames 100
# Run with custom configuration
adas-run --config config.json --frames 100
# Debug mode
adas-run --log-level DEBUG --frames 10
Python API
from adas.pipeline import ADASPipeline
from adas.models import PerceptionFrame
from adas.cli import build_pipeline
import time
# Build pipeline
pipeline, fps = build_pipeline()
# Process frame
frame = PerceptionFrame(
frame_id=0,
timestamp_s=time.time(),
rgb=camera_data,
width=1280,
height=720,
)
plan, command = pipeline.step(frame, current_speed_mps=15.0)
print(f"Plan: {plan.target_speed_mps:.1f} m/s, {plan.steering_angle_deg:.1f}°")
print(f"Command: throttle={command.throttle:.2f}, brake={command.brake:.2f}")
⚙️ Configuration
Configuration is managed via JSON files. See config.example.json for template.
Key Parameters
{
"planner": {
"cruise_speed_mps": 15.0, // ~54 km/h
"min_follow_distance_m": 12.0, // Minimum safe distance
"time_gap_s": 2.0 // Desired time gap
},
"safety": {
"max_speed_mps": 33.0, // ~120 km/h limit
"max_deceleration_mps2": 8.0, // Emergency brake limit
"min_following_distance_m": 2.0 // Absolute minimum
}
}
All configuration parameters are validated on load with clear error messages.
🧪 Testing
# Run all tests
make test
# Run specific test file
pytest tests/test_safety.py -v
# Run with coverage
pytest --cov=src/adas tests/
📊 Performance
Current (Mock Implementations):
- Latency: <1ms per frame
- Throughput: 1000+ FPS
- Memory: <100MB
Production (TensorRT on Jetson Xavier):
- Latency: 30-50ms per frame
- Throughput: 20-30 FPS
- Memory: 500MB-2GB
🛡️ Safety
Safety Features
- Speed and acceleration limits
- Steering rate and angle constraints
- Minimum following distance enforcement
- Command sanitization and clamping
- Graceful degradation on sensor failures
Safety Certification Notes
⚠️ IMPORTANT: This is a reference implementation for development and testing.
For production automotive deployment:
- Implement ISO 26262 functional safety requirements
- Add redundancy and fail-safe mechanisms
- Perform extensive validation (HIL/SIL testing)
- Integrate with vehicle safety systems
- Obtain necessary certifications
🔧 Development
Setup Development Environment
# Install with dev dependencies
pip install -e ".[dev]"
# Run linter
make lint
# Format code
make format
# Clean build artifacts
make clean
Code Quality Standards
- Type Hints: All functions fully type-annotated
- Docstrings: Google-style docstrings
- Error Handling: Comprehensive exception handling
- Logging: Structured logging throughout
- Testing: >80% code coverage target
📚 Documentation
- ARCHITECTURE.md - System architecture and design
- DEPLOYMENT.md - Production deployment guide
- PROJECT_STRUCTURE.md - Package organization guide
- ROS2_INTEGRATION.md - ROS2 integration guide
- TOOLS_GUIDE.md - Debugging and replay tools
- config.example.json - Configuration template
🤝 Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
📄 License
This project is licensed under the MIT License - see LICENSE file for details.
🙏 Acknowledgments
Built for edge deployment on:
- NVIDIA Jetson (Nano, Xavier, Orin)
- Similar ARM-based edge compute platforms
Designed to integrate with:
- TensorRT for GPU-accelerated inference
- DeepStream for video analytics
- ROS/ROS2 for robotics integration
📞 Support
For issues and questions:
- Open an issue on GitHub
- See documentation in this repository
- Check DEPLOYMENT.md for troubleshooting
Status: Production-ready reference implementation
Version: 0.1.0
Last Updated: 2026-02-26
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 adas_core-0.1.0.tar.gz.
File metadata
- Download URL: adas_core-0.1.0.tar.gz
- Upload date:
- Size: 49.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2b51f32ec3ef4284b031ad68dd56c691bf85c4ab8cdf58855dfbcf90d4ebbf0
|
|
| MD5 |
e38f21daa44044dcf81c152401539ff9
|
|
| BLAKE2b-256 |
1cf4aeea9b51ecc63790c89af08d3792991ea5c30a9577c744cf0b49d03f0536
|
File details
Details for the file adas_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: adas_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 40.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab4ec311c0631f3f05d899cb44735a39e1e8a512ac1f0f7da6bc5d484dceb119
|
|
| MD5 |
0219fe3b91f898aec2f1a170906502a9
|
|
| BLAKE2b-256 |
d05b67cf2a10a3411d90becd0680aef02514d1447f8ad2549294ec07f039e1de
|