RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Tracker_Isotrak.h
1// vrpn_Tracker_Isotrak.h
2// This file contains the code to operate a Polhemus Isotrack Tracker.
3// This file is based on the vrpn_Tracker_Fastrack.C file, with modifications made
4// to allow it to operate a Isotrack instead. The modifications are based
5// on the old version of the Isotrack driver.
6// This version was written in the Spring 2006 by Bruno Herbelin.
7
8
9#ifndef VRPN_TRACKER_ISOTRAK_H
10#define VRPN_TRACKER_ISOTRAK_H
11
12#include <stdio.h> // for NULL
13
14#include "vrpn_Configure.h" // for VRPN_API
15#include "vrpn_Shared.h" // for timeval
16#include "vrpn_Tracker.h" // for vrpn_Tracker_Serial
17
18class VRPN_API vrpn_Button_Server;
19class VRPN_API vrpn_Connection;
20
21
22const int vrpn_ISOTRAK_MAX_STATIONS = 2; // How many stations can exist
23
25
26 public:
27
28 /// The constructor is given the name of the tracker (the name of
29 /// the sender it should use), the connection on which it is to
30 /// send its messages, the name of the serial port it is to open
31 /// (default is /dev/ttyS1 (first serial port in Linux)), the baud
32 /// rate at which it is to communicate (default 19200), whether
33 /// filtering is enabled (default yes), and the number of stations
34 /// that are possible on this Fastrak (default 4). The station select
35 /// switches on the front of the Fastrak determine which stations are
36 /// active. The final parameter is a string that can contain additional
37 /// commands that are set to the tracker as part of its reset routine.
38 /// These might be used to set the hemisphere or other things that are
39 /// not normally included; see the Fastrak manual for a list of these.
40 /// There can be multiple lines of them but putting <CR> into the string.
41
43 const char *port = "/dev/ttyS1", long baud = 19200,
44 int enable_filtering = 1, int numstations = vrpn_ISOTRAK_MAX_STATIONS,
45 const char *additional_reset_commands = NULL);
46
48
49 /// Add a stylus (with button) to one of the sensors.
50 int add_stylus_button(const char *button_device_name, int sensor);
51
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 Isotrak?
60
61 int num_resets; //< How many resets have we tried this time around?
62 char add_reset_cmd[2048]; //< Additional reset commands to be sent
63
64 int set_sensor_output_format(int sensor);
65
66 // An Isotrak can have stylus's with buttons on them
67 vrpn_Button_Server *stylus_buttons[vrpn_ISOTRAK_MAX_STATIONS];
68
69private:
70 void process_binary();
71};
72
73#endif
定义 vrpn_Button.h:99
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_Tracker_Isotrak.h:24
virtual int get_report(void)
virtual void reset()
Reset the tracker.
int add_stylus_button(const char *button_device_name, int sensor)
Add a stylus (with button) to one of the sensors.
vrpn_Tracker_Isotrak(const char *name, vrpn_Connection *c, const char *port="/dev/ttyS1", long baud=19200, int enable_filtering=1, int numstations=vrpn_ISOTRAK_MAX_STATIONS, const char *additional_reset_commands=NULL)
定义 vrpn_Tracker.h:144