vrpn
07.35
Virtual Reality Peripheral Network
Loading...
Searching...
No Matches
vrpn_Tracker_Liberty.h
Go to the documentation of this file.
1
// vrpn_Tracker_Liberty.h
2
// This file contains the class header for a Polhemus Liberty Tracker.
3
// This file is based on the vrpn_Tracker_Fastrak.h file, with modifications made
4
// to allow it to operate a Liberty instead.
5
// It has been tested on Linux and relies on being able to open the USB
6
// port as a named port and using serial commands to communicate with it.
7
8
#ifndef VRPN_TRACKER_LIBERTY_H
9
#define VRPN_TRACKER_LIBERTY_H
10
11
#include <stdio.h>
// for NULL
12
13
#include "
vrpn_Configure.h
"
// for VRPN_API
14
#include "
vrpn_Shared.h
"
// for timeval
15
#include "
vrpn_Tracker.h
"
// for vrpn_Tracker_Serial
16
#include "
vrpn_Types.h
"
// for vrpn_uint32
17
18
class
VRPN_API
vrpn_Button_Server
;
19
class
VRPN_API
vrpn_Connection
;
20
21
const
int
vrpn_LIBERTY_MAX_STATIONS
= 8;
//< How many stations can exist
22
const
int
vrpn_LIBERTY_MAX_WHOAMI_LEN
= 1024;
//< Maximum whoami response length
23
24
class
VRPN_API
vrpn_Tracker_Liberty
:
public
vrpn_Tracker_Serial
{
25
26
public
:
27
41
42
vrpn_Tracker_Liberty
(
const
char
*name,
vrpn_Connection
*c,
43
const
char
*port =
"/dev/ttyS0"
,
long
baud = 115200,
44
int
enable_filtering = 1,
int
numstations =
vrpn_LIBERTY_MAX_STATIONS
,
45
const
char
*additional_reset_commands = NULL,
int
whoamilen = 195);
46
47
~vrpn_Tracker_Liberty
();
48
50
int
add_stylus_button(
const
char
*button_device_name,
51
int
sensor,
int
numbuttons = 1);
52
protected
:
53
54
virtual
int
get_report
(
void
);
55
virtual
void
reset
();
56
57
struct
timeval reset_time;
58
int
do_filter
;
//< Should we turn on filtering for pos/orient?
59
int
num_stations
;
//< How many stations maximum on this Liberty?
60
int
num_resets
;
//< How many resets we've tried this time.
61
char
add_reset_cmd[2048];
//< Additional reset commands to be sent
62
int
whoami_len
;
63
int
got_single_sync_char
;
64
65
struct
timeval liberty_zerotime;
//< When the liberty time counter was zeroed
66
struct
timeval liberty_timestamp;
//< The time returned from the Liberty System
67
vrpn_uint32
REPORT_LEN
;
//< The length that the current report should be
68
69
vrpn_Button_Server
*stylus_buttons[
vrpn_LIBERTY_MAX_STATIONS
];
//< Pointer to button on each sensor (NULL if none)
70
72
int
set_sensor_output_format(
int
sensor);
73
75
int
report_length(
int
sensor);
76
};
77
78
#endif
vrpn_Button_Server
Definition
vrpn_Button.h:99
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition
vrpn_Connection.h:561
vrpn_Tracker_Liberty
Definition
vrpn_Tracker_Liberty.h:24
vrpn_Tracker_Liberty::num_resets
int num_resets
Definition
vrpn_Tracker_Liberty.h:60
vrpn_Tracker_Liberty::do_filter
int do_filter
Definition
vrpn_Tracker_Liberty.h:58
vrpn_Tracker_Liberty::whoami_len
int whoami_len
Definition
vrpn_Tracker_Liberty.h:62
vrpn_Tracker_Liberty::got_single_sync_char
int got_single_sync_char
Definition
vrpn_Tracker_Liberty.h:63
vrpn_Tracker_Liberty::REPORT_LEN
vrpn_uint32 REPORT_LEN
Definition
vrpn_Tracker_Liberty.h:67
vrpn_Tracker_Liberty::num_stations
int num_stations
Definition
vrpn_Tracker_Liberty.h:59
vrpn_Tracker_Serial
Definition
vrpn_Tracker.h:144
vrpn_Tracker_Serial::reset
virtual void reset(void)=0
Reset the tracker.
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_Configure.h
VRPN_API
#define VRPN_API
Definition
vrpn_Configure.h:648
vrpn_Shared.h
vrpn_Tracker.h
vrpn_LIBERTY_MAX_STATIONS
const int vrpn_LIBERTY_MAX_STATIONS
Definition
vrpn_Tracker_Liberty.h:21
vrpn_LIBERTY_MAX_WHOAMI_LEN
const int vrpn_LIBERTY_MAX_WHOAMI_LEN
Definition
vrpn_Tracker_Liberty.h:22
vrpn_Types.h
vrpn_Tracker_Liberty.h
Generated by
1.9.8