This project is based on DataGenerator, with modifications to support the nuscenes dataset format and the surround-view camera.
Configuration of the surround-view camera used in the nuscenes dataset is in config_bev.yaml
, see the file for details, you can also refer to Nuscenes.
- The main function
generator.py
controls the overall data generation, sets the CARLA simulation to synchronous mode, saves all sensor data after simulating a certain number of steps (step in config), and generates annotation information. - The
SynchronyModel
class encapsulates some functions of the CARLA synchronous mode, such as controlling the generation of actors, agents, setting routes, and collecting sensor data. - The
DataSave
class encapsulates the tools for saving various data formats. - The
export_utils
module contains some dataset format conversion functions. - The
data_utils
module contains sensor data post-processing, including some basic projection functions, andlidar_visible
generates 3d box annotations based on lidar data. - The
data_descriptor
contains the dataset annotation format to be generated, which can be extended in the future if other formats are needed.
- Configure the CARLA environment, it is recommended to download the Shipping version directly.
- Start the Carla server, if you are using it on the server, it is recommended to enable off-screen rendering.
./CarlaUE4.sh -RenderOffScreen
- Configure
config_bev.yaml
as needed. -
python generator.py
- After data generation, you can use
nuscenes_tutorial.ipynb
for visualization.
- The generated data does not contain attribute and map currently, so it cannot be parsed by the official api, you need to replace it with
nuscenes_dev.py
in this project. - CARLA uses the left-handed local coordinate system of UE, but the Nuscenes annotation uses the global coordinate system, so both point cloud data and annotations are converted before saving.