Get a VR device by its serial number

Shows how to get a VR device (e.g. a controller or a tracker) by its internal serial number. The serial number in the script has to be replaced by one of a connected device. This example also adds a box as child node to the corresponding device for visualization purposes.

vr/getVRDeviceBySerialNumber.py
 1# © 2024 Autodesk, Inc. All rights reserved.
 2
 3# Get tracker by its serial number
 4tracker1 = vrDeviceService.getVRDeviceBySerialNumber("LHR-0DDDBBF0")
 5
 6# Create a red box
 7box = createBox(100, 100, 100, 1, 1, 1, 1.0, 0.0, 0.0, 0.0)
 8
 9# Attach the box to the tracker
10tracker1.getNode().children.append(box)