Skip to content

KevinLADLee/carla_dataset_tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

63 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš— CARLA Dataset Tools

Python CARLA License

๐Ÿ“ฆ A comprehensive data collection and labeling toolkit for CARLA Simulator

Data collection and labeling tools for CARLA Simulator. This toolkit provides an efficient pipeline for generating high-quality autonomous driving datasets with support for multiple sensor types and standard dataset formats.

โš ๏ธ Important: All raw data generated by this tool uses a right-hand coordinate system.

๐ŸŒŸ This work is part of the CarlaFLCAV project. Feel free to give us a star!


โœจ Key Features

  • โœ… Multi-Sensor Support: RGB Camera, Semantic Segmentation, LiDAR, Semantic LiDAR, Radar, IMU, GNSS
  • โœ… V2X Communication: Vehicle-to-Everything (V2X) sensor support for V2V and V2I scenarios
    • V2X CAM sensors (ETSI standard) for automatic message generation
    • V2X Custom sensors for manual message broadcasting
    • Realistic wireless channel modeling with path loss simulation
  • โœ… Infrastructure Support: Roadside unit (RSU) simulation for V2X scenarios
    • Static infrastructure actors with sensor attachment
    • One-way message broadcasting from infrastructure to vehicles
    • Support for V2I (Vehicle-to-Infrastructure) communication
  • โœ… Multiple Dataset Formats: KITTI Object, YOLOv5, Argoverse
  • โœ… Flexible Configuration: YAML-based configuration with validation
  • โœ… Route Editor: Interactive tool for creating custom vehicle routes with topology-aware path planning
  • โœ… BEV Map Capture: Tool for generating bird's-eye view maps of entire CARLA maps
  • โœ… Synchronized Recording: Synchronized multi-vehicle and multi-sensor data collection
  • โœ… Visualization Tools: Built-in point cloud and data visualization utilities
  • โœ… Autopilot Integration: Automatic vehicle control using CARLA's traffic manager

๐Ÿš€ 30-Second Quick Start

# 1. Clone and install
git clone https://github.com/KevinLADLee/carla_dataset_tools.git
cd carla_dataset_tools
pip3 install -r requirements.txt

# 2. Set environment variable
export CARLA_ROOT=/path/to/your/carla

# 3. Start CARLA
cd $CARLA_ROOT && ./CarlaUE4.sh

# 4. Record data (in a new terminal)
cd carla_dataset_tools
python3 data_recorder.py --profile kitti

# 5. Generate labels 
python3 label_tools/kitti_objects_label.py -r record_YYYY_MMDD_HHMM -v vehicle_1st

# 6. Visulize output dataset
python3 tools/viz_lidar.py --type kitti --source dataset/record_YYYY_MMDD_HHMM/vehicle_1st/kitti_object/training/velodyne

๐Ÿ“š Documentation

For Users

User Guide - Complete installation and usage guide

  • Installation and prerequisites
  • Recording data with different profiles
  • Route Editor - Create custom vehicle routes interactively
  • Generating labels (KITTI, YOLOv5, Argoverse)
  • Data visualization
  • Troubleshooting

ไธญๆ–‡็”จๆˆทๆŒ‡ๅ— - ๅฎŒๆ•ด็š„ๅฎ‰่ฃ…ๅ’Œไฝฟ็”จๆŒ‡ๅ—

For Developers

Developer Guide - Technical documentation for developers

  • Architecture overview
  • Configuration system details (maps, weather, sensors)
  • API reference
  • Extending the toolkit
  • Development workflow

ไธญๆ–‡ๅผ€ๅ‘่€…ๆŒ‡ๅ— - ๅผ€ๅ‘่€…ๆŠ€ๆœฏๆ–‡ๆกฃ


โš™๏ธ Configuration Profiles

Pre-configured profiles for different dataset styles:

  • default - General purpose with multiple vehicles and sensors
  • kitti - KITTI-style (Velodyne HDL-64E, standard cameras)
  • argoverse - Argoverse-style with ring cameras
  • simple - Minimal configuration for testing
  • route_example - Demonstrates vehicle route following feature
  • v2x_test - V2X communication testing (V2V and V2I scenarios)
  • bev - Bird's-eye view camera configuration for map capture
# List available profiles
python3 tools/config_list.py

# Use a profile
python3 data_recorder.py --profile kitti

# Create custom vehicle routes
python3 tools/editor_route.py --map Town02 --name my_route

# Capture BEV map of entire CARLA map
python3 tools/capture_map_bev.py --map Town02 --output ./bev_output

# Validate a configuration
python3 tools/config_validate.py --profile kitti

See Developer Guide for complete configuration reference.


๐Ÿ“Š Supported Dataset Formats

  • KITTI Object Detection - 3D bounding boxes with calibration
  • YOLOv5 - 2D bounding box annotations
  • Argoverse - Ring camera setup (experimental)

๐Ÿ”ง Prerequisites

  • CARLA Simulator >= 0.9.16
  • Python >= 3.8
  • Operating System: Linux (recommended) / Windows

Download CARLA: https://github.com/carla-simulator/carla/releases


๐Ÿ“ Project Structure

carla_dataset_tools/
โ”œโ”€โ”€ config/                      # Configuration management
โ”‚   โ”œโ”€โ”€ config_manager.py        # YAML config loader and validator
โ”‚   โ””โ”€โ”€ profiles/                # Pre-configured profiles (default, kitti, argoverse, simple, route_example)
โ”œโ”€โ”€ docs/                        # Documentation
โ”‚   โ”œโ”€โ”€ USER_GUIDE.md            # User guide (English)
โ”‚   โ”œโ”€โ”€ USER_GUIDE_CN.md         # User guide (Chinese)
โ”‚   โ”œโ”€โ”€ DEVELOPER.md             # Developer guide (English)
โ”‚   โ””โ”€โ”€ DEVELOPER_CN.md          # Developer guide (Chinese)
โ”œโ”€โ”€ label_tools/                 # Labeling scripts (KITTI, YOLO, Argoverse)
โ”œโ”€โ”€ recorder/                    # Core recording modules
โ”œโ”€โ”€ routes/                      # Vehicle route definitions (YAML + PKL)
โ”œโ”€โ”€ core/                        # Core shared modules (geometry, transform, logger)
โ”œโ”€โ”€ tools/                       # CLI utility scripts
โ”‚   โ”œโ”€โ”€ editor_route.py          # Route editor
โ”‚   โ”œโ”€โ”€ capture_map_bev.py       # BEV map capture tool
โ”‚   โ”œโ”€โ”€ viz_lidar.py             # LiDAR visualization
โ”‚   โ””โ”€โ”€ ...                      # Other utilities
โ””โ”€โ”€ data_recorder.py             # Main recording script

๐Ÿค Contributing

Contributions are welcome! Areas for contribution:

  • Additional dataset format support (nuScenes, Waymo, etc.)
  • Enhanced documentation and examples
  • Bug fixes and performance improvements
  • New sensor types or features

Please submit pull requests to the main repository.


๐Ÿ“– Citation

If you use this tool in your research, please cite:

@article{wang2022federated,
  title={Federated deep learning meets autonomous vehicle perception: Design and verification},
  author={Wang, Shuai and Li, Chengyang and Ng, Derrick Wing Kwan and Eldar, Yonina C and Poor, H Vincent and Hao, Qi and Xu, Chengzhong},
  journal={IEEE network},
  volume={37},
  number={3},
  pages={16--25},
  year={2022},
  publisher={IEEE}
}

๐Ÿ™ Acknowledgements

This project builds upon:


๐Ÿ“„ License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.


๐Ÿ“ฎ Contact & Support


โญ If this project helps your research, please give us a star! โญ

๐Ÿ  Home โ€ข ๐Ÿ“– User Guide โ€ข ๐Ÿ”ง Developer Guide โ€ข ๐Ÿ› Report Bug