AntiLibrary5/XAI-CARLA-dataset

Increase recording frequency

Closed this issue · 1 comments

Hello,thanks for your sharing!
I have 3 questions about dataset.py:

  1. How to increase recording frequency? I want to record these data every 0.1s.
  2. These vehicles are set autopolit, I want to use keyboard to control the vehicle and record these data at the same time. What should I do?
  3. I just want to collect images of rgb and do not use other sensors, should I set the synchronous_mode=True or False?

Hi,

  1. The recording frequency can be set for a sensor using the set_attribute() method for a given Blueprint. Please refer to the docs: https://carla.readthedocs.io/en/latest/bp_library/#blueprint-library
    For your use-case, 'sensor_tick' is the attribute you want to modify.
    For example,
    camera_bp = world.get_blueprint_library().filter('sensor.camera.rgb')
    camera_bp.set_attribute('sensor_tick', 0.1)

  2. The dataset.py is written to be used in autopilot. To be able to control the vehicle, you would need to write a different implementation. CARLA comes with some example scripts one of which implements what you need. I believe it's called manual.py or manual_control.py. You can find it in the examples folder:
    {CARLA-root}/PythonAPI/examples/manual.py
    It should be easy to build on top of it.

  3. synchronous_mode is used for the solver settings. It doesn't affect the 'Actors' in CARLA. In 'dataset.py', there are 3 sensors initialized: camera_rgb, camera_ss and lidar.
    If you just want to use RGB camera, you can simply remove the code where the lidar and semantic segmentation cameras are initialized and some further dependent lines, but that should do what you want.