RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Tracker_LibertyHS.h
1// vrpn_Tracker_LibertyHS.h
2// This file contains the class header for a High Speed Polhemus Liberty
3// Latus Tracker.
4// This file is based on the vrpn_Tracker_Liberty.h file, with modifications made
5// to allow it to operate a Liberty Latus instead. It has been tested on Linux.
6
7#ifndef VRPN_TRACKER_LIBERTYHS_H
8#define VRPN_TRACKER_LIBERTYHS_H
9
10#include <stdio.h> // for NULL
11
12#include "vrpn_Configure.h" // for VRPN_API, etc
13#include "vrpn_Shared.h" // for timeval
14#include "vrpn_Tracker.h" // for vrpn_Tracker_USB
15#include "vrpn_Types.h" // for vrpn_uint16, vrpn_uint8, etc
16
17class VRPN_API vrpn_Connection;
18
19#if defined(VRPN_USE_LIBUSB_1_0)
20
21// Vendor and product IDs for High Speed Liberty Latus tracker
22static const vrpn_uint16 LIBERTYHS_VENDOR_ID = 0x0f44;
23static const vrpn_uint16 LIBERTYHS_PRODUCT_ID = 0xff20;
24
25// Endpoints to communicate with the USB device
26static const vrpn_uint8 LIBERTYHS_WRITE_EP = 0x04;
27static const vrpn_uint8 LIBERTYHS_READ_EP = 0x88;
28
29const int vrpn_LIBERTYHS_MAX_STATIONS = 8; //< How many stations (i.e. markers) can exist
30const int vrpn_LIBERTYHS_MAX_WHOAMI_LEN = 1024; //< Maximum whoami response length
31const int vrpn_LIBERTYHS_MAX_MARKERMAP_LEN = 12; //< Maximum active marker map response length
32
33
34class VRPN_API vrpn_Tracker_LibertyHS: public vrpn_Tracker_USB {
35
36 public:
37
49
50 vrpn_Tracker_LibertyHS(const char *name, vrpn_Connection *c,
51 long baud = 115200, int enable_filtering = 1,
52 int numstations = vrpn_LIBERTYHS_MAX_STATIONS,
53 int receptoridx = 1, const char *additional_reset_commands = NULL,
54 int whoamilen = 288);
55
56 ~vrpn_Tracker_LibertyHS();
57
58 protected:
59
60 virtual int get_report(void);
61 virtual void reset();
62
63
64 int do_filter; //< Should we turn on filtering for pos/orient?
65 int num_stations; //< How many stations (trackers) on this LibertyHS?
66 int receptor_index; //< Index of receptor used to detect and launch the markers
67 int num_resets; //< Number of resets we've tried this time.
68 char add_reset_cmd[2048]; //< Additional reset commands to be sent
69 int whoami_len; //< Number of chars in whoami response
70 int read_len; //< Number of bytes in usb read buffer
71 int sync_index; //< Index of first sync char in usb read buffer
72
73 struct timeval liberty_zerotime; //< When the liberty time counter was zeroed
74 struct timeval liberty_timestamp; //< The time returned from the LibertyHS System
75 vrpn_uint32 REPORT_LEN; //< The length that the current report should be
76
77
79 int set_sensor_output_format(int sensor = -1);
80
82 int report_length(int sensor);
83
85 int write_usb_data(void* data,int len);
86
91 int read_usb_data(void* data,int maxlen,unsigned int timeout = 50);
92
94 void flush_usb_data();
95
97 int test_markers();
98
100 int launch_markers();
101};
102
103// End of LIBUSB
104#endif
105
106// End of VRPN_TRACKER_LIBERTYHS_H
107#endif
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562