rev |
line source |
nuclear@0
|
1 /************************************************************************************
|
nuclear@0
|
2
|
nuclear@0
|
3 Filename : Tracking_SensorStateReader.h
|
nuclear@0
|
4 Content : Separate reader component that is able to recover sensor pose
|
nuclear@0
|
5 Created : June 4, 2014
|
nuclear@0
|
6 Authors : Chris Taylor
|
nuclear@0
|
7
|
nuclear@0
|
8 Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
|
nuclear@0
|
9
|
nuclear@0
|
10 Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
|
nuclear@0
|
11 you may not use the Oculus VR Rift SDK except in compliance with the License,
|
nuclear@0
|
12 which is provided at the time of installation or download, or which
|
nuclear@0
|
13 otherwise accompanies this software in either electronic or hard copy form.
|
nuclear@0
|
14
|
nuclear@0
|
15 You may obtain a copy of the License at
|
nuclear@0
|
16
|
nuclear@0
|
17 http://www.oculusvr.com/licenses/LICENSE-3.2
|
nuclear@0
|
18
|
nuclear@0
|
19 Unless required by applicable law or agreed to in writing, the Oculus VR SDK
|
nuclear@0
|
20 distributed under the License is distributed on an "AS IS" BASIS,
|
nuclear@0
|
21 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
nuclear@0
|
22 See the License for the specific language governing permissions and
|
nuclear@0
|
23 limitations under the License.
|
nuclear@0
|
24
|
nuclear@0
|
25 *************************************************************************************/
|
nuclear@0
|
26
|
nuclear@0
|
27 #ifndef Tracking_SensorStateReader_h
|
nuclear@0
|
28 #define Tracking_SensorStateReader_h
|
nuclear@0
|
29
|
nuclear@0
|
30 #include "../Kernel/OVR_Lockless.h"
|
nuclear@0
|
31 #include "Tracking_SensorState.h"
|
nuclear@0
|
32
|
nuclear@0
|
33 #include "../OVR_Profile.h"
|
nuclear@0
|
34
|
nuclear@0
|
35 namespace OVR { namespace Tracking {
|
nuclear@0
|
36
|
nuclear@0
|
37
|
nuclear@0
|
38 //-----------------------------------------------------------------------------
|
nuclear@0
|
39 // SensorStateReader
|
nuclear@0
|
40
|
nuclear@0
|
41 // User interface to retrieve pose from the sensor fusion subsystem
|
nuclear@0
|
42 class SensorStateReader : public NewOverrideBase
|
nuclear@0
|
43 {
|
nuclear@0
|
44 protected:
|
nuclear@0
|
45 const CombinedSharedStateUpdater *Updater;
|
nuclear@0
|
46
|
nuclear@0
|
47
|
nuclear@0
|
48 // Last latency warning time
|
nuclear@0
|
49 mutable double LastLatWarnTime;
|
nuclear@0
|
50
|
nuclear@0
|
51 // Transform from real-world coordinates to centered coordinates
|
nuclear@0
|
52 Posed CenteredFromWorld;
|
nuclear@0
|
53
|
nuclear@0
|
54 public:
|
nuclear@0
|
55 SensorStateReader();
|
nuclear@0
|
56
|
nuclear@0
|
57 // Initialize the updater
|
nuclear@0
|
58 void SetUpdater(const CombinedSharedStateUpdater *updater);
|
nuclear@0
|
59
|
nuclear@0
|
60 // Re-centers on the current yaw (optionally pitch) and translation
|
nuclear@0
|
61 void RecenterPose();
|
nuclear@0
|
62
|
nuclear@0
|
63 // Get the full dynamical system state of the CPF, which includes velocities and accelerations,
|
nuclear@0
|
64 // predicted at a specified absolute point in time.
|
nuclear@0
|
65 bool GetSensorStateAtTime(double absoluteTime, Tracking::TrackingState& state) const;
|
nuclear@0
|
66
|
nuclear@0
|
67 // Get the predicted pose (orientation, position) of the center pupil frame (CPF) at a specific point in time.
|
nuclear@0
|
68 bool GetPoseAtTime(double absoluteTime, Posef& transform) const;
|
nuclear@0
|
69
|
nuclear@0
|
70 // Get the sensor status (same as GetSensorStateAtTime(...).Status)
|
nuclear@0
|
71 uint32_t GetStatus() const;
|
nuclear@0
|
72
|
nuclear@0
|
73 const Posed getCenteredFromWorld()
|
nuclear@0
|
74 {
|
nuclear@0
|
75 return CenteredFromWorld;
|
nuclear@0
|
76 }
|
nuclear@0
|
77
|
nuclear@0
|
78 void setCenteredFromWorld(const Posed _CenteredFromWorld)
|
nuclear@0
|
79 {
|
nuclear@0
|
80 CenteredFromWorld = _CenteredFromWorld;
|
nuclear@0
|
81 }
|
nuclear@0
|
82 };
|
nuclear@0
|
83
|
nuclear@0
|
84
|
nuclear@0
|
85 }} // namespace OVR::Tracking
|
nuclear@0
|
86
|
nuclear@0
|
87 #endif // Tracking_SensorStateReader_h
|