Controls

This document describes the common controls for the Arducam TOF camera and their behavior under different DeviceType. It also provides Python API examples for each control.

Controls Overview

  1. EXPOSURE

    • Adjusts the exposure time of the camera.

    • DeviceType: Supported DEVICE_VGA only.

    • Range: 0 to 3000 (for DEVICE_VGA).

    • Python API:

      camera.setControl(Control.EXPOSURE, value)
      
  1. RANGE

    • Sets the maximum range of the depth measurement.

    • DeviceType:
      • DEVICE_HQVGA: Values can be 2000 or 4000.

      • DEVICE_VGA: Automatically adjusted based on mode.

    • Python API:

      camera.setControl(Control.RANGE, 2000)  # Set range to 2000
      
  2. MODE

    • Configures the working mode of the camera.

    • DeviceType:
      • DEVICE_HQVGA: Not applicable.

      • DEVICE_VGA:
        • SINGLE_FREQ (0): Single frequency mode.

        • DOUBLE_FREQ (1): Dual frequency mode.

    • Python API:

      camera.setControl(Control.MODE, TofWorkMode.SINGLE_FREQ.value)
      
  3. FRAME_RATE

    • Sets the frame rate of the camera.

    • DeviceType: Supported DEVICE_VGA only.

    • Python API:

      camera.setControl(Control.FRAME_RATE, 30)  # Set frame rate to 30 FPS
      

Python API Example

Below is an example of how to use the Python API to configure the camera:

from ArducamDepthCamera import ArducamCamera, Control, TofWorkMode

camera = ArducamCamera()

# Open the camera
camera.open(Connection.CSI)

# Set exposure
camera.setControl(Control.EXPOSURE, 1000)

# Set range for HQVGA device
camera.setControl(Control.RANGE, 4000)

# Set mode for VGA device
camera.setControl(Control.MODE, TofWorkMode.DOUBLE_FREQ.value)

# Set frame rate
camera.setControl(Control.FRAME_RATE, 30)

# Close the camera
camera.close()