1 #ifndef VRPN_YEI_3SPACE_H 2 #define VRPN_YEI_3SPACE_H 34 bool calibrate_gyros_on_setup =
false,
35 bool tare_on_setup =
false,
36 double frames_per_second = 50,
37 double red_LED_color = 0,
38 double green_LED_color = 0,
39 double blue_LED_color = 0,
41 const char *reset_commands[] = NULL);
54 void init(
bool calibrate_gyros_on_setup
56 ,
double frames_per_second
57 ,
double red_LED_color
58 ,
double green_LED_color
59 ,
double blue_LED_color
63 virtual void flush_input(
void) = 0;
73 virtual int reset(
void);
74 virtual bool get_report(
void) = 0;
75 virtual void handle_report(
unsigned char *report);
79 vrpn_float32 d_LED_color[3];
83 virtual bool send_binary_command(
const unsigned char *cmd,
int len) = 0;
88 virtual bool send_ascii_command(
const char *cmd) = 0;
93 virtual bool receive_LED_mode_response(
struct timeval *timeout = NULL) = 0;
98 virtual bool receive_LED_values_response(
struct timeval *timeout = NULL) = 0;
100 unsigned char d_buffer[128];
104 struct timeval timestamp;
141 bool calibrate_gyros_on_setup =
false,
142 bool tare_on_setup =
false,
143 double frames_per_second = 50,
144 double red_LED_color = 0,
145 double green_LED_color = 0,
146 double blue_LED_color = 0,
148 const char *reset_commands[] = NULL);
216 bool calibrate_gyros_on_setup =
false,
217 bool tare_on_setup =
false,
218 double frames_per_second = 50,
219 double red_LED_color = 0,
220 double green_LED_color = 0,
221 double blue_LED_color = 0,
223 const char *reset_commands[] = NULL);
249 int serial_file_descriptor,
250 bool calibrate_gyros_on_setup =
false,
251 bool tare_on_setup =
false,
252 double frames_per_second = 50,
253 double red_LED_color = 0,
254 double green_LED_color = 0,
255 double blue_LED_color = 0,
257 const char *reset_commands[] = NULL);
272 virtual bool configure_dongle(
void);
275 virtual bool set_logical_id(vrpn_uint8 logical_id, vrpn_int32 serial_number);
287 bool send_binary_command_to_dongle(
const unsigned char *cmd,
int len);
double d_frames_per_second
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
Send a report only if something has changed (for servers) Optionally, tell what time to stamp the val...
virtual void flush_input(void)=0
Flush any incoming characters in the communications channel.
unsigned d_expected_characters
virtual bool receive_LED_values_response(struct timeval *timeout=NULL)=0
Read and parse the response to an LED-values request command. NULL timeout pointer means wait forever...
int d_reset_command_count
Base class with routines for YEI 3Space units.
virtual bool send_ascii_command(const char *cmd)=0
Put a ':' character at the front and ' ' at the end and then send the resulting command as an ASCII c...
Generic connection class not specific to the transport mechanism.
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
Send a report whether something has changed or not (for servers) Optionally, tell what time to stamp ...
Class to support reading data from a wired YEI 3Space unit.
virtual bool get_report(void)=0
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
virtual int init(void)
Initialize things that the constructor can't. Returns 0 on success, -1 on failure.
int get_serial_file_descriptor(void) const
Reports the serial_fd that was opened, so that additional sensors that use the same wireless dongle c...
unsigned d_characters_read
virtual bool receive_LED_mode_response(struct timeval *timeout=NULL)=0
Read and parse the response to an LED-state request command. NULL timeout pointer means wait forever....
Class to support reading data from a wireless YEI 3Space unit.
virtual bool send_binary_command(const unsigned char *cmd, int len)=0
Compute the CRC for the message, append it, and send message. Returns true on success,...