2.1. Registration script (required)
Before using the Orbbec SDK Python Wrapper, you must run the environment registration scripts once on each new computer to ensure that the device can be accessed properly and that metadata is handled correctly.
This step is only needed the first time you set up the SDK on a machine, or when the registration scripts have changed.
First, download the source code from the official GitHub repository. All required scripts are located in the scripts directory.
2.1.1. install udev rules script (Linux)
Please install it using the following commands:/scripts/install_udev_rules.sh
cd pyorbbecsdk/scripts
sudo chmod +x ./install_udev_rules.sh
sudo ./install_udev_rules.sh
sudo udevadm control --reload-rules && udevadm trigger
Notes: If this script is not executed, open the device will fail due to permission issues. You need to run the sample with sudo (administrator privileges).**
2.1.2. Registering Metadata Using a Script (Windows)
To get device metadata (this includes things like timestamps and other information about the video frame) through UVC protocol, users need to modify the registry and complete registration first, because Windows system has default limitations.
Connect the device and confirm that the device is online;
Open PowerShell with administrator privileges, then use the
cdcommand to enter the directory where the script is located;Execute the
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUsercommand, and enterYas prompted to confirm;Try to execute the
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUsercommand if the previous command fails in some cases;
Execute
.\obsensor_metadata_win10.ps1 -op install_allto complete the registration.
Notes: Users need to run this script every time a new device is connected. This process can be cumbersome and easy to forget, leading to an inability to obtain the device’s metadata.
Notes: If the metadata is not registered, the device timestamp will be abnormal, thereby affecting the SDK’s internal frame synchronization functionality.