ovr_sdk

view LibOVR/Src/Tracking/Tracking_SensorStateReader.h @ 0:1b39a1b46319

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