A comprehensive CARLA client for autonomous driving simulation
Project description
CARLA Driving Simulator Client
A personal project for experimenting with CARLA client, featuring vehicle control, sensor management, and visualization capabilities.
Features
- Realistic vehicle physics and control
- Multiple sensor types (Camera, GNSS, Collision, Lane Invasion)
- Dynamic weather system
- Traffic and pedestrian simulation
- Real-time visualization with HUD and minimap
- Comprehensive logging and data collection
- Support for both manual and autopilot modes
- Configurable simulation parameters
- Automatic versioning and CI/CD pipeline
- Docker support with zero-configuration setup
- Web-based frontend and backend API
Requirements
- Python 3.11
- CARLA Simulator 0.10.0
- Pygame
- NumPy
- Matplotlib
- Tabulate
- PyYAML
- SQLAlchemy
- PostgreSQL (optional)
Installation
From Docker (Recommended)
# Pull the latest image
docker pull akshaychikhalkar/carla-driving-simulator-client:latest
# Run with Docker (frontend served by backend on port 8081)
docker run -p 8081:8000 akshaychikhalkar/carla-driving-simulator-client:latest
# Or use Docker Compose (recommended)
git clone https://github.com/AkshayChikhalkar/carla-driving-simulator-client.git
cd carla-driving-simulator-client
docker-compose -f docker-compose-prod.yml up -d
From PyPI
pip install carla-driving-simulator-client
From Source
- Clone the repository:
git clone https://github.com/AkshayChikhalkar/carla-driving-simulator-client.git
cd carla-driving-simulator-client
- Install in development mode:
pip install -e .
- Install CARLA:
- Download CARLA 0.10.0 from CARLA's website
- Extract the package and set the CARLA_ROOT environment variable
- Add CARLA Python API to your PYTHONPATH:
# For Windows
set PYTHONPATH=%PYTHONPATH%;C:\path\to\carla\PythonAPI\carla\dist\carla-0.10.0-py3.11-win-amd64.egg
# For Linux
export PYTHONPATH=$PYTHONPATH:/path/to/carla/PythonAPI/carla/dist/carla-0.10.0-py3.11-linux-x86_64.egg
Usage
- Start the CARLA server:
./CarlaUE4.sh -carla-rpc-port=2000
- Run the simulator client:
# If installed from PyPI
carla-simulator-client
# If installed from source
python -m carla_simulator.cli
Configuration
The simulator client can be configured through the config/simulation_config.yaml file. Key parameters include:
- Target distance
- Maximum speed
- Simulation duration
- Vehicle model
- Sensor settings
- Weather conditions
Project Structure
carla-driving-simulator-client/
├── carla_simulator/
│ ├── core/
│ ├── visualization/
│ ├── control/
│ ├── scenarios/
│ ├── database/
│ ├── utils/
│ └── cli.py
├── web/
├── tests/
├── config/
├── docs/
├── requirements/
└── README.md
Testing
This project includes comprehensive testing for both backend (Python) and frontend (React) components.
Backend Testing
# Run all Python tests
pytest tests/ --cov=carla_simulator --cov=web --cov-branch
# Run specific test modules
pytest tests/test_core.py
pytest tests/test_scenarios.py
Frontend Testing
# Navigate to frontend directory
cd web/frontend
# Install dependencies
npm install
# Run tests in watch mode (development)
npm test
# Run tests in CI mode (no watch, with coverage)
npm run test:ci
CI/CD Pipeline
The project uses GitHub Actions for automated testing:
- Backend Tests: Python tests with pytest and coverage reporting
- Frontend Tests: React tests with Jest and coverage reporting
- Docker Tests: Build and runtime validation of Docker containers
- Integration Tests: End-to-end testing of the complete system
All tests must pass before code can be merged to the main branch.
Contributing
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add some amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
Important: Please ensure all tests pass before submitting a pull request. The CI/CD pipeline will automatically run both backend and frontend tests.
Note: I cannot guarantee response times or implementation of suggested features as this project is maintained in my free time.
Support
If you need help, please check our Support Guide for various ways to get assistance.
Security
Please report any security issues to our Security Policy.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- CARLA Simulator Team
- TH OWL for initial development
Roadmap
Check our Roadmap for planned features and improvements.
Documentation
- Versioning Strategy - How automatic versioning works
- Environment Configuration - Environment variables and configuration
- Support Guide - Getting help and support
- Security Policy - Reporting security issues
- Contributing Guidelines - How to contribute to the project
Configuration
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 carla_driving_simulator_client-2.0.19.tar.gz.
File metadata
- Download URL: carla_driving_simulator_client-2.0.19.tar.gz
- Upload date:
- Size: 121.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3da315630894a7c49cb9c87b9e38b2b98a167b84e753550e92e1a824f8aca7c9
|
|
| MD5 |
beffd0df8145524623b74c6147ae6804
|
|
| BLAKE2b-256 |
f60fe2e7223b4d83110c8034d7e6ab4071181f57f2ce6c975b03c526895cb67e
|
File details
Details for the file carla_driving_simulator_client-2.0.19-py3-none-any.whl.
File metadata
- Download URL: carla_driving_simulator_client-2.0.19-py3-none-any.whl
- Upload date:
- Size: 142.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1c0a01a46ac70df3a6e9ec7894b46bed68ab7a6bc59c5a3df0f6bed01047fb1
|
|
| MD5 |
91a08c173af50e624c56374c6f9290ac
|
|
| BLAKE2b-256 |
e1380a81f5a7ff957e4633454161cb4eb45962241fe843c77586a5598bc3c9c9
|