Bike-X  0.8
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
OVR::SensorFusion Class Reference

#include "OVR_SensorFusion.h"

Inheritance diagram for OVR::SensorFusion:
Inheritance graph
Collaboration diagram for OVR::SensorFusion:
Collaboration graph

Data Structures

class  BodyFrameHandler
 
struct  ExposureRecord
 
struct  LocklessState
 
struct  MagReferencePoint
 

Public Member Functions

 SensorFusion (SensorDevice *sensor=0)
 
 ~SensorFusion ()
 
bool AttachToSensor (SensorDevice *sensor)
 
bool IsAttachedToSensor () const
 
void SetUserHeadDimensions (Profile const &profile, HmdRenderInfo const &hmdRenderInfo)
 
Transformf GetPoseAtTime (double absoluteTime) const
 
SensorState GetSensorStateAtTime (double absoluteTime) const
 
unsigned int GetStatus () const
 
void Reset ()
 
void EnableMotionTracking (bool enable=true)
 
bool IsMotionTrackingEnabled () const
 
void SetGravityEnabled (bool enableGravity)
 
bool IsGravityEnabled () const
 
bool IsVisionPositionEnabled () const
 
void SetVisionPositionEnabled (bool enableVisionPosition)
 
void SetCameraTiltCorrectionEnabled (bool enable)
 
bool IsCameraTiltCorrectionEnabled () const
 
void OnMessage (const MessageBodyFrame &msg)
 
virtual void OnVisionSuccess (const Transform< double > &cameraFromImu, UInt32 exposureCounter)
 
virtual void OnVisionPreviousFrame (const Transform< double > &cameraFromImu)
 
virtual void OnVisionFailure ()
 
virtual Transform< double > GetVisionPrediction (UInt32 exposureCounter)
 
double GetTime () const
 
double GetVisionLatency () const
 
Vector3f GetHeadModel () const
 
void SetHeadModel (const Vector3f &headModel, bool resetNeckPivot=true)
 
float GetCenterPupilDepth () const
 
void SetCenterPupilDepth (float centerPupilDepth)
 
void SetYawCorrectionEnabled (bool enable)
 
bool IsYawCorrectionEnabled () const
 
void ClearMagReferences ()
 
void SetFocusDirection ()
 
void SetFocusDirection (Vector3d direction)
 
void SetFocusFOV (double rads)
 
void ClearFocus ()
 

Private Types

enum  { MagMaxReferences = 1000 }
 

Private Member Functions

void handleMessage (const MessageBodyFrame &msg)
 
void handleExposure (const MessageExposureFrame &msg)
 
PoseStated computeVisionError ()
 
void applyMagYawCorrection (Vector3d mag, double deltaT)
 
void applyTiltCorrection (double deltaT)
 
void applyVisionYawCorrection (double deltaT)
 
void applyPositionCorrection (double deltaT)
 
void applyCameraTiltCorrection (Vector3d accel, double deltaT)
 
void applyFocusCorrection (double deltaT)
 
void setNeckPivotFromPose (Transformd const &pose)
 

Private Attributes

PoseState< double > WorldFromImu
 
LocklessUpdater< LocklessStateUpdatedState
 
PoseState< double > CameraFromImu
 
PoseState< double > VisionError
 
CircularBuffer< ExposureRecordExposureRecordHistory
 
ExposureRecord LastVisionExposureRecord
 
ExposureRecord NextExposureRecord
 
MessageExposureFrame LastMessageExposureFrame
 
double LastVisionAbsoluteTime
 
unsigned int Stage
 
BodyFrameHandlerpHandler
 
Vector3d FocusDirection
 
double FocusFOV
 
SensorFilterBodyFrame FAccelInImuFrame
 
SensorFilterBodyFrame FAccelInCameraFrame
 
SensorFilterd FAngV
 
Vector3d AccelOffset
 
bool EnableGravity
 
bool EnableYawCorrection
 
bool MagCalibrated
 
Array< MagReferencePointMagRefs
 
int MagRefIdx
 
Quatd MagCorrectionIntegralTerm
 
bool EnableCameraTiltCorrection
 
Transformd WorldFromCamera
 
double WorldFromCameraConfidence
 
bool MotionTrackingEnabled
 
bool VisionPositionEnabled
 
float CenterPupilDepth
 
Transformd ImuFromCpf
 
Transformd ImuFromScreen
 
Transformd CpfFromNeck
 
Transformd WorldFromNeck
 

Friends

class SensorFusionDebug
 

Detailed Description

Definition at line 189 of file OVR_SensorFusion.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
MagMaxReferences 

Definition at line 193 of file OVR_SensorFusion.h.

Constructor & Destructor Documentation

OVR::SensorFusion::SensorFusion ( SensorDevice sensor = 0)

Definition at line 52 of file OVR_SensorFusion.cpp.

OVR::SensorFusion::~SensorFusion ( )

Definition at line 72 of file OVR_SensorFusion.cpp.

Member Function Documentation

void OVR::SensorFusion::applyCameraTiltCorrection ( Vector3d  accel,
double  deltaT 
)
private

Definition at line 608 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::applyFocusCorrection ( double  deltaT)
private

Definition at line 684 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::applyMagYawCorrection ( Vector3d  mag,
double  deltaT 
)
private

Definition at line 510 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::applyPositionCorrection ( double  deltaT)
private

Definition at line 439 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::applyTiltCorrection ( double  deltaT)
private

Definition at line 584 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::applyVisionYawCorrection ( double  deltaT)
private

Definition at line 485 of file OVR_SensorFusion.cpp.

bool OVR::SensorFusion::AttachToSensor ( SensorDevice sensor)

Definition at line 77 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::ClearFocus ( )

Definition at line 742 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::ClearMagReferences ( )
PoseStated OVR::SensorFusion::computeVisionError ( )
private

Definition at line 224 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::EnableMotionTracking ( bool  enable = true)
inline

Definition at line 235 of file OVR_SensorFusion.h.

float OVR::SensorFusion::GetCenterPupilDepth ( ) const

Definition at line 801 of file OVR_SensorFusion.cpp.

Vector3f OVR::SensorFusion::GetHeadModel ( ) const

Definition at line 781 of file OVR_SensorFusion.cpp.

Transformf OVR::SensorFusion::GetPoseAtTime ( double  absoluteTime) const

Definition at line 852 of file OVR_SensorFusion.cpp.

SensorState OVR::SensorFusion::GetSensorStateAtTime ( double  absoluteTime) const

Definition at line 859 of file OVR_SensorFusion.cpp.

unsigned OVR::SensorFusion::GetStatus ( ) const

Definition at line 880 of file OVR_SensorFusion.cpp.

double OVR::SensorFusion::GetTime ( ) const
inline

Definition at line 533 of file OVR_SensorFusion.h.

double OVR::SensorFusion::GetVisionLatency ( ) const
inline

Definition at line 528 of file OVR_SensorFusion.h.

Transform< double > OVR::SensorFusion::GetVisionPrediction ( UInt32  exposureCounter)
virtual

Implements OVR::VisionHandler.

Definition at line 240 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::handleExposure ( const MessageExposureFrame msg)
private

Definition at line 398 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::handleMessage ( const MessageBodyFrame msg)
private

Definition at line 285 of file OVR_SensorFusion.cpp.

bool OVR::SensorFusion::IsAttachedToSensor ( ) const
inline

Definition at line 483 of file OVR_SensorFusion.h.

bool OVR::SensorFusion::IsCameraTiltCorrectionEnabled ( ) const
inline

Definition at line 523 of file OVR_SensorFusion.h.

bool OVR::SensorFusion::IsGravityEnabled ( ) const
inline

Definition at line 493 of file OVR_SensorFusion.h.

bool OVR::SensorFusion::IsMotionTrackingEnabled ( ) const
inline

Definition at line 236 of file OVR_SensorFusion.h.

bool OVR::SensorFusion::IsVisionPositionEnabled ( ) const
inline

Definition at line 508 of file OVR_SensorFusion.h.

bool OVR::SensorFusion::IsYawCorrectionEnabled ( ) const
inline

Definition at line 503 of file OVR_SensorFusion.h.

void OVR::SensorFusion::OnMessage ( const MessageBodyFrame msg)

Definition at line 887 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::OnVisionFailure ( )
virtual

Implements OVR::VisionHandler.

Definition at line 158 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::OnVisionPreviousFrame ( const Transform< double > &  cameraFromImu)
virtual

Implements OVR::VisionHandler.

Definition at line 164 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::OnVisionSuccess ( const Transform< double > &  cameraFromImu,
UInt32  exposureCounter 
)
virtual

Implements OVR::VisionHandler.

Definition at line 172 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::Reset ( )

Definition at line 125 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::SetCameraTiltCorrectionEnabled ( bool  enable)
inline

Definition at line 518 of file OVR_SensorFusion.h.

void OVR::SensorFusion::SetCenterPupilDepth ( float  centerPupilDepth)

Definition at line 806 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::SetFocusDirection ( )

Definition at line 726 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::SetFocusDirection ( Vector3d  direction)

Definition at line 731 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::SetFocusFOV ( double  rads)

Definition at line 736 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::SetGravityEnabled ( bool  enableGravity)
inline

Definition at line 488 of file OVR_SensorFusion.h.

void OVR::SensorFusion::SetHeadModel ( const Vector3f headModel,
bool  resetNeckPivot = true 
)

Definition at line 786 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::setNeckPivotFromPose ( Transformd const &  pose)
private

Definition at line 412 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::SetUserHeadDimensions ( Profile const &  profile,
HmdRenderInfo const &  hmdRenderInfo 
)

Definition at line 752 of file OVR_SensorFusion.cpp.

void OVR::SensorFusion::SetVisionPositionEnabled ( bool  enableVisionPosition)
inline

Definition at line 513 of file OVR_SensorFusion.h.

void OVR::SensorFusion::SetYawCorrectionEnabled ( bool  enable)
inline

Definition at line 498 of file OVR_SensorFusion.h.

Friends And Related Function Documentation

friend class SensorFusionDebug
friend

Definition at line 191 of file OVR_SensorFusion.h.

Field Documentation

Vector3d OVR::SensorFusion::AccelOffset
private

Definition at line 419 of file OVR_SensorFusion.h.

PoseState<double> OVR::SensorFusion::CameraFromImu
private

Definition at line 388 of file OVR_SensorFusion.h.

float OVR::SensorFusion::CenterPupilDepth
private

Definition at line 441 of file OVR_SensorFusion.h.

Transformd OVR::SensorFusion::CpfFromNeck
private

Definition at line 447 of file OVR_SensorFusion.h.

bool OVR::SensorFusion::EnableCameraTiltCorrection
private

Definition at line 429 of file OVR_SensorFusion.h.

bool OVR::SensorFusion::EnableGravity
private

Definition at line 421 of file OVR_SensorFusion.h.

bool OVR::SensorFusion::EnableYawCorrection
private

Definition at line 423 of file OVR_SensorFusion.h.

CircularBuffer<ExposureRecord> OVR::SensorFusion::ExposureRecordHistory
private

Definition at line 399 of file OVR_SensorFusion.h.

SensorFilterBodyFrame OVR::SensorFusion::FAccelInCameraFrame
private

Definition at line 416 of file OVR_SensorFusion.h.

SensorFilterBodyFrame OVR::SensorFusion::FAccelInImuFrame
private

Definition at line 416 of file OVR_SensorFusion.h.

SensorFilterd OVR::SensorFusion::FAngV
private

Definition at line 417 of file OVR_SensorFusion.h.

Vector3d OVR::SensorFusion::FocusDirection
private

Definition at line 413 of file OVR_SensorFusion.h.

double OVR::SensorFusion::FocusFOV
private

Definition at line 414 of file OVR_SensorFusion.h.

Transformd OVR::SensorFusion::ImuFromCpf
private

Definition at line 443 of file OVR_SensorFusion.h.

Transformd OVR::SensorFusion::ImuFromScreen
private

Definition at line 445 of file OVR_SensorFusion.h.

MessageExposureFrame OVR::SensorFusion::LastMessageExposureFrame
private

Definition at line 406 of file OVR_SensorFusion.h.

double OVR::SensorFusion::LastVisionAbsoluteTime
private

Definition at line 408 of file OVR_SensorFusion.h.

ExposureRecord OVR::SensorFusion::LastVisionExposureRecord
private

Definition at line 401 of file OVR_SensorFusion.h.

bool OVR::SensorFusion::MagCalibrated
private

Definition at line 424 of file OVR_SensorFusion.h.

Quatd OVR::SensorFusion::MagCorrectionIntegralTerm
private

Definition at line 427 of file OVR_SensorFusion.h.

int OVR::SensorFusion::MagRefIdx
private

Definition at line 426 of file OVR_SensorFusion.h.

Array<MagReferencePoint> OVR::SensorFusion::MagRefs
private

Definition at line 425 of file OVR_SensorFusion.h.

bool OVR::SensorFusion::MotionTrackingEnabled
private

Definition at line 434 of file OVR_SensorFusion.h.

ExposureRecord OVR::SensorFusion::NextExposureRecord
private

Definition at line 404 of file OVR_SensorFusion.h.

BodyFrameHandler* OVR::SensorFusion::pHandler
private

Definition at line 411 of file OVR_SensorFusion.h.

unsigned int OVR::SensorFusion::Stage
private

Definition at line 410 of file OVR_SensorFusion.h.

LocklessUpdater<LocklessState> OVR::SensorFusion::UpdatedState
private

Definition at line 385 of file OVR_SensorFusion.h.

PoseState<double> OVR::SensorFusion::VisionError
private

Definition at line 396 of file OVR_SensorFusion.h.

bool OVR::SensorFusion::VisionPositionEnabled
private

Definition at line 435 of file OVR_SensorFusion.h.

Transformd OVR::SensorFusion::WorldFromCamera
private

Definition at line 431 of file OVR_SensorFusion.h.

double OVR::SensorFusion::WorldFromCameraConfidence
private

Definition at line 432 of file OVR_SensorFusion.h.

PoseState<double> OVR::SensorFusion::WorldFromImu
private

Definition at line 381 of file OVR_SensorFusion.h.

Transformd OVR::SensorFusion::WorldFromNeck
private

Definition at line 449 of file OVR_SensorFusion.h.


The documentation for this class was generated from the following files: