-
Notifications
You must be signed in to change notification settings - Fork 61
Description
OpenVR
Transforms for controllers, HMD, and trackers can optionally be created and added to the scene.
The update of the transform is done using the following API:
| void updateTransformNodeWithControllerPose(vtkEventDataDevice device); | |
| void updateTransformNodeWithHMDPose(); | |
| void updateTransformNodesWithTrackerPoses(); | |
| void updateTransformNodeWithPose(vtkMRMLTransformNode* node, vr::TrackedDevicePose_t* tdPose); |
all transform nodes have the following attributes in common:
VirtualReality.PoseValid (`True` or `False`)
VirtualReality.PoseStatus (`Uninitialized`, `CalibratingInProgress`, `CalibratingOutOfRange`, `RunningOk`, `RunningOutOfRange`)
Controllers
Based on the state of the controller, the following MRML attributes are set:
VirtualReality.ControllerActive
VirtualReality.ControllerConnected
Additionally, the position of each controller is updated leveraging the OpenVR specific API vtkOpenVRRenderWindow::GetOpenVRPose()
HMD
Based on the retrieve state, the attribute VirtualReality.HMDActive is set:
SlicerVirtualReality/VirtualReality/Widgets/qMRMLVirtualRealityView.cxx
Lines 576 to 583 in 53a9549
| if (tdPose == nullptr || tdPose->eTrackingResult != vr::TrackingResult_Running_OK) | |
| { | |
| node->SetAttribute("VirtualReality.HMDActive", "0"); | |
| } | |
| else | |
| { | |
| node->SetAttribute("VirtualReality.HMDActive", "1"); | |
| } |
Generic trackers
In additional of the common attributes, the transform nodes for the generic trackers are named "VirtualReality.GenericTracker" and set with these attributes:
VirtualReality.VRDeviceID
VirtualReality.TrackerActive
Related issues:
OpenXR
Since the vtkRenderingOpenXR API (and by extension the OpenXR specification ?) does not provide a way to get the state of the controllers & trackers:
- can the validity of the pose be inferred from the associated transform ?
- or do we need to improve
vtkRenderingOpenXRAPI ?
To help answer, here are few observations:
VirtualReality.TrackerActive,VirtualReality.HMDActiveandVirtualReality.ControllerActiveare set but not used (inSlicerVirtualRealityextension)VirtualReality.PoseStatusis used inqMRMLVirtualRealityTransformWidget::updateWidgetFromMRMLto exit if there are no change compared to the last status, or update the the icon representing the status of each trackers (including HMD and controllers)VirtualReality.VRDeviceIDis set but not used (inSlicerVirtualRealityextension)
Optionally, to improve the user experience, it would be nice to still have a way to report the status of each controllers & trackers.
Based on the observations, the critical information we need to have available through OpenXR are the controllers and trackers transforms.