|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
19 #ifndef YARP_OVRHEADSET_OVRHEADSET_H
20 #define YARP_OVRHEADSET_OVRHEADSET_H
34 #include <OVR_CAPI_GL.h>
41 namespace yarp {
namespace os {
template <
typename T>
class BufferedPort; }}
42 namespace yarp {
namespace os {
class Bottle; }}
107 bool getHatCount(
unsigned int& Hat_count)
override;
110 bool getStickDoF(
unsigned int stick_id,
unsigned int& DoF)
override;
111 bool getButton(
unsigned int button_id,
float& value)
override;
113 bool getHat(
unsigned int hat_id,
unsigned char& value)
override;
114 bool getAxis(
unsigned int axis_id,
double& value)
override;
122 bool createWindow(
int w,
int h);
123 void onKey(
int key,
int scancode,
int action,
int mods);
124 void reconfigureRendering();
125 void reconfigureFOV();
127 static void glfwKeyCallback(GLFWwindow* window,
int key,
int scancode,
int action,
int mods);
128 static void glfwErrorCallback(
int error,
const char* description);
129 static void ovrDebugCallback(uintptr_t userData,
int level,
const char* message);
130 static void DebugHmd(ovrHmdDesc hmdDesc);
131 void errorManager(ovrResult error);
132 void fillAxisStorage();
133 void fillErrorStorage();
134 void fillButtonStorage();
135 void fillHatStorage();
153 std::vector<guiParam> huds;
155 ovrEyeRenderDesc EyeRenderDesc[2];
157 ovrLayerQuad logoLayer;
159 ovrLayerQuad crosshairsLayer;
161 ovrLayerQuad batteryLayer;
162 ovrMirrorTexture mirrorTexture{
nullptr };
163 GLuint mirrorFBO{ 0 };
166 GLFWwindow* window{
nullptr };
168 ovrPoseStatef headpose;
169 ovrPoseStatef predicted_headpose;
170 unsigned int guiCount;
171 bool guiEnabled{
true };
172 std::mutex inputStateMutex;
173 ovrInputState inputState;
174 bool inputStateError{
false };
176 std::vector<ovrButton> buttonIdToOvrButton;
177 std::vector<float*> axisIdToValue;
178 std::map<int, int> DButtonToHat;
179 std::map<ovrResult, std::string> error_messages;
183 std::string left_frame;
184 std::string right_frame;
185 std::string root_frame;
188 bool closed{
false };
189 long long distortionFrameIndex{ 0 };
191 unsigned int texWidth;
192 unsigned int texHeight;
198 bool flipInputEnabled{
false };
199 bool imagePoseEnabled{
true };
200 bool userPoseEnabled{
false };
203 bool logoEnabled{
true };
204 bool crosshairsEnabled{
true };
205 bool batteryEnabled{
true };
215 #endif // YARP_OVRHEADSET_OVRHEADSET_H
JoypadCtrl_coordinateMode
bool getTouch(unsigned int touch_id, yarp::sig::Vector &value) override
Get the value of a touch if present, return false otherwise.
bool getAxis(unsigned int axis_id, double &value) override
Get the value of an axis if present, return false otherwise.
virtual bool startService()
Initiate the service, whatever it is.
A base class for nested structures that can be searched.
bool getAxisCount(unsigned int &axis_count) override
Get number of Axes.
bool getHat(unsigned int hat_id, unsigned char &value) override
Get the value of an Hat.
Interface implemented by all device drivers.
virtual bool stopService()
Shut down the service, whatever it is.
bool getButton(unsigned int button_id, float &value) override
Get the value of a button.
bool getButtonCount(unsigned int &button_count) override
Get number of Buttons.
virtual bool open(yarp::os::Searchable &cfg)
Open the DeviceDriver.
bool getTrackballCount(unsigned int &Trackball_count) override
Get number of trackballs.
A container for a device driver.
virtual bool updateService()
Give the service the chance to run for a while.
Common interface for devices that act like services (by which we mean they do something for remote us...
bool getStickDoF(unsigned int stick_id, unsigned int &DoF) override
Get the Degree Of Freedom count for desired stick.
bool getStick(unsigned int stick_id, yarp::sig::Vector &value, JoypadCtrl_coordinateMode coordinate_mode) override
Get the value of a stick if present, return false otherwise.
An abstraction for a periodic thread.
bool getTouchSurfaceCount(unsigned int &touch_count) override
get the number of touch surface.
bool getTrackball(unsigned int trackball_id, yarp::sig::Vector &value) override
Get the axes change of a Trackball.
virtual void run()
Loop function.
virtual void threadRelease()
Release method.
ovrheadset: Device that manages the Oculus Rift Headset.
bool getHatCount(unsigned int &Hat_count) override
Get number of Hats.
The main, catch-all namespace for YARP.
virtual bool threadInit()
Initialization method.
bool getStickCount(unsigned int &stick_count) override
get the number of the sticks
virtual bool close()
Close the DeviceDriver.