vrpn 07.35
Virtual Reality Peripheral Network
Loading...
Searching...
No Matches
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
26
27const int vrpn_FASTRAK_MAX_STATIONS = 4; //< How many stations can exist
28
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
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
Analog server that can scale and clip its range to -1..1.
Definition: vrpn_Analog.h:130
Generic connection class not specific to the transport mechanism.
virtual void reset(void)=0
Reset the tracker.
virtual int get_report(void)=0
Gets a report if one is available, returns 0 if not, 1 if complete report.
#define VRPN_API
const int vrpn_FASTRAK_MAX_STATIONS