1#ifndef VRPN_YEI_3SPACE_H
2#define VRPN_YEI_3SPACE_H
5#include "vrpn_Tracker.h"
6#include "vrpn_Analog.h"
7#include "vrpn_Button.h"
27 double frames_per_second = 50,
28 const char *reset_commands[] = NULL);
41 void init(
bool calibrate_gyros_on_setup
43 ,
double red_LED_color
44 ,
double green_LED_color
45 ,
double blue_LED_color
54 char **d_reset_commands;
55 int d_reset_command_count;
59 virtual int reset(
void);
60 virtual bool get_report(
void) = 0;
61 virtual void handle_report(
unsigned char *report);
63 double d_frames_per_second;
65 vrpn_float32 d_LED_color[3];
86 unsigned char d_buffer[128];
87 unsigned d_expected_characters;
88 unsigned d_characters_read;
90 struct timeval timestamp;
94 (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
97 (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
127 bool calibrate_gyros_on_setup =
false,
128 bool tare_on_setup =
false,
129 double frames_per_second = 50,
130 double red_LED_color = 0,
131 double green_LED_color = 0,
132 double blue_LED_color = 0,
134 const char *reset_commands[] = NULL);
145 virtual bool get_report(
void);
200 bool calibrate_gyros_on_setup =
false,
201 bool tare_on_setup =
false,
202 double frames_per_second = 50,
203 double red_LED_color = 0,
204 double green_LED_color = 0,
205 double blue_LED_color = 0,
207 const char *reset_commands[] = NULL);
231 int serial_file_descriptor,
232 bool calibrate_gyros_on_setup =
false,
233 bool tare_on_setup =
false,
234 double frames_per_second = 50,
235 double red_LED_color = 0,
236 double green_LED_color = 0,
237 double blue_LED_color = 0,
239 const char *reset_commands[] = NULL);
251 vrpn_uint8 d_logical_id;
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
Class to support reading data from a wireless YEI 3Space unit.
定义 vrpn_YEI_3Space.h:171
virtual bool set_logical_id(vrpn_uint8 logical_id, vrpn_int32 serial_number)
Insert our serial number into the specified slot.
int get_serial_file_descriptor(void) const
定义 vrpn_YEI_3Space.h:246
virtual void flush_input(void)
Flush any incoming characters in the communications channel.
virtual ~vrpn_YEI_3Space_Sensor_Wireless()
Destructor.
virtual bool get_report(void)
vrpn_YEI_3Space_Sensor_Wireless(const char *name, vrpn_Connection *c, int logical_id, const char *port, int baud=115200, bool calibrate_gyros_on_setup=false, bool tare_on_setup=false, double frames_per_second=50, double red_LED_color=0, double green_LED_color=0, double blue_LED_color=0, int LED_mode=1, const char *reset_commands[]=NULL)
Constructor for the first device, which will open the serial port and configure the dongle....
bool send_ascii_command(const char *cmd)
vrpn_YEI_3Space_Sensor_Wireless(const char *name, vrpn_Connection *c, int logical_id, int serial_file_descriptor, bool calibrate_gyros_on_setup=false, bool tare_on_setup=false, double frames_per_second=50, double red_LED_color=0, double green_LED_color=0, double blue_LED_color=0, int LED_mode=1, const char *reset_commands[]=NULL)
Constructor for a follow-on device, once a wireless unit has already been opened on a given dongle....
bool send_binary_command(const unsigned char *cmd, int len)
bool send_binary_command_to_dongle(const unsigned char *cmd, int len)
bool receive_LED_values_response(struct timeval *timeout=NULL)
bool receive_LED_mode_response(struct timeval *timeout=NULL)
virtual bool configure_dongle(void)
Configure the dongle (called if we are the first one)
Class to support reading data from a wired YEI 3Space unit.
定义 vrpn_YEI_3Space.h:104
virtual void flush_input(void)
Flush any incoming characters in the communications channel.
bool send_ascii_command(const char *cmd)
bool send_binary_command(const unsigned char *cmd, int len)
bool receive_LED_values_response(struct timeval *timeout=NULL)
virtual ~vrpn_YEI_3Space_Sensor()
Destructor.
bool receive_LED_mode_response(struct timeval *timeout=NULL)
vrpn_YEI_3Space_Sensor(const char *name, vrpn_Connection *c, const char *port, int baud=115200, bool calibrate_gyros_on_setup=false, bool tare_on_setup=false, double frames_per_second=50, double red_LED_color=0, double green_LED_color=0, double blue_LED_color=0, int LED_mode=1, const char *reset_commands[]=NULL)
Constructor.
Base class with routines for YEI 3Space units.
定义 vrpn_YEI_3Space.h:15
virtual bool receive_LED_mode_response(struct timeval *timeout=NULL)=0
virtual bool send_binary_command(const unsigned char *cmd, int len)=0
virtual bool receive_LED_values_response(struct timeval *timeout=NULL)=0
virtual ~vrpn_YEI_3Space()
Destructor.
virtual void mainloop()
Called once through each main loop iteration to handle updates.
virtual bool send_ascii_command(const char *cmd)=0
vrpn_YEI_3Space(const char *name, vrpn_Connection *c, double frames_per_second=50, const char *reset_commands[]=NULL)
Constructor.
virtual void flush_input(void)=0
Flush any incoming characters in the communications channel.
void init(bool calibrate_gyros_on_setup, bool tare_on_setup, double red_LED_color, double green_LED_color, double blue_LED_color, int LED_mode)
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY)
send report whether or not changed
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY)
send report iff changed