vrpn
07.33
Virtual Reality Peripheral Network
vrpn_Tracker_Fastrak.h
Go to the documentation of this file.
1
// vrpn_Tracker_Fastrak.h
2
// This file contains the class header for a Polhemus Fastrak Tracker.
3
// This file is based on the vrpn_3Space.h file, with modifications made
4
// to allow it to operate a Fastrak instead. The modifications are based
5
// on the old version of the Fastrak driver, which had been mainly copied
6
// from the Trackerlib driver and was very difficult to understand.
7
// This version was written in the Summer of 1999 by Russ Taylor.
8
// Later, it was updated to allow the extended reset commands needed
9
// to drive an IS-600 tracker.
10
// Later (Summer of 2000), it was augmented to allow the button, analog,
11
// and timestamp capabilities of the InterSense IS-900 tracker.
12
13
#ifndef VRPN_TRACKER_FASTRAK_H
14
#define VRPN_TRACKER_FASTRAK_H
15
16
#include <stdio.h>
// for NULL
17
18
#include "
vrpn_Configure.h
"
// for VRPN_API
19
#include "
vrpn_Shared.h
"
// for timeval
20
#include "
vrpn_Tracker.h
"
// for vrpn_Tracker_Serial
21
#include "
vrpn_Types.h
"
// for vrpn_uint32
22
23
class
VRPN_API
vrpn_Button_Server
;
24
class
VRPN_API
vrpn_Clipping_Analog_Server
;
25
class
VRPN_API
vrpn_Connection
;
26
27
const
int
vrpn_FASTRAK_MAX_STATIONS
= 4;
//< How many stations can exist
28
29
class
VRPN_API
vrpn_Tracker_Fastrak
:
public
vrpn_Tracker_Serial
{
30
31
public
:
32
46
47
vrpn_Tracker_Fastrak
(
const
char
*name,
vrpn_Connection
*c,
48
const
char
*port =
"/dev/ttyS1"
,
long
baud = 19200,
49
int
enable_filtering = 1,
int
numstations =
vrpn_FASTRAK_MAX_STATIONS
,
50
const
char
*additional_reset_commands = NULL,
51
int
is900_timestamps = 0);
52
53
~
vrpn_Tracker_Fastrak
();
54
55
// is the version modified (debug@cs.unc.edu, 5/20/01) to handle Pol.Fastrak stylus buttons
56
int
add_fastrak_stylus_button(
const
char
*button_device_name,
57
int
sensor,
int
numbuttons = 1);
58
61
int
add_is900_button(
const
char
*button_device_name,
int
sensor,
int
numbuttons = 5);
62
67
int
add_is900_analog(
const
char
*analog_device_name,
int
sensor,
68
double
c0Min = -1,
double
c0Low = 0,
double
c0Hi = 0,
double
c0Max = 1,
69
double
c1Min = -1,
double
c1Low = 0,
double
c1Hi = 0,
double
c1Max = 1);
70
71
protected
:
72
73
virtual
int
get_report
(
void
);
74
virtual
void
reset
();
75
76
struct
timeval reset_time;
77
int
do_filter
;
//< Should we turn on filtering for pos/orient?
78
int
num_stations
;
//< How many stations maximum on this Fastrak?
79
char
add_reset_cmd[2048];
//< Additional reset commands to be sent
80
int
num_resets
;
//< How many resets we have tried.
81
82
// another modification by Debug, 5/23/01
83
bool
really_fastrak
;
// to distinguish it from intersense when using buttons!!!
84
85
// The following members provide support for the InterSense IS-900 features
86
// that are beyond the standard Fastrak features.
87
88
int
do_is900_timestamps
;
//< Request and process IS-900 timestamps?
89
struct
timeval is900_zerotime;
//< When the IS-900 time counter was zeroed
90
vrpn_Button_Server
*is900_buttons[
vrpn_FASTRAK_MAX_STATIONS
];
//< Pointer to button on each sensor (NULL if none)
91
vrpn_Clipping_Analog_Server
*is900_analogs[
vrpn_FASTRAK_MAX_STATIONS
];
//< Pointer to analog on each sensor (NULL if none)
92
vrpn_uint32
REPORT_LEN
;
//< The length that the current report should be
93
95
int
set_sensor_output_format(
int
sensor);
96
98
int
report_length(
int
sensor);
99
};
100
101
#endif
vrpn_Tracker.h
vrpn_Types.h
vrpn_FASTRAK_MAX_STATIONS
const int vrpn_FASTRAK_MAX_STATIONS
Definition:
vrpn_Tracker_Fastrak.h:27
vrpn_Clipping_Analog_Server
Analog server that can scale and clip its range to -1..1.
Definition:
vrpn_Analog.h:130
vrpn_Tracker_Fastrak::do_filter
int do_filter
Definition:
vrpn_Tracker_Fastrak.h:77
vrpn_Tracker_Fastrak::do_is900_timestamps
int do_is900_timestamps
Definition:
vrpn_Tracker_Fastrak.h:88
vrpn_Tracker_Fastrak::num_resets
int num_resets
Definition:
vrpn_Tracker_Fastrak.h:80
vrpn_Button_Server
Definition:
vrpn_Button.h:98
vrpn_Shared.h
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition:
vrpn_Connection.h:510
vrpn_Tracker_Serial
Definition:
vrpn_Tracker.h:144
vrpn_Tracker_Fastrak
Definition:
vrpn_Tracker_Fastrak.h:29
vrpn_Configure.h
vrpn_Tracker_Fastrak::REPORT_LEN
vrpn_uint32 REPORT_LEN
Definition:
vrpn_Tracker_Fastrak.h:92
vrpn_Tracker_Fastrak::really_fastrak
bool really_fastrak
Definition:
vrpn_Tracker_Fastrak.h:83
vrpn_Tracker_Fastrak::num_stations
int num_stations
Definition:
vrpn_Tracker_Fastrak.h:78
VRPN_API
#define VRPN_API
Definition:
vrpn_Configure.h:646
vrpn_Tracker_Serial::get_report
virtual int get_report(void)=0
Gets a report if one is available, returns 0 if not, 1 if complete report.
vrpn_Tracker_Serial::reset
virtual void reset(void)=0
Reset the tracker.
vrpn_Tracker_Fastrak.h
Generated by
1.8.16