Bike-X  0.8
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
OVR_SensorFusionDebug.h
Go to the documentation of this file.
1 /************************************************************************************
2 
3 PublicHeader: OVR.h
4 Filename : OVR_SensorFusionDebug.h
5 Content : Friend proxy to allow debugging access to SensorFusion
6 Created : April 16, 2014
7 Authors : Dan Gierl
8 
9 Copyright : Copyright 2014 Oculus VR, Inc. All Rights reserved.
10 
11 Licensed under the Oculus VR Rift SDK License Version 3.1 (the "License");
12 you may not use the Oculus VR Rift SDK except in compliance with the License,
13 which is provided at the time of installation or download, or which
14 otherwise accompanies this software in either electronic or hard copy form.
15 
16 You may obtain a copy of the License at
17 
18 http://www.oculusvr.com/licenses/LICENSE-3.1
19 
20 Unless required by applicable law or agreed to in writing, the Oculus VR SDK
21 distributed under the License is distributed on an "AS IS" BASIS,
22 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 See the License for the specific language governing permissions and
24 limitations under the License.
25 
26 *************************************************************************************/
27 
28 #ifndef OVR_SensorFusionDebug_h
29 #define OVR_SensorFusionDebug_h
30 
31 #include "OVR_SensorFusion.h"
32 
33 namespace OVR {
34 
36 {
37 private:
38 
40 
41 public:
42 
44  sf(sf)
45  {
46  }
47 
48  // Returns the number of magnetometer reference points currently gathered
49  int GetNumMagRefPoints () const;
50  // Returns the index of the magnetometer reference point being currently used
51  int GetCurMagRefPointIdx () const;
52  // Returns a copy of all the data associated with a magnetometer reference point
53  // This includes it's score, the magnetometer reading as a vector,
54  // and the HMD's pose at the time it was gathered
55  void GetMagRefData (int idx, int * score, Vector3d * magBF, Quatd * magPose) const;
56 
57 };
58 
59 //------------------------------------------------------------------------------------
60 // Magnetometer reference point access functions
61 
63 {
64  return (int)sf->MagRefs.GetSize();
65 }
66 
68 {
69  return sf->MagRefIdx;
70 }
71 
72 void SensorFusionDebug::GetMagRefData(int idx, int * score, Vector3d * magBF, Quatd * magPose) const
73 {
74  OVR_ASSERT(idx >= 0 && idx < GetNumMagRefPoints());
75  *score = sf->MagRefs[idx].Score;
76  *magBF = sf->MagRefs[idx].InImuFrame;
77  *magPose = sf->MagRefs[idx].WorldFromImu.Rotation;
78 }
79 
80 } // OVR
81 
82 #endif
void GetMagRefData(int idx, int *score, Vector3d *magBF, Quatd *magPose) const
Array< MagReferencePoint > MagRefs
#define OVR_ASSERT(p)
SensorFusionDebug(SensorFusion *const sf)