![]() |
Fove SDK
v0.16.1
|
Class that manages accesses to headsets. More...
Public Member Functions | |
def | __init__ (self, capabilities) |
Defines a headset with the given capabilities. More... | |
def | __enter__ (self) |
Creates and tries to connect to the headset. More... | |
def | __exit__ (self, _e_type, _e_val, _traceback) |
Frees resources used by a headset object, including memory and sockets. More... | |
def | checkEyesClosed (self) |
Returns eyes that are closed. More... | |
def | checkEyesTracked (self) |
Returns eyes that are being tracked. More... | |
def | checkSoftwareVersions (self) |
Checks whether the client can run against the installed version of the FOVE SDK. More... | |
def | createCompositor (self) |
Returns a compositor interface from the given headset. More... | |
def | ensureEyeTrackingCalibration (self) |
Starts eye tracking calibration if not already calibrated. More... | |
def | getEyeToHeadMatrices (self) |
Gets the matrices to convert from eye- to head-space coordintes. More... | |
def | getGazeConvergence (self) |
Gets eye convergence data. More... | |
def | getGazeVectors (self) |
Gets each eye's current gaze vector. More... | |
def | getGazeVectors2d (self) |
Gets the user's 2D gaze position on the screens seen through the HMD's lenses. More... | |
def | getHardwareInfo (self) |
Gets the information about the hardware information. More... | |
def | getIOD (self) |
Gets interocular distance in meters. More... | |
def | getLatestPose (self) |
Gets the pose of the head-mounted display. More... | |
def | getProjectionMatricesLH (self, zNear, zFar) |
Gets the valoues of passed-in left-handed 4x4 projection matrices. More... | |
def | getProjectionMatricesRH (self, zNear, zFar) |
Gets the valoues of passed-in right-handed 4x4 projection matrices. More... | |
def | getRawProjectionValues (self) |
Gets values for the view frustum of both eyes at 1 unit away. More... | |
def | getResearchHeadset (self, capabilities) |
Converts an existing headset object into a research headset. More... | |
def | getSoftwareVersions (self) |
Gets the information about the current software versions. More... | |
def | isEyeTrackingCalibrated (self) |
Checks if eye tracking has been calibrated. More... | |
def | isEyeTrackingCalibrating (self) |
Checks if eye tracking is in the process of calibration. More... | |
def | isEyeTrackingEnabled (self) |
Checks if eye tracking hardware has started. More... | |
def | isEyeTrackingReady (self) |
Checks if eye tracking is actively tracking an eye - or eyes. More... | |
def | isHardwareConnected (self) |
Checks whether the headset is connected or not. More... | |
def | isHardwareReady (self) |
Checks whether the headset hardware has started. More... | |
def | isMotionReady (self) |
Checks if motion tracking hardware has started. More... | |
def | isPositionReady (self) |
Checks if position tracking hardware has started. More... | |
def | startEyeTrackingCalibration (self, restartIfRunning) |
Starts eye tracking calibration. More... | |
def | stopEyeTrackingCalibration (self) |
Stops eye tracking calibration. More... | |
def | tareOrientationSensor (self) |
Tares the orientation of the headset. More... | |
def | tarePositionSensors (self) |
Tares the position of the headset. More... | |
def | waitForNextEyeFrame (self) |
Waits for next camera frame and associated eye tracking info becomes available. More... | |
Class that manages accesses to headsets.
All Headset-related API requests will be done through an instance of this class.
The class provides Headset.__enter__
and Headset.__exit__
methods that do relevant resource managements, so the typical use of this class would be as follows:
def fove.headset.Headset.__init__ | ( | self, | |
capabilities | |||
) |
Defines a headset with the given capabilities.
This does not automatically create or connect to the headset. For that, the user has to call Headset.__enter__
(and call Headset.__exit__
when the headset is no longer needed) but consider using the with
statement instead of manually calling them.
capabilities | The desired capabilities (Gaze, Orientation, Position). For multiple capabilities, use arithmetic operators as in: ClientCapabilities.Gaze + ClientCapabilities.Position . |
def fove.headset.Headset.__enter__ | ( | self | ) |
Creates and tries to connect to the headset.
The result headset should be destroyed using Headset.__exit__
when no longer needed, but consider using the with
statement instead of manually calling it.
RuntimeError | When failed to create a headset |
def fove.headset.Headset.__exit__ | ( | self, | |
_e_type, | |||
_e_val, | |||
_traceback | |||
) |
Frees resources used by a headset object, including memory and sockets.
Upon return, this headset instance, and any research headsets from it, should no longer be used.
def fove.headset.Headset.isHardwareConnected | ( | self | ) |
Checks whether the headset is connected or not.
def fove.headset.Headset.isHardwareReady | ( | self | ) |
Checks whether the headset hardware has started.
def fove.headset.Headset.checkSoftwareVersions | ( | self | ) |
Checks whether the client can run against the installed version of the FOVE SDK.
RuntimeError | if not compatible with the currently running service |
def fove.headset.Headset.getSoftwareVersions | ( | self | ) |
Gets the information about the current software versions.
Allows you to get detailed information about the client and runtime versions. Instead of comparing software versions directly, you should simply call Headset.checkSoftwareVersions
to ensure that the client and runtime are compatible.
def fove.headset.Headset.getHardwareInfo | ( | self | ) |
Gets the information about the hardware information.
Allows you to get serial number, manufacturer, and model name of the headset.
def fove.headset.Headset.waitForNextEyeFrame | ( | self | ) |
Waits for next camera frame and associated eye tracking info becomes available.
Allows you to sync your eye tracking loop to the actual eye-camera loop. On each loop, you would first call this blocking function to wait for a new frame and then proceed to consume eye tracking info accociated with the frame.
def fove.headset.Headset.getGazeVectors | ( | self | ) |
Gets each eye's current gaze vector.
Note: the underlying API in fove.capi allows one to get only one of the two (left/right) gaze vectors, but here both vectors will always be returned.
def fove.headset.Headset.getGazeVectors2d | ( | self | ) |
Gets the user's 2D gaze position on the screens seen through the HMD's lenses.
The use of lenses and distortion correction creates a screen in front of each eye. This function returns 2D vectors representing where on each eye's screen the user is looking.
The vectors are normalized in the range [-1, 1] along both X and Y axes such that the following points are true:
def fove.headset.Headset.getGazeConvergence | ( | self | ) |
Gets eye convergence data.
def fove.headset.Headset.checkEyesClosed | ( | self | ) |
Returns eyes that are closed.
def fove.headset.Headset.checkEyesTracked | ( | self | ) |
Returns eyes that are being tracked.
def fove.headset.Headset.isEyeTrackingEnabled | ( | self | ) |
Checks if eye tracking hardware has started.
def fove.headset.Headset.isEyeTrackingCalibrated | ( | self | ) |
Checks if eye tracking has been calibrated.
def fove.headset.Headset.isEyeTrackingCalibrating | ( | self | ) |
Checks if eye tracking is in the process of calibration.
def fove.headset.Headset.isEyeTrackingReady | ( | self | ) |
Checks if eye tracking is actively tracking an eye - or eyes.
def fove.headset.Headset.isMotionReady | ( | self | ) |
Checks if motion tracking hardware has started.
def fove.headset.Headset.tareOrientationSensor | ( | self | ) |
Tares the orientation of the headset.
def fove.headset.Headset.isPositionReady | ( | self | ) |
Checks if position tracking hardware has started.
def fove.headset.Headset.tarePositionSensors | ( | self | ) |
Tares the position of the headset.
def fove.headset.Headset.getLatestPose | ( | self | ) |
Gets the pose of the head-mounted display.
def fove.headset.Headset.getProjectionMatricesLH | ( | self, | |
zNear, | |||
zFar | |||
) |
Gets the valoues of passed-in left-handed 4x4 projection matrices.
Gets 4x4 projection matrices for both eyes using near and far planes in a left-handed coordinate system.
Note: the underlying API in fove.capi allows one to get only one of the two (left/right) projection matrices, but here both matrices will always be returned.
zNear | The near plane in float, Range: from 0 to zFar |
zFar | The far plane in float, Range: from zNear to infinity |
def fove.headset.Headset.getProjectionMatricesRH | ( | self, | |
zNear, | |||
zFar | |||
) |
Gets the valoues of passed-in right-handed 4x4 projection matrices.
Gets 4x4 projection matrices for both eyes using near and far planes in a right-handed coordinate system.
Note: the underlying API in fove.capi allows one to get only one of the two (left/right) projection matrices, but here both matrices will always be returned.
zNear | The near plane in float, Range: from 0 to zFar |
zFar | The far plane in float, Range: from zNear to infinity |
def fove.headset.Headset.getRawProjectionValues | ( | self | ) |
Gets values for the view frustum of both eyes at 1 unit away.
Gets values for the view frustum of the specified eye at 1 unit away. Please multiply them by zNear to convert to your correct frustum near-plane. Either outLeft or outRight may be nullptr
to only write the other struct, however setting both to nullptr
is considered and error and the function will return Fove_ErrorCode::API_NullOutPointersOnly
.
def fove.headset.Headset.getEyeToHeadMatrices | ( | self | ) |
Gets the matrices to convert from eye- to head-space coordintes.
This is simply a translation matrix that returns +/- IOD/2
def fove.headset.Headset.getIOD | ( | self | ) |
Gets interocular distance in meters.
This is an estimation of the distance between centers of the left and right eyeballs. Half of the IOD can be used to displace the left and right cameras for stereoscopic rendering. We recommend calling this each frame when doing stereoscoping rendering. Future versions of the FOVE service may update the IOD during runtime as needed.
def fove.headset.Headset.ensureEyeTrackingCalibration | ( | self | ) |
Starts eye tracking calibration if not already calibrated.
Does nothing if the user is already calibrated. Does nothing if the calibration is currently running. All eye tracking content should call this before using the gaze to ensure that there's a valid calibration. After calling this, content should periodically poll for Headset.isEyeTrackingCalibrating to become false, so as to ensure that the content is not updating while obscured by the calibrator
def fove.headset.Headset.startEyeTrackingCalibration | ( | self, | |
restartIfRunning | |||
) |
Starts eye tracking calibration.
restartIfRunning | If True, this will cause the calibration to restart if it's already running. Otherwise this will do nothing if eye tracking calibration is currently running. |
def fove.headset.Headset.stopEyeTrackingCalibration | ( | self | ) |
Stops eye tracking calibration.
def fove.headset.Headset.createCompositor | ( | self | ) |
Returns a compositor interface from the given headset.
Each call to this function creates a new object. Once Compositor.__enter__ is called on the object, it should be destroyed with Compositor.__exit__.
It is fine to call this function multiple times with the same headset. It is ok for the compositor to outlive the headset passed in.
def fove.headset.Headset.getResearchHeadset | ( | self, | |
capabilities | |||
) |
Converts an existing headset object into a research headset.
The research API does not provide backwards or forwards compatibility with different FOVE runtimes. Do not release general purpose software using this API, this is meant for researcher user in a controlled environment (lab). The result ResearchHeadset is destroyed when the input headset object is destroyed. There is no destroy/free function for the research headset specifically.
caps | These capabilities are automatically passed to ResearchHeadset_registerCapabilities so as to avoid an extra call |
outHeadset | A pointer where the address of the newly created research headset object will be written upon success |