Hi,
I’m developing a custom controller driver (of kind ETrackedDeviceClass::TrackedDeviceClass_Controller). When SteamVR starts it does its usual thing of assigning a unique id to each device where 0 is always the HMD, 1 and 2 usually being the base stations and 3 and 4 usually being the normal hand controllers.
Now, when I enable my custom driver it assigns it an id of 1 and others devices become 2 and 3 for the base stations and 4 and 5 for the normal hand controllers. When I start a game usually one hand controller disappears (usually the left one). What would be the correct way in Unreal of identifying/separating/detecting which controller are the hand controllers and which other devices are something else e.g. my custom controller. Also, how is this done with the Vive Trackers?
Try to call GetValidTrackedDeviceIds to check how devices are mapped by Unreal
Try to start SteamVR without a third controller (mapped to id = 5)
What’s role of your controller (vr::IVRSystem::GetControllerRoleForTrackedDeviceIndex(id=1))? It shouldn’t be vr::ETrackedControllerRole::TrackedControllerRole_Invalid.
There is a map [EControllerHand → SteamVR Device ID] in the Unreal. So Motion Controller Component with hand = Right/Left will always use the lastest connected right/left controller if you have more then two, but if everything was mapped properly, you can receive coordinates of the third controller by its SteamVR ID using USteamVRFunctionLibrary::GetTrackedDevicePositionAndOrientation(id).
Ed. USteamVRFunctionLibrary::GetValidTrackedDeviceIds(…) and USteamVRFunctionLibrary::GetTrackedDevicePositionAndOrientation(…) are exposed to blueprints.