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:
|
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
vtkRenderingOpenXR API ?
To help answer, here are few observations:
VirtualReality.TrackerActive, VirtualReality.HMDActive and VirtualReality.ControllerActive are set but not used (in SlicerVirtualReality extension)
VirtualReality.PoseStatus is used in qMRMLVirtualRealityTransformWidget::updateWidgetFromMRML to 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.VRDeviceID is set but not used (in SlicerVirtualReality extension)
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.
cc: @LucasGandel @lassoan @cpinter @adamrankin
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:
SlicerVirtualReality/VirtualReality/Widgets/qMRMLVirtualRealityView_p.h
Lines 92 to 95 in 53a9549
all transform nodes have the following attributes in common:
Controllers
Based on the state of the controller, the following MRML attributes are set:
Additionally, the position of each controller is updated leveraging the OpenVR specific API
vtkOpenVRRenderWindow::GetOpenVRPose()HMD
Based on the retrieve state, the attribute
VirtualReality.HMDActiveis set:SlicerVirtualReality/VirtualReality/Widgets/qMRMLVirtualRealityView.cxx
Lines 576 to 583 in 53a9549
Generic trackers
In additional of the common attributes, the transform nodes for the generic trackers are named "VirtualReality.GenericTracker" and set with these attributes:
Related issues:
OpenXR
Since the
vtkRenderingOpenXRAPI (and by extension the OpenXR specification ?) does not provide a way to get the state of the controllers & trackers: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.
cc: @LucasGandel @lassoan @cpinter @adamrankin