aboutsummaryrefslogtreecommitdiffstats
path: root/LibOVR/Src/OVR_Device.h
diff options
context:
space:
mode:
Diffstat (limited to 'LibOVR/Src/OVR_Device.h')
-rw-r--r--LibOVR/Src/OVR_Device.h585
1 files changed, 506 insertions, 79 deletions
diff --git a/LibOVR/Src/OVR_Device.h b/LibOVR/Src/OVR_Device.h
index d0a39d0..4ddc7a2 100644
--- a/LibOVR/Src/OVR_Device.h
+++ b/LibOVR/Src/OVR_Device.h
@@ -6,16 +6,16 @@ Content : Definition of HMD-related Device interfaces
Created : September 21, 2012
Authors : Michael Antonov
-Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved.
+Copyright : Copyright 2014 Oculus VR, Inc. All Rights reserved.
-Licensed under the Oculus VR SDK License Version 2.0 (the "License");
-you may not use the Oculus VR SDK except in compliance with the License,
+Licensed under the Oculus VR Rift SDK License Version 3.1 (the "License");
+you may not use the Oculus VR Rift SDK except in compliance with the License,
which is provided at the time of installation or download, or which
otherwise accompanies this software in either electronic or hard copy form.
You may obtain a copy of the License at
-http://www.oculusvr.com/licenses/LICENSE-2.0
+http://www.oculusvr.com/licenses/LICENSE-3.1
Unless required by applicable law or agreed to in writing, the Oculus VR SDK
distributed under the License is distributed on an "AS IS" BASIS,
@@ -37,6 +37,7 @@ limitations under the License.
#include "Kernel/OVR_RefCount.h"
#include "Kernel/OVR_String.h"
+
namespace OVR {
// Declared externally
@@ -79,7 +80,7 @@ public:
virtual bool SupportsMessageType(MessageType) const { return true; }
private:
- UPInt Internal[4];
+ UPInt Internal[8];
};
@@ -112,12 +113,14 @@ public:
virtual DeviceBase* GetParent() const;
virtual DeviceManager* GetManager() const;
- virtual void SetMessageHandler(MessageHandler* handler);
- virtual MessageHandler* GetMessageHandler() const;
+ virtual void AddMessageHandler(MessageHandler* handler);
virtual DeviceType GetType() const;
virtual bool GetDeviceInfo(DeviceInfo* info) const;
+ // Returns true if device is connected and usable
+ virtual bool IsConnected();
+
// returns the MessageHandler's lock
Lock* GetHandlerLock() const;
protected:
@@ -138,25 +141,23 @@ class DeviceInfo
{
public:
DeviceInfo() : InfoClassType(Device_None), Type(Device_None), Version(0)
- { ProductName[0] = Manufacturer[0] = 0; }
-
- enum { MaxNameLength = 32 };
+ {}
// Type of device for which DeviceInfo is intended.
// This will be set to Device_HMD for HMDInfo structure, note that this may be
// different form the actual device type since (Device_None) is valid.
- const DeviceType InfoClassType;
+ const DeviceType InfoClassType;
// Type of device this describes. This must be the same as InfoClassType when
// InfoClassType != Device_None.
- DeviceType Type;
+ DeviceType Type;
// Name string describing the product: "Oculus Rift DK1", etc.
- char ProductName[MaxNameLength];
- char Manufacturer[MaxNameLength];
- unsigned Version;
+ String ProductName;
+ String Manufacturer;
+ unsigned Version;
protected:
DeviceInfo(DeviceType type) : InfoClassType(type), Type(type), Version(0)
- { ProductName[0] = Manufacturer[0] = 0; }
+ {}
void operator = (const DeviceInfo&) { OVR_ASSERT(0); } // Assignment not allowed.
};
@@ -318,35 +319,28 @@ protected:
class HMDInfo : public DeviceInfo
{
public:
- // Size of the entire screen, in pixels.
- unsigned HResolution, VResolution;
- // Physical dimensions of the active screen in meters. Can be used to calculate
- // projection center while considering IPD.
- float HScreenSize, VScreenSize;
- // Physical offset from the top of the screen to the eye center, in meters.
- // This will usually, but not necessarily be half of VScreenSize.
- float VScreenCenter;
- // Distance from the eye to screen surface, in meters.
- // Useful for calculating FOV and projection.
- float EyeToScreenDistance;
- // Distance between physical lens centers useful for calculating distortion center.
- float LensSeparationDistance;
- // Configured distance between the user's eye centers, in meters. Defaults to 0.064.
- float InterpupillaryDistance;
-
- // Radial distortion correction coefficients.
- // The distortion assumes that the input texture coordinates will be scaled
- // by the following equation:
- // uvResult = uvInput * (K0 + K1 * uvLength^2 + K2 * uvLength^4)
- // Where uvInput is the UV vector from the center of distortion in direction
- // of the mapped pixel, uvLength is the magnitude of that vector, and uvResult
- // the corresponding location after distortion.
- float DistortionK[4];
-
- float ChromaAbCorrection[4];
+ // Characteristics of the HMD screen and enclosure
+ HmdTypeEnum HmdType;
+ Size<int> ResolutionInPixels;
+ Size<float> ScreenSizeInMeters;
+ float ScreenGapSizeInMeters;
+ float CenterFromTopInMeters;
+ float LensSeparationInMeters;
+
+ // Timing & shutter data. All values in seconds.
+ struct ShutterInfo
+ {
+ HmdShutterTypeEnum Type;
+ float VsyncToNextVsync; // 1/framerate
+ float VsyncToFirstScanline; // for global shutter, vsync->shutter open.
+ float FirstScanlineToLastScanline; // for global shutter, will be zero.
+ float PixelSettleTime; // estimated.
+ float PixelPersistence; // Full persistence = 1/framerate.
+ } Shutter;
// Desktop coordinate position of the screen (can be negative; may not be present on all platforms)
- int DesktopX, DesktopY;
+ int DesktopX;
+ int DesktopY;
// Windows:
// "\\\\.\\DISPLAY3", etc. Can be used in EnumDisplaySettings/CreateDC.
@@ -356,43 +350,44 @@ public:
long DisplayId;
+ // Constructor initializes all values to 0s.
+ // To create a "virtualized" HMDInfo, use CreateDebugHMDInfo instead.
HMDInfo()
- : DeviceInfo(Device_HMD),
- HResolution(0), VResolution(0), HScreenSize(0), VScreenSize(0),
- VScreenCenter(0), EyeToScreenDistance(0),
- LensSeparationDistance(0), InterpupillaryDistance(0),
- DesktopX(0), DesktopY(0), DisplayId(0)
+ : DeviceInfo(Device_HMD),
+ HmdType(HmdType_None),
+ ResolutionInPixels(0),
+ ScreenSizeInMeters(0.0f),
+ ScreenGapSizeInMeters(0.0f),
+ CenterFromTopInMeters(0),
+ LensSeparationInMeters(0),
+ DisplayId(0)
{
+ DesktopX = 0;
+ DesktopY = 0;
DisplayDeviceName[0] = 0;
- memset(DistortionK, 0, sizeof(DistortionK));
- DistortionK[0] = 1;
- ChromaAbCorrection[0] = ChromaAbCorrection[2] = 1;
- ChromaAbCorrection[1] = ChromaAbCorrection[3] = 0;
+ Shutter.Type = HmdShutter_LAST;
+ Shutter.VsyncToNextVsync = 0.0f;
+ Shutter.VsyncToFirstScanline = 0.0f;
+ Shutter.FirstScanlineToLastScanline = 0.0f;
+ Shutter.PixelSettleTime = 0.0f;
+ Shutter.PixelPersistence = 0.0f;
}
// Operator = copies local fields only (base class must be correct already)
void operator = (const HMDInfo& src)
{
- HResolution = src.HResolution;
- VResolution = src.VResolution;
- HScreenSize = src.HScreenSize;
- VScreenSize = src.VScreenSize;
- VScreenCenter = src.VScreenCenter;
- EyeToScreenDistance = src.EyeToScreenDistance;
- LensSeparationDistance = src.LensSeparationDistance;
- InterpupillaryDistance = src.InterpupillaryDistance;
- DistortionK[0] = src.DistortionK[0];
- DistortionK[1] = src.DistortionK[1];
- DistortionK[2] = src.DistortionK[2];
- DistortionK[3] = src.DistortionK[3];
- ChromaAbCorrection[0] = src.ChromaAbCorrection[0];
- ChromaAbCorrection[1] = src.ChromaAbCorrection[1];
- ChromaAbCorrection[2] = src.ChromaAbCorrection[2];
- ChromaAbCorrection[3] = src.ChromaAbCorrection[3];
- DesktopX = src.DesktopX;
- DesktopY = src.DesktopY;
+ HmdType = src.HmdType;
+ ResolutionInPixels = src.ResolutionInPixels;
+ ScreenSizeInMeters = src.ScreenSizeInMeters;
+ ScreenGapSizeInMeters = src.ScreenGapSizeInMeters;
+ CenterFromTopInMeters = src.CenterFromTopInMeters;
+ LensSeparationInMeters = src.LensSeparationInMeters;
+ DesktopX = src.DesktopX;
+ DesktopY = src.DesktopY;
+ Shutter = src.Shutter;
memcpy(DisplayDeviceName, src.DisplayDeviceName, sizeof(DisplayDeviceName));
- DisplayId = src.DisplayId;
+
+ DisplayId = src.DisplayId;
}
bool IsSameDisplay(const HMDInfo& o) const
@@ -431,10 +426,10 @@ public:
// Requests the currently used profile. This profile affects the
// settings reported by HMDInfo.
- virtual Profile* GetProfile() const = 0;
+ virtual Profile* GetProfile() = 0;
// Obtains the currently used profile name. This is initialized to the default
// profile name, if any; it can then be changed per-device by SetProfileName.
- virtual const char* GetProfileName() const = 0;
+ virtual const char* GetProfileName() = 0;
// Sets the profile user name, changing the data returned by GetProfileInfo.
virtual bool SetProfileName(const char* name) = 0;
@@ -483,7 +478,6 @@ class SensorInfo : public DeviceInfo
public:
SensorInfo() : DeviceInfo(Device_Sensor), VendorId(0), ProductId(0)
{
- SerialNumber[0] = 0;
}
// HID Vendor and ProductId of the device.
@@ -492,12 +486,399 @@ public:
// MaxRanges report maximum sensor range values supported by HW.
SensorRange MaxRanges;
// Sensor (and display) serial number.
- char SerialNumber[20];
+ String SerialNumber;
private:
void operator = (const SensorInfo&) { OVR_ASSERT(0); } // Assignment not allowed.
};
+// Tracking settings (DK2).
+struct TrackingReport
+{
+ TrackingReport()
+ : CommandId(0), Pattern(0),
+ Enable(0), Autoincrement(0), UseCarrier(0),
+ SyncInput(0), VsyncLock(0), CustomPattern(0),
+ ExposureLength(0), FrameInterval(0),
+ VsyncOffset(0), DutyCycle(0)
+ {}
+
+ TrackingReport( UInt16 commandId,
+ UByte pattern,
+ bool enable,
+ bool autoincrement,
+ bool useCarrier,
+ bool syncInput,
+ bool vsyncLock,
+ bool customPattern,
+ UInt16 exposureLength,
+ UInt16 frameInterval,
+ UInt16 vsyncOffset,
+ UByte dutyCycle)
+ : CommandId(commandId), Pattern(pattern),
+ Enable(enable), Autoincrement(autoincrement), UseCarrier(useCarrier),
+ SyncInput(syncInput), VsyncLock(vsyncLock), CustomPattern(customPattern),
+ ExposureLength(exposureLength), FrameInterval(frameInterval),
+ VsyncOffset(vsyncOffset), DutyCycle(dutyCycle)
+ { }
+
+ UInt16 CommandId;
+ UByte Pattern; // Tracking LED pattern index.
+ bool Enable; // Enables the tracking LED exposure and updating.
+ bool Autoincrement; // Autoincrement pattern after each exposure.
+ bool UseCarrier; // Modulate tracking LEDs at 85kHz.
+ bool SyncInput; // Trigger LED exposure from wired sync signal.
+ bool VsyncLock; // Trigger LED exposure from panel Vsync.
+ bool CustomPattern; // Use custom LED sequence.
+ UInt16 ExposureLength; // Tracking LED illumination (and exposure) length in microseconds.
+ UInt16 FrameInterval; // LED exposure interval in microseconds when in
+ // 'internal timer' mode (when SyncInput = VsyncLock = false).
+ UInt16 VsyncOffset; // Exposure offset in microseconds from vsync when in
+ // 'vsync lock' mode (when VsyncLock = true).
+ UByte DutyCycle; // Duty cycle of 85kHz modulation when in 'use carrier' mode
+ // (when UseCarrier = true). 128 = 50% duty cycle.
+};
+
+// Display settings (DK2).
+struct DisplayReport
+{
+ enum ShutterTypeEnum
+ {
+ // These are not yet defined.
+ ShutterType_Default = 0,
+ };
+
+ enum CurrentLimitEnum
+ {
+ // These are not yet defined.
+ CurrentLimit_Default = 0,
+ };
+
+ DisplayReport()
+ : CommandId(0), Brightness(0),
+ ShutterType(ShutterType_Default), CurrentLimit(CurrentLimit_Default), UseRolling(0),
+ ReverseRolling(0), HighBrightness(0), SelfRefresh(0),
+ ReadPixel(0), DirectPentile(0),
+ Persistence(0), LightingOffset(0),
+ PixelSettle(0), TotalRows(0)
+ {}
+
+ DisplayReport( UInt16 commandId,
+ UByte brightness,
+ ShutterTypeEnum shutterType,
+ CurrentLimitEnum currentLimit,
+ bool useRolling,
+ bool reverseRolling,
+ bool highBrightness,
+ bool selfRefresh,
+ bool readPixel,
+ bool directPentile,
+ UInt16 persistence,
+ UInt16 lightingOffset,
+ UInt16 pixelSettle,
+ UInt16 totalRows)
+ : CommandId(commandId), Brightness(brightness),
+ ShutterType(shutterType), CurrentLimit(currentLimit), UseRolling(useRolling),
+ ReverseRolling(reverseRolling), HighBrightness(highBrightness), SelfRefresh(selfRefresh),
+ ReadPixel(readPixel), DirectPentile(directPentile),
+ Persistence(persistence), LightingOffset(lightingOffset),
+ PixelSettle(pixelSettle), TotalRows(totalRows)
+ { }
+
+ UInt16 CommandId;
+ UByte Brightness; // See 'DK2 Firmware Specification' document for a description of
+ ShutterTypeEnum ShutterType; // display settings.
+ CurrentLimitEnum CurrentLimit;
+ bool UseRolling;
+ bool ReverseRolling;
+ bool HighBrightness;
+ bool SelfRefresh;
+ bool ReadPixel;
+ bool DirectPentile;
+ UInt16 Persistence;
+ UInt16 LightingOffset;
+ UInt16 PixelSettle;
+ UInt16 TotalRows;
+};
+
+// MagCalibration matrix (DK2).
+struct MagCalibrationReport
+{
+ MagCalibrationReport()
+ : CommandId(0), Version(0), Calibration()
+ {}
+
+ MagCalibrationReport( UInt16 commandId,
+ UByte version,
+ const Matrix4f& calibration)
+ : CommandId(commandId), Version(version), Calibration(calibration)
+ { }
+
+ UInt16 CommandId;
+ UByte Version; // Version of the calibration procedure used to generate the calibration matrix.
+ Matrix4f Calibration; // Calibration matrix. Note only the first three rows are used by the feature report.
+};
+
+// PositionCalibration values (DK2).
+// - Sensor interface versions before 5 do not support Normal and Rotation.
+struct PositionCalibrationReport
+{
+ enum PositionTypeEnum
+ {
+ PositionType_LED = 0,
+ PositionType_IMU = 1
+ };
+
+ PositionCalibrationReport()
+ : CommandId(0), Version(0),
+ Position(0), Normal(0), Rotation(0),
+ PositionIndex(0), NumPositions(0), PositionType(PositionType_LED)
+ {}
+
+ PositionCalibrationReport(UInt16 commandId,
+ UByte version,
+ const Vector3f& position,
+ const Vector3f& normal,
+ float rotation,
+ UInt16 positionIndex,
+ UInt16 numPositions,
+ PositionTypeEnum positionType)
+ : CommandId(commandId), Version(version),
+ Position(position), Normal(normal), Rotation(rotation),
+ PositionIndex(positionIndex), NumPositions(numPositions), PositionType(positionType)
+ {
+ }
+
+ UInt16 CommandId;
+ UByte Version; // The version of the calibration procedure used to generate the stored positions.
+ Vector3d Position; // Position of the LED or inertial tracker in meters. This is relative to the
+ // center of the emitter plane of the display at nominal focus.
+ Vector3d Normal; // Normal of the LED or inertial tracker. This is a signed integer in
+ // meters. The normal is relative to the position.
+ double Rotation; // The rotation about the normal. This is in radians.
+ UInt16 PositionIndex; // The current position being read or written to. Autoincrements on reads, gets set
+ // to the written value on writes.
+ UInt16 NumPositions; // The read-only number of items with positions stored. The last position is that of
+ // the inertial tracker, all others are LED positions.
+ PositionTypeEnum PositionType; // The type of the item which has its position reported in the current report
+};
+
+// CustomPattern values (DK2).
+struct CustomPatternReport
+{
+ CustomPatternReport()
+ : CommandId(0), SequenceLength(0), Sequence(0),
+ LEDIndex(0), NumLEDs(0)
+ {}
+
+ CustomPatternReport(UInt16 commandId,
+ UByte sequenceLength,
+ UInt32 sequence,
+ UInt16 ledIndex,
+ UInt16 numLEDs)
+ : CommandId(commandId), SequenceLength(sequenceLength), Sequence(sequence),
+ LEDIndex(ledIndex), NumLEDs(numLEDs)
+ { }
+
+ UInt16 CommandId;
+ UByte SequenceLength; // See 'DK2 Firmware Specification' document for a description of
+ UInt32 Sequence; // LED custom patterns.
+ UInt16 LEDIndex;
+ UInt16 NumLEDs;
+};
+
+// KeepAliveMux settings (DK2).
+struct KeepAliveMuxReport
+{
+ KeepAliveMuxReport()
+ : CommandId(0), INReport(0), Interval(0)
+ {}
+
+ KeepAliveMuxReport( UInt16 commandId,
+ UByte inReport,
+ UInt16 interval)
+ : CommandId(commandId), INReport(inReport), Interval(interval)
+ { }
+
+ UInt16 CommandId;
+ UByte INReport; // Requested IN report type (1 = DK1, 11 = DK2).
+ UInt16 Interval; // Keep alive period in milliseconds.
+};
+
+// Manufacturing test result (DK2).
+struct ManufacturingReport
+{
+ ManufacturingReport()
+ : CommandId(0), NumStages(0), Stage(0),
+ StageLocation(0), StageTime(0), Result(0), StageVersion(0)
+ {}
+
+ ManufacturingReport( UInt16 commandId,
+ UByte numStages,
+ UByte stage,
+ UByte version,
+ UInt16 stageLocation,
+ UInt32 stageTime,
+ UInt32 result)
+ : CommandId(commandId), NumStages(numStages), Stage(stage),
+ StageLocation(stageLocation), StageTime(stageTime), Result(result), StageVersion(version)
+ { }
+
+ UInt16 CommandId;
+ UByte NumStages; // See 'DK2 Firmware Specification' document for a description of
+ UByte Stage; // manufacturing test results.
+ UByte StageVersion;
+ UInt16 StageLocation;
+ UInt32 StageTime;
+ UInt32 Result;
+};
+
+// UUID (DK2).
+struct UUIDReport
+{
+ static const int UUID_SIZE = 20;
+
+ UUIDReport()
+ : CommandId(0)
+ {
+ memset(UUIDValue, 0, sizeof(UUIDValue));
+ }
+
+ UUIDReport( UInt16 commandId,
+ UByte uuid[UUID_SIZE])
+ : CommandId(commandId)
+ {
+ for (int i=0; i<UUID_SIZE; i++)
+ {
+ UUIDValue[i] = uuid[i];
+ }
+ }
+
+ UInt16 CommandId;
+ UByte UUIDValue[UUID_SIZE]; // See 'DK2 Firmware Specification' document for
+ // a description of UUID.
+};
+
+// Lens Distortion (DK2).
+struct LensDistortionReport
+{
+ LensDistortionReport()
+ : CommandId(0),
+ NumDistortions(0),
+ DistortionIndex(0),
+ Bitmask(0),
+ LensType(0),
+ Version(0),
+ EyeRelief(0),
+ MaxR(0),
+ MetersPerTanAngleAtCenter(0)
+ {}
+
+ LensDistortionReport( UInt16 commandId,
+ UByte numDistortions,
+ UByte distortionIndex,
+ UByte bitmask,
+ UInt16 lensType,
+ UInt16 version,
+ UInt16 eyeRelief,
+ UInt16 kCoefficients[11],
+ UInt16 maxR,
+ UInt16 metersPerTanAngleAtCenter,
+ UInt16 chromaticAberration[4])
+ : CommandId(commandId),
+ NumDistortions(numDistortions),
+ DistortionIndex(distortionIndex),
+ Bitmask(bitmask),
+ LensType(lensType),
+ Version(version),
+ EyeRelief(eyeRelief),
+ MaxR(maxR),
+ MetersPerTanAngleAtCenter(metersPerTanAngleAtCenter)
+ {
+ memcpy(KCoefficients, kCoefficients, sizeof(KCoefficients));
+ memcpy(ChromaticAberration, chromaticAberration, sizeof(ChromaticAberration));
+ }
+
+ UInt16 CommandId;
+ UByte NumDistortions;
+ UByte DistortionIndex;
+ UByte Bitmask;
+ UInt16 LensType;
+ UInt16 Version;
+ UInt16 EyeRelief;
+ UInt16 KCoefficients[11];
+ UInt16 MaxR;
+ UInt16 MetersPerTanAngleAtCenter;
+ UInt16 ChromaticAberration[4];
+};
+
+// Temperature calibration result (DK2).
+struct TemperatureReport
+{
+ TemperatureReport()
+ : CommandId(0), Version(0),
+ NumBins(0), Bin(0), NumSamples(0), Sample(0),
+ TargetTemperature(0), ActualTemperature(0),
+ Time(0), Offset(0)
+ {}
+
+ TemperatureReport( UInt16 commandId,
+ UByte version,
+ UByte numBins,
+ UByte bin,
+ UByte numSamples,
+ UByte sample,
+ double targetTemperature,
+ double actualTemperature,
+ UInt32 time,
+ Vector3d offset)
+ : CommandId(commandId), Version(version),
+ NumBins(numBins), Bin(bin), NumSamples(numSamples), Sample(sample),
+ TargetTemperature(targetTemperature), ActualTemperature(actualTemperature),
+ Time(time), Offset(offset)
+ { }
+
+ UInt16 CommandId;
+ UByte Version; // See 'DK2 Firmware Specification' document for a description of
+ UByte NumBins; // temperature calibration data.
+ UByte Bin;
+ UByte NumSamples;
+ UByte Sample;
+ double TargetTemperature;
+ double ActualTemperature;
+ UInt32 Time; // Better hope nobody tries to use this in 2038
+ Vector3d Offset;
+};
+
+// Gyro autocalibration result (DK2).
+struct GyroOffsetReport
+{
+ enum VersionEnum
+ {
+ // These are not yet defined.
+ Version_NoOffset = 0,
+ Version_ShortAvg = 1,
+ Version_LongAvg = 2
+ };
+
+ GyroOffsetReport()
+ : CommandId(0), Version(Version_NoOffset),
+ Offset(0), Temperature(0)
+ {}
+
+ GyroOffsetReport( UInt16 commandId,
+ VersionEnum version,
+ Vector3d offset,
+ double temperature)
+ : CommandId(commandId), Version(version),
+ Offset(offset), Temperature(temperature)
+ {}
+
+ UInt16 CommandId;
+ VersionEnum Version;
+ Vector3d Offset;
+ double Temperature;
+};
//-------------------------------------------------------------------------------------
// ***** SensorDevice
@@ -519,7 +900,9 @@ public:
virtual DeviceType GetType() const { return Device_Sensor; }
-
+ virtual UByte GetDeviceInterfaceVersion() = 0;
+
+
// CoordinateFrame defines whether messages come in the coordinate frame
// of the sensor device or HMD, which has a different internal sensor.
// Sensors obtained form the HMD will automatically use HMD coordinates.
@@ -542,7 +925,7 @@ public:
// Returns currently set report rate, in Hz. If 0 - error occurred.
// Note, this value may be different from the one provided for SetReportRate. The return
// value will contain the actual rate.
- virtual unsigned GetReportRate() const = 0;
+ virtual unsigned GetReportRate() const = 0;
// Sets maximum range settings for the sensor described by SensorRange.
// The function will fail if you try to pass values outside Maximum supported
@@ -550,11 +933,52 @@ public:
// Pass waitFlag == true to wait for command completion. For waitFlag == true,
// returns true if the range was applied successfully (no HW error).
// For waitFlag = false, return 'true' means that command was enqueued successfully.
- virtual bool SetRange(const SensorRange& range, bool waitFlag = false) = 0;
+ virtual bool SetRange(const SensorRange& range, bool waitFlag = false) = 0;
// Return the current sensor range settings for the device. These may not exactly
// match the values applied through SetRange.
- virtual void GetRange(SensorRange* range) const = 0;
+ virtual void GetRange(SensorRange* range) const = 0;
+
+ // Return the factory calibration parameters for the IMU
+ virtual void GetFactoryCalibration(Vector3f* AccelOffset, Vector3f* GyroOffset,
+ Matrix4f* AccelMatrix, Matrix4f* GyroMatrix,
+ float* Temperature) = 0;
+ // Enable/disable onboard IMU calibration
+ // If set to false, the device will return raw values
+ virtual void SetOnboardCalibrationEnabled(bool enabled) = 0;
+
+ // Get/set feature reports added to DK2. See 'DK2 Firmware Specification' document for details.
+ virtual bool SetTrackingReport(const TrackingReport&) { return false; }
+ virtual bool GetTrackingReport(TrackingReport*) { return false; }
+
+ virtual bool SetDisplayReport(const DisplayReport&) { return false; }
+ virtual bool GetDisplayReport(DisplayReport*) { return false; }
+
+ virtual bool SetMagCalibrationReport(const MagCalibrationReport&) { return false; }
+ virtual bool GetMagCalibrationReport(MagCalibrationReport*) { return false; }
+
+ virtual bool SetPositionCalibrationReport(const PositionCalibrationReport&) { return false; }
+ virtual bool GetAllPositionCalibrationReports(Array<PositionCalibrationReport>*) { return false; }
+
+ virtual bool SetCustomPatternReport(const CustomPatternReport&) { return false; }
+ virtual bool GetCustomPatternReport(CustomPatternReport*) { return false; }
+
+ virtual bool SetKeepAliveMuxReport(const KeepAliveMuxReport&) { return false; }
+ virtual bool GetKeepAliveMuxReport(KeepAliveMuxReport*) { return false; }
+
+ virtual bool SetManufacturingReport(const ManufacturingReport&) { return false; }
+ virtual bool GetManufacturingReport(ManufacturingReport*) { return false; }
+
+ virtual bool SetUUIDReport(const UUIDReport&) { return false; }
+ virtual bool GetUUIDReport(UUIDReport*) { return false; }
+
+ virtual bool SetTemperatureReport(const TemperatureReport&) { return false; }
+ virtual bool GetAllTemperatureReports(Array<Array<TemperatureReport> >*) { return false; }
+
+ virtual bool GetGyroOffsetReport(GyroOffsetReport*) { return false; }
+
+ virtual bool SetLensDistortionReport(const LensDistortionReport&) { return false; }
+ virtual bool GetLensDistortionReport(LensDistortionReport*) { return false; }
};
//-------------------------------------------------------------------------------------
@@ -627,4 +1051,7 @@ public:
} // namespace OVR
+
+
+
#endif