vrpn
07.35
Virtual Reality Peripheral Network
Toggle main menu visibility
Loading...
Searching...
No Matches
vrpn_Tracker_RazerHydra.h
Go to the documentation of this file.
1
13
14
// Copyright Iowa State University 2011.
15
// Distributed under the Boost Software License, Version 1.0.
16
// (See accompanying file LICENSE_1_0.txt or copy at
17
// http://www.boost.org/LICENSE_1_0.txt)
18
19
#pragma once
20
21
// Internal Includes
22
#include "quat.h"
// for q_vec_type
23
#include "
vrpn_Analog.h
"
// for vrpn_Analog
24
#include "
vrpn_Button.h
"
// for vrpn_Button_Filter
25
#include "
vrpn_Tracker.h
"
// for vrpn_Tracker
26
27
// Library/third-party includes
28
// - none
29
30
// Standard includes
31
// - none
32
33
#ifdef VRPN_USE_HID
34
35
#include "
vrpn_HumanInterface.h
"
36
#include "
vrpn_OwningPtr.h
"
37
91
92
class
VRPN_API
vrpn_Tracker_RazerHydra
:
public
vrpn_Analog
,
public
vrpn_Button_Filter
,
public
vrpn_Tracker
93
{
94
public
:
95
vrpn_Tracker_RazerHydra
(
const
char
* name,
vrpn_Connection
* con = NULL);
96
vrpn_Tracker_RazerHydra
(
const
char
* name,
hid_device
* ctrl_dev,
97
hid_device
* data_dev,
98
vrpn_Connection
* con = NULL);
99
vrpn_Tracker_RazerHydra
(
const
char
* name,
const
char
* ctrl_dev_path,
100
const
char
* data_dev_path,
101
vrpn_Connection
* con = NULL);
102
~vrpn_Tracker_RazerHydra
();
103
104
virtual
void
mainloop
();
105
106
virtual
bool
reconnect
();
107
108
private
:
109
void
_shared_init();
110
enum
HydraStatus
111
{
112
HYDRA_WAITING_FOR_CONNECT,
113
HYDRA_LISTENING_AFTER_CONNECT,
114
HYDRA_LISTENING_AFTER_SET_FEATURE,
115
HYDRA_REPORTING
116
};
117
118
enum
119
{
120
ANALOG_CHANNELS = 6,
121
BUTTON_CHANNELS = 14,
122
POSE_CHANNELS = 2
123
};
124
125
void
_swap_channels();
126
void
_waiting_for_connect();
127
void
_listening_after_connect();
128
void
_listening_after_set_feature();
129
130
void
_enter_motion_controller_mode();
131
132
void
_report_for_sensor(
int
sensorNum, vrpn_uint8 * data,
double
dt);
133
134
HydraStatus status;
135
bool
_wasInGamepadMode;
136
int
_attempt;
137
struct
timeval _timestamp;
138
struct
timeval _connected;
139
struct
timeval _set_feature;
140
141
const
float
_docking_distance;
142
bool
_docked[POSE_CHANNELS];
143
bool
_calibration_done[POSE_CHANNELS];
144
int
_mirror[POSE_CHANNELS];
145
int
_sign_x[POSE_CHANNELS];
146
q_vec_type _old_position[POSE_CHANNELS];
147
148
q_type _calibration_pose_conj[POSE_CHANNELS];
149
150
// This device has both a control and a data interface.
151
// On the mac, we may need to swap these because we can't tell which
152
// is which when we open them.
153
class
MyInterface;
154
155
vrpn::OwningPtr<MyInterface>
_ctrl;
156
vrpn::OwningPtr<MyInterface>
_data;
157
};
158
159
#else
160
class
VRPN_API
vrpn_Tracker_RazerHydra
;
161
#endif
162
vrpn::OwningPtr
A unique-ownership smart pointer, with the ability to transfer ownership, but only explicitly (aka,...
Definition
vrpn_OwningPtr.h:74
vrpn_Analog::vrpn_Analog
vrpn_Analog(const char *name, vrpn_Connection *c=NULL)
Definition
vrpn_Analog.C:14
vrpn_BaseClass::mainloop
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_Button_Filter::vrpn_Button_Filter
vrpn_Button_Filter(const char *, vrpn_Connection *c=NULL)
Definition
vrpn_Button.C:129
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition
vrpn_Connection.h:561
vrpn_Tracker_RazerHydra
Device supporting the Razer Hydra game controller as a tracker, analog device, and button device,...
Definition
vrpn_Tracker_RazerHydra.h:93
vrpn_Tracker_RazerHydra::vrpn_Tracker_RazerHydra
vrpn_Tracker_RazerHydra(const char *name, vrpn_Connection *con=NULL)
Definition
vrpn_Tracker_RazerHydra.C:277
vrpn_Tracker_RazerHydra::reconnect
virtual bool reconnect()
Definition
vrpn_Tracker_RazerHydra.C:408
vrpn_Tracker::vrpn_Tracker
vrpn_Tracker(const char *name, vrpn_Connection *c=NULL, const char *tracker_cfg_file_name=NULL)
Definition
vrpn_Tracker.C:45
vrpn_Analog.h
vrpn_Button.h
VRPN_API
#define VRPN_API
Definition
vrpn_Configure.h:648
vrpn_HumanInterface.h
hid_device
struct hid_device_ hid_device
Definition
vrpn_HumanInterface.h:67
vrpn_OwningPtr.h
Header.
vrpn_Tracker.h
vrpn_Tracker_RazerHydra.h
Generated by
1.17.0