28 #ifndef OVR_SensorFusion_h
29 #define OVR_SensorFusion_h
556 AngularVelocity = angVel;
557 double angle = angVel.
Length() * dt;
559 Pose.Rotation = Pose.Rotation *
Quatd(angVel, angle);
565 LinearAcceleration = linearAccel;
566 Pose.Translation += LinearVelocity * dt + LinearAcceleration * (dt * dt * 0.5);
567 LinearVelocity += LinearAcceleration * dt;
575 Pose.Rotation = Pose.Rotation * delta.Pose.Rotation;
576 Pose.Translation += delta.Pose.Translation + LinearVelocity * delta.TimeInSeconds;
577 LinearVelocity += delta.LinearVelocity;
578 TimeInSeconds += delta.TimeInSeconds;
BodyFrameHandler(SensorFusion *fusion)
SensorState GetSensorStateAtTime(double absoluteTime) const
void ClearMagReferences()
virtual void OnVisionPreviousFrame(const Transform< double > &cameraFromImu)
float GetCenterPupilDepth() const
bool IsVisionPositionEnabled() const
virtual void OnVisionPreviousFrame(const Transform< double > &cameraFromImu)=0
void SetCenterPupilDepth(float centerPupilDepth)
void StoreAndIntegrateGyro(Vector3d angVel, double dt)
double LastVisionAbsoluteTime
void applyMagYawCorrection(Vector3d mag, double deltaT)
LocklessUpdater< LocklessState > UpdatedState
PoseState< double > WorldFromImu
PoseState< double > ImuOnlyDelta
virtual void OnMessage(const Message &msg)
MagReferencePoint(const Vector3d &inImuFrame, const Transformd &worldFromImu, int score)
bool AttachToSensor(SensorDevice *sensor)
CompatibleTypes< Transform< T > >::Type CompatibleType
double WorldFromCameraConfidence
ExposureRecord(UInt32 exposureCounter, double exposureTime, const PoseState< double > &worldFromImu, const PoseState< double > &imuOnlyDelta)
virtual Transform< double > GetVisionPrediction(UInt32 exposureCounter)
void SetVisionPositionEnabled(bool enableVisionPosition)
void SetHeadModel(const Vector3f &headModel, bool resetNeckPivot=true)
void AdvanceByDelta(const PoseState< T > &delta)
virtual bool SupportsMessageType(MessageType type) const
void applyTiltCorrection(double deltaT)
bool MotionTrackingEnabled
Vector3< T > AngularAcceleration
void handleMessage(const MessageBodyFrame &msg)
bool VisionTrackingAvailable
void applyPositionCorrection(double deltaT)
bool VisionPositionEnabled
Quatd MagCorrectionIntegralTerm
SensorFilterBodyFrame FAccelInCameraFrame
virtual void OnVisionSuccess(const Transform< double > &cameraFromImu, UInt32 exposureCounter)
void SetCameraTiltCorrectionEnabled(bool enable)
BodyFrameHandler * pHandler
Transformf GetPoseAtTime(double absoluteTime) const
bool IsCameraTiltCorrectionEnabled() const
Array< MagReferencePoint > MagRefs
Vector3< T > AngularVelocity
void OnMessage(const MessageBodyFrame &msg)
Vector3f GetHeadModel() const
SensorFusion(SensorDevice *sensor=0)
PoseState< double > CameraFromImu
void SetFocusFOV(double rads)
struct ovrSensorState_ ovrSensorState
PoseState< double > VisionError
void applyFocusCorrection(double deltaT)
double GetVisionLatency() const
void applyVisionYawCorrection(double deltaT)
CircularBuffer< ExposureRecord > ExposureRecordHistory
void SetYawCorrectionEnabled(bool enable)
void handleExposure(const MessageExposureFrame &msg)
SensorFilterBodyFrame FAccelInImuFrame
PoseState(const PoseState< typename Math< T >::OtherFloatType > &src)
Vector3< T > LinearVelocity
unsigned int GetStatus() const
virtual void OnVisionSuccess(const Transform< double > &cameraFromImu, UInt32 exposureCounter)=0
void SetUserHeadDimensions(Profile const &profile, HmdRenderInfo const &hmdRenderInfo)
ExposureRecord NextExposureRecord
bool EnableCameraTiltCorrection
bool IsHandlerInstalled() const
ExposureRecord LastVisionExposureRecord
PoseStated computeVisionError()
PoseState< float > PoseStatef
void StoreAndIntegrateAccelerometer(Vector3d linearAccel, double dt)
PoseState< double > WorldFromImu
PoseState(const typename CompatibleTypes< PoseState< T > >::Type &src)
static double OVR_STDCALL GetSeconds()
bool IsMotionTrackingEnabled() const
virtual void OnVisionFailure()
void RemoveHandlerFromDevices()
PoseState< double > State
void SetGravityEnabled(bool enableGravity)
void EnableMotionTracking(bool enable=true)
bool IsGravityEnabled() const
virtual void OnVisionFailure()=0
PoseState< double > PoseStated
MessageExposureFrame LastMessageExposureFrame
virtual Transform< double > GetVisionPrediction(UInt32 exposureCounter)=0
bool IsYawCorrectionEnabled() const
Transformd WorldFromCamera
Vector3< T > LinearAcceleration
void setNeckPivotFromPose(Transformd const &pose)
void applyCameraTiltCorrection(Vector3d accel, double deltaT)
bool IsAttachedToSensor() const