RflySimSDK
v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
simulink
vrpn
vrpn_Flock.h
1
#ifndef FLOCK_H
2
#define FLOCK_H
3
4
#include "vrpn_Configure.h"
// for VRPN_API
5
#include "vrpn_Shared.h"
// for timeval
6
#include "vrpn_Tracker.h"
// for vrpn_Tracker_Serial
7
8
class
VRPN_API
vrpn_Connection
;
9
10
// only 13 receivers allowed in normal addressing mode
11
#define VRPN_FLOCK_MAX_SENSORS 13
12
13
// This is a class which provides a server for an Ascension
14
// Flock of Birds tracker. The server will send out messages
15
// at whatever rate the flock of bird's stream mode feeds them.
16
// Default filtering is active.
17
// The timestamp is the time when the first character was read
18
// from the serial driver with "read". No adjustment is currently
19
// made to this time stamp.
20
21
// Adelstein, et al, "Dynamic response of electromagnetic spatial
22
// displacement trackers", Presence 5(3) found that if all of the filters
23
// are turned off, and the time required to transport the data to the
24
// server is ignored, then the latency of the flock is about 2 ms for ori,
25
// 7.5 ms for pos for the 0-4hz range (ie, when the data is ready to leave
26
// the flock in stream mode, the pos is 7.5 ms old, and the ori is 2 ms
27
// old). Later this data will be combined with the baud rate to provide a
28
// more accurate time stamp for certain flock modes.
29
30
// If this is running on a non-linux system, then the serial port driver
31
// is probably adding more latency -- see the vrpn README for more info.
32
33
// The FOB now doesn't need to be used in a chain starting with an Exteded
34
// range controller. You may use the optionnal useERT to set whether this
35
// is the case or not. Added by David Nahon, for Virtools VR Pack,
36
// david@z-a.net, support@virtools.com
37
38
class
VRPN_API
vrpn_Tracker_Flock
:
public
vrpn_Tracker_Serial
{
39
40
public
:
41
vrpn_Tracker_Flock
(
char
*name,
vrpn_Connection
*c,
int
cSensors=1,
42
const
char
*port =
"/dev/ttyd3"
,
long
baud = 38400,
43
int
fStreamMode = 1,
int
useERT=1,
bool
invertQuaternion =
false
,
int
active_hemisphere=HEMI_PLUSZ);
44
virtual
~vrpn_Tracker_Flock
();
45
46
enum
{HEMI_PLUSX, HEMI_MINUSX, HEMI_PLUSY, HEMI_MINUSY, HEMI_PLUSZ, HEMI_MINUSZ};
47
48
protected
:
49
50
int
activeHemisphere;
51
52
virtual
int
get_report
(
void
);
53
virtual
void
send_report(
void
);
54
virtual
void
reset
();
55
void
printError(
unsigned
char
uchErrCode,
unsigned
char
uchExpandedErrCode);
56
int
checkError();
57
int
cSensors;
58
int
fStream;
// stream or polled mode
59
int
fGroupMode;
// for get_report -- group report mode or individual
60
61
int
d_useERT;
// do we have an extended range transmitter, this was the default
62
bool
d_invertQuaternion;
// Do we invert the Quaternion before returning it?
63
64
// class members used to help with error recovery
65
unsigned
cResets;
66
unsigned
cSyncs;
67
68
// class members used for statistics only
69
int
fFirstStatusReport;
70
struct
timeval tvLastStatusReport;
71
int
cReports;
72
int
cStatusInterval;
73
double
getMeasurementRate();
74
};
75
76
#endif
vrpn_Connection
Generic connection class not specific to the transport mechanism.
定义
vrpn_Connection.h:562
vrpn_Tracker_Flock
定义
vrpn_Flock.h:38
vrpn_Tracker_Flock::get_report
virtual int get_report(void)
vrpn_Tracker_Flock::reset
virtual void reset()
Reset the tracker.
vrpn_Tracker_Serial
定义
vrpn_Tracker.h:144
制作者
1.11.0