RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Tracker_Liberty.h
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
18class VRPN_API vrpn_Button_Server;
19class VRPN_API vrpn_Connection;
20
21const int vrpn_LIBERTY_MAX_STATIONS = 8; //< How many stations can exist
22const int vrpn_LIBERTY_MAX_WHOAMI_LEN = 1024; //< Maximum whoami response length
23
25
26 public:
27
41
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
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.h:99
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_Tracker_Liberty.h:24
vrpn_Tracker_Liberty(const char *name, vrpn_Connection *c, const char *port="/dev/ttyS0", long baud=115200, int enable_filtering=1, int numstations=vrpn_LIBERTY_MAX_STATIONS, const char *additional_reset_commands=NULL, int whoamilen=195)
int add_stylus_button(const char *button_device_name, int sensor, int numbuttons=1)
Add a stylus (with button) to one of the sensors.
virtual int get_report(void)
int set_sensor_output_format(int sensor)
Augments the basic Liberty format
virtual void reset()
Reset the tracker.
int report_length(int sensor)
Augments the basic Liberty report length
定义 vrpn_Tracker.h:144