2.2. Environment Setup (One-Time Configuration)

Before using the Orbbec SDK Python Wrapper, you need to run the environment configuration script once on each new computer. This ensures:

  • Linux: Proper device access permissions via udev rules

  • Windows: UVC metadata registration for correct timestamps and frame synchronization

  • macOS: No additional configuration needed

This step is only required the first time you set up the SDK on a machine.



2.2.2. What This Setup Does

2.2.2.1. Windows

  • Registers UVC metadata in the Windows registry to enable timestamp extraction

  • Required for proper frame synchronization and depth-color alignment

  • Must be run as Administrator

  • Needs to be re-run when connecting a new device model (the script will detect this)

2.2.2.2. Linux

  • Installs udev rules to grant user access to Orbbec USB devices

  • Prevents permission denied errors when opening devices

  • Reloads udev rules automatically after installation

  • Requires sudo privileges

2.2.2.3. macOS

  • No registry or udev configuration needed

  • Orbbec devices work out of the box on macOS


2.2.3. Manual Configuration (Advanced)

If you prefer to configure the environment manually, or if the automatic script fails, follow these manual steps:

2.2.3.1. Linux - Manual udev Rules Installation

Install udev rules using the following commands:

cd pyorbbecsdk/scripts/env_setup
sudo chmod +x ./install_udev_rules.sh
sudo ./install_udev_rules.sh
sudo udevadm control --reload-rules && udevadm trigger

Note: If this script is not executed, opening the device will fail due to permission issues. You would need to run samples with sudo (administrator privileges).

2.2.3.2. Windows - Manual Metadata Registration

To get device metadata (timestamps and other video frame information) through UVC protocol, you need to modify the registry first due to Windows system limitations.

  1. Connect the device and confirm that the device is online

  2. Open PowerShell with administrator privileges, then use the cd command to enter the script directory

  3. Execute the following command and enter Y when prompted:

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
    
    • If the above fails, try:

    Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
    
  4. Execute the following to complete registration:

    .\obsensor_metadata_win10.ps1 -op install_all
    

Note: Users need to run this script every time a new device model is connected. If metadata is not registered, device timestamps will be abnormal, affecting the SDK’s internal frame synchronization functionality.