vrpn  07.33
Virtual Reality Peripheral Network
vrpn_Tracker_isense.C
Go to the documentation of this file.
1 
2 #include "vrpn_Tracker_isense.h"
3 
4 #ifdef VRPN_INCLUDE_INTERSENSE
5 #include <time.h>
6 #include <math.h>
7 #include <stdlib.h>
8 #include <stdio.h>
9 #include <string.h>
10 #include <sys/types.h>
11 #include <sys/stat.h>
12 #include <fcntl.h>
13 #include <ctype.h>
14 
15 #ifdef linux
16 #include <termios.h>
17 #endif
18 
19 #ifndef _WIN32
20 #include <sys/ioctl.h>
21 #include <sys/time.h>
22 #include <unistd.h>
23 #include <netinet/in.h>
24 #endif
25 
26 #include "vrpn_Tracker.h"
27 #include "vrpn_Serial.h"
28 #include "vrpn_Shared.h"
29 #include "vrpn_MessageMacros.h" // for VRPN_MSG_INFO, VRPN_MSG_WARNING, VRPN_MSG_ERROR
30 #include "quat.h"
31 #include "isense.c"
32 
33 #define MAX_TIME_INTERVAL (5000000) // max time between reports (usec)
34 #define INCHES_TO_METERS (2.54/100.0)
35 #define PI (3.14159265358979323846)
36 #define DEG_TO_RAD (PI/180.)
37 
38 
40 {
41  sprintf(msg, "Port%d (Intersense lib %g) (Firmware Rev %g)", m_TrackerInfo.Port, m_TrackerInfo.LibVersion, m_TrackerInfo.FirmwareRev);
42  switch(m_TrackerInfo.TrackerType) {
43  case ISD_NONE:
44  sprintf(msg, "%s (Unknown series:", msg);
45  break;
46  case ISD_PRECISION_SERIES:
47  sprintf(msg, "%s (Precision series:", msg);
48  break;
49  case ISD_INTERTRAX_SERIES:
50  sprintf(msg, "%s (InterTrax series:", msg);
51  break;
52  }
53  switch(m_TrackerInfo.TrackerModel) {
54  case ISD_UNKNOWN:
55  sprintf(msg, "%s Unknown model)", msg);
56  break;
57 
58  case ISD_IS300:
59  sprintf(msg, "%s IS300)", msg);
60  break;
61 
62  case ISD_IS600:
63  sprintf(msg, "%s IS600)", msg);
64  break;
65 
66  case ISD_IS900:
67  sprintf(msg, "%s IS900)", msg);
68  break;
69 
70  case ISD_IS1200:
71  sprintf(msg, "%s IS1200)", msg);
72  break;
73 
74  case ISD_INTERTRAX:
75  sprintf(msg, "%s InterTrax)", msg);
76  break;
77 
78  case ISD_INTERTRAX_2:
79  sprintf(msg, "%s InterTrax2)", msg);
80  break;
81 
82  case ISD_INTERTRAX_LS:
83  sprintf(msg, "%s InterTrax LS)", msg);
84  break;
85 
86  case ISD_INTERTRAX_LC:
87  sprintf(msg, "%s InterTrax LC)", msg);
88  break;
89 
90  case ISD_ICUBE2:
91  sprintf(msg, "%s InertiaCube2)", msg);
92  break;
93 
94  case ISD_ICUBE2_PRO:
95  sprintf(msg, "%s InertiaCube2 Pro)", msg);
96  break;
97 
98  case ISD_ICUBE3:
99  sprintf(msg, "%s InertiaCube3)", msg);
100  break;
101  }
102  sprintf(msg, "%s\n", msg);
103 }
104 
106  vrpn_Connection *c,
107  int commPort, const char *additional_reset_commands,
108  int is900_timestamps, int reset_at_start) :
109 vrpn_Tracker(name,c), do_is900_timestamps(is900_timestamps),
110 m_reset_at_start(reset_at_start)
111 {
112 #ifdef VRPN_INCLUDE_INTERSENSE
113  char errStr[1024];
114  int i;
115 
117 
118  if (additional_reset_commands == NULL) {
119  sprintf(add_reset_cmd, "");
120  } else {
121  strncpy(add_reset_cmd, additional_reset_commands, sizeof(add_reset_cmd)-1);
122  }
123 
124  // Initially, set to no buttons or analogs on the stations. The
125  // methods to add buttons and analogs must be called to add them.
126  for (i = 0; i < ISD_MAX_STATIONS; i++) {
127  is900_buttons[i] = NULL;
128  is900_analogs[i] = NULL;
129  }
130 
131  m_CommPort = commPort;
132  m_Handle = ISD_OpenTracker(NULL, commPort, FALSE, FALSE);
133 
134  if(m_Handle == -1)
135  {
136  sprintf(errStr,"Failed to open tracker '%s' on COM%d: ISLIB_OpenTracker returned -1",name,commPort);
138  return;
139  }
140 
141  // ISD_TRACKER_INFO_TYPE trackerInfo;
142 
143  ISD_GetTrackerConfig(m_Handle,&m_TrackerInfo,FALSE);
144 
145  for (i = 0; i < ISD_MAX_STATIONS; i++) {
146  if (set_sensor_output_format(i)) {
147  sprintf(errStr,"Failed to reset sensor %d on tracker '%s' on COM%d",i, name,commPort);
149  return;
150  }
151  }
152 
153 
154  //what is the update rate of this tracker?
155  //we might want to set the update rate of the mainloop to based on this value.
156  //for now we just print it out.
157  getTrackerInfo(errStr);
159  VRPN_MSG_INFO(errStr);
160  fprintf(stderr,errStr);
161 
163 #else
164  fprintf(stderr,"Intersense library not compiled into this version. Use Fastrak driver for IS-600/900 or recompile with VRPN_INCLUDE_INTERSENSE defined\n");
166 #endif
167 }
168 
170 {
171 #ifdef VRPN_INCLUDE_INTERSENSE
172 
173  int i;
174 
175  ISD_CloseTracker(m_Handle);
176 
177  // Delete any button and analog devices that were created
178  for (i = 0; i < ISD_MAX_STATIONS; i++) {
179  if (is900_buttons[i]) {
180  delete is900_buttons[i];
181  is900_buttons[i] = NULL;
182  }
183  if (is900_analogs[i]) {
184  delete is900_analogs[i];
185  is900_analogs[i] = NULL;
186  }
187  }
188 #endif
189 }
190 
200 {
201  char errStr[1024];
202 
203  //Get the info about the station
204  ISD_GetStationConfig(m_Handle,&m_StationInfo[station],station+1,0);
205 
206  //ISD_ResetHeading(m_Handle,station+1); //Not sure if this is needed
207  // nahon@virtools.com -
208  if (m_reset_at_start)
209  ISD_Boresight(m_Handle, station+1, true); // equivalent to ISD_ResetHeading for itrax, see isense.h
210 
211 
212  // First, try to set the orientation reporting format to quaternions if possible.
213  // But, some models of intersense trackers (like the intertrax series) will only report
214  // in euler angles
215 
216  // Try to set the tracker to report in quaternion format
217  // (to avoid gimbal lock)
218  // nahon@virtools.com : Let's try, even if we are not a precision series
219  // It seems that this is OK with Intertrax2, what would happen to old Intertrax ?
220 // if (m_TrackerInfo.TrackerType == ISD_PRECISION_SERIES &&
221  if (
222  m_StationInfo[station].AngleFormat == ISD_EULER)
223  {
224  m_StationInfo[station].AngleFormat = ISD_QUATERNION;
225  if(!ISD_SetStationConfig(m_Handle,&m_StationInfo[station],station+1,FALSE))
226  {
227  sprintf(errStr,"Warning: Your tracker doesn't seem to support the quaternion format - couldn't set station config for Station%d. ",station+1);
229  VRPN_MSG_WARNING(errStr);
230 
231  m_StationInfo[station].AngleFormat = ISD_EULER;
232  }
233  }
234 
235  // do is900 special things
236  // IS900 states (timestamp, button, analog).
237  if(m_TrackerInfo.TrackerModel == ISD_IS900) {
238  if (do_is900_timestamps) {
239  m_StationInfo[station].TimeStamped = TRUE;
240  if(!ISD_SetStationConfig(m_Handle,&m_StationInfo[station],station+1,FALSE))
241  {
242  sprintf(errStr,"Warning: Your tracker doesn't seem to support the IS900 timestamps - couldn't set station config for Station%d. ",station+1);
244  VRPN_MSG_WARNING(errStr);
245  m_StationInfo[station].TimeStamped = FALSE;
246  }
247  }
248 
249  if (is900_buttons[station] || is900_analogs[station]) {
250  m_StationInfo[station].GetInputs = TRUE;
251  if(!ISD_SetStationConfig(m_Handle,&m_StationInfo[station],station+1,FALSE))
252  {
253  sprintf(errStr,"Warning: Your tracker doesn't seem to support the IS900 buttons/analogs - couldn't set station config for Station%d. ",station+1);
255  VRPN_MSG_WARNING(errStr);
256  m_StationInfo[station].GetInputs = FALSE;
257  }
258  }
259  }
260  return 0;
261 }
262 
264 {
265 #ifdef VRPN_INCLUDE_INTERSENSE
266  char errStr[1024];
267  int i;
268 
269  m_Handle = ISD_OpenTracker(NULL,m_CommPort,FALSE,FALSE);
270 
271  if(m_Handle == -1)
272  {
273  sprintf(errStr,"InterSense: Failed to open tracker '%s' on COM%d: ISD_OpenTracker returned -1",d_servicename,m_CommPort);
274  fprintf(stderr,errStr);
276  VRPN_MSG_ERROR(errStr);
277 
279  }
280  else
281  {
282 
283  //--------------------------------------------------------------------
284  // Now that the tracker has given a valid status report, set all of
285  // the parameters the way we want them. We rely on power-up setting
286  // based on the receiver select switches to turn on the receivers that
287  // the user wants.
288  //--------------------------------------------------------------------
289 
290  // Set output format for each of the possible stations.
291 
292  for (i = 0; i < ISD_MAX_STATIONS; i++) {
293  if (set_sensor_output_format(i)) {
294  return;
295  }
296  }
297 
298  // Send the additional reset commands, if any, to the tracker.
299  // These commands come in lines, with character \015 ending each
300  // line.
301  if (strlen(add_reset_cmd) > 0) {
302  printf(" Intersense writing extended reset commands...\n");
303  if(!ISD_SendScript(m_Handle,add_reset_cmd))
304  {
305  sprintf(errStr,"Warning: Your tracker failed executing the additional command string. ");
307  VRPN_MSG_WARNING(errStr);
308  }
309  }
310 
311  // If we are using the IS-900 timestamps, clear the timer on the device and
312  // store the time when we cleared it. First, drain any characters in the output
313  // buffer to ensure we're sending right away. Then, send the reset command and
314  // store the time that we sent it, plus the estimated time for the characters to
315  // get across the serial line to the device at the current baud rate.
316  // Set time units to milliseconds (MT) and reset the time (MZ).
317  if (do_is900_timestamps) {
318  char clear_timestamp_cmd[] = "MT\015MZ\015";
319  if(!ISD_SendScript(m_Handle,clear_timestamp_cmd))
320  {
321  sprintf(errStr,"Warning: Your tracker failed executing the additional command string. ");
323  VRPN_MSG_WARNING(errStr);
324  }
325 
327  }
328 
329  // Done with reset.
330  vrpn_gettimeofday(&timestamp, NULL); // Set watchdog now
331  VRPN_MSG_WARNING("Reset Completed (this is good)");
332 
333  status = vrpn_TRACKER_SYNCING; // We're trying for a new reading
334  }
335 #else
336  fprintf(stderr,"Intersense library not compiled into this version. Use Fastrak driver for IS-600/900 or recompile with VRPN_INCLUDE_INTERSENSE defined\n");
338 #endif
339 }
340 
341 // This function will get the reports from the intersense dll, then
342 // put that report into the time, sensor, pos and quat fields, and
343 // finally call send_report to send it.
345 {
346 #ifdef VRPN_INCLUDE_INTERSENSE
347  q_vec_type angles;
348  ISD_TRACKING_DATA_TYPE data;
349  int i;
350 
351  if(ISD_GetTrackingData(m_Handle,&data)) {
352  for(int station=0;station<ISD_MAX_STATIONS;station++) {
353  if(data.Station[station].NewData == TRUE) {
354 
355  d_sensor = station;
356 
357  //--------------------------------------------------------------------
358  // If we are doing IS900 timestamps, decode the time, add it to the
359  // time we zeroed the tracker, and update the report time. Remember
360  // to convert the MILLIseconds from the report into MICROseconds and
361  // seconds.
362  //--------------------------------------------------------------------
363 
364  if (do_is900_timestamps) {
365  vrpn_float32 read_time = data.Station[station].TimeStamp;
366 
367  struct timeval delta_time; // Time since the clock was reset
368 
369  // Convert from the float in MILLIseconds to the struct timeval
370  delta_time.tv_sec = (long)(read_time / 1000); // Integer trunction to seconds
371  read_time -= delta_time.tv_sec * 1000; // Subtract out what we just counted
372  delta_time.tv_usec = (long)(read_time * 1000); // Convert remainder to MICROseconds
373 
374  // Store the current time
376  } else {
377  vrpn_gettimeofday(&timestamp, NULL); // Set watchdog now
378  }
379 
380  //--------------------------------------------------------------------
381  // If this sensor has an IS900 button on it, decode
382  // the button values into the button device and mainloop the button
383  // device so that it will report any changes. Each button is stored
384  // in one bit of the byte, with the lowest-numbered button in the
385  // lowest bit.
386  //--------------------------------------------------------------------
387 
388  if (is900_buttons[station]) {
389  for (i = 0; i < is900_buttons[station]->number_of_buttons(); i++) {
390  is900_buttons[station]->set_button(i, data.Station[station].ButtonState[i]);
391  }
392  is900_buttons[station]->mainloop();
393  }
394 
395  //--------------------------------------------------------------------
396  // If this sensor has an IS900 analog on it, decode the analog values
397  // into the analog device and mainloop the analog device so that it
398  // will report any changes. The first byte holds the unsigned char
399  // representation of left/right. The second holds up/down. For each,
400  // 0 means min (left or rear), 127 means center and 255 means max.
401  //--------------------------------------------------------------------
402 
403  if (is900_analogs[station]) {
404  // Normalize the values to the range -1 to 1
405  is900_analogs[station]->setChannelValue(0, (data.Station[station].AnalogData[0] - 127) / 128.0);
406  is900_analogs[station]->setChannelValue(1, (data.Station[station].AnalogData[1] - 127) / 128.0);
407 
408  // Report the new values
409  is900_analogs[station]->report_changes();
410  is900_analogs[station]->mainloop();
411  }
412 
413  // Copy the tracker data into our internal storage before sending
414  // (no unit problem as the Position vector is already in meters, see ISD_STATION_STATE_TYPE)
415  // Watch: For some reason, to get consistent rotation and translation axis permutations,
416  // we need non direct mapping.
417  // RMT: Based on a report from Christian Odom, it seems like the Quaternions in the
418  // Isense are QXYZ, whereas in Quatlib (and VRPN) they are XYZQ. Once these
419  // are switched correctly, the positions can be read without strange swapping.
420  pos[0] = data.Station[station].Position[0];
421  pos[1] = data.Station[station].Position[1];
422  pos[2] = data.Station[station].Position[2];
423 
424  if(m_StationInfo[station].AngleFormat == ISD_QUATERNION) {
425  d_quat[0] = data.Station[station].Quaternion[1];
426  d_quat[1] = data.Station[station].Quaternion[2];
427  d_quat[2] = data.Station[station].Quaternion[3];
428  d_quat[3] = data.Station[station].Quaternion[0];
429  } else {
430  // Just return Euler for now...
431  // nahon@virtools needs to convert to radians
432  angles[0] = DEG_TO_RAD*data.Station[station].Euler[0];
433  angles[1] = DEG_TO_RAD*data.Station[station].Euler[1];
434  angles[2] = DEG_TO_RAD*data.Station[station].Euler[2];
435 
436  q_from_euler(d_quat, angles[0], angles[1], angles[2]);
437  }
438 
439  // have to just send it now
441 // fprintf(stderr, "sending message len %d\n", len);
442  send_report();
443 
444  //printf("Isense %f, %f, %f\n",pos[0],pos[1],pos[2]);
445  //printf("Isense a:%f, %f, %f : ",angles[0],angles[1],angles[2]); //if the tracker reports a quat, these will be garbage
446  //printf("q: %f, %f, %f, %f\n",d_quat[0],d_quat[1],d_quat[2],d_quat[3]);
447  }
448  }
449 
450  }
451 #endif
452 }
453 
455 {
456 #ifdef VRPN_INCLUDE_INTERSENSE
457  // Send the message on the connection
458  if (d_connection)
459  {
460  char msgbuf[1000];
461  int len = encode_to(msgbuf);
464  fprintf(stderr,"InterSense: cannot write message: tossing\n");
465  }
466  }
467 #endif
468 }
469 
470 
471 
472 // This function should be called each time through the main loop
473 // of the server code. It polls for a report from the tracker and
474 // sends it if there is one. It will reset the tracker if there is
475 // no data from it for a few seconds.
476 
478 {
479  // Call the generic server mainloop, since we are a server
480  server_mainloop();
481 
482  switch (status) {
486  {
487  // It turns out to be important to get the report before checking
488  // to see if it has been too long since the last report. This is
489  // because there is the possibility that some other device running
490  // in the same server may have taken a long time on its last pass
491  // through mainloop(). Trackers that are resetting do this. When
492  // this happens, you can get an infinite loop -- where one tracker
493  // resets and causes the other to timeout, and then it returns the
494  // favor. By checking for the report here, we reset the timestamp
495  // if there is a report ready (ie, if THIS device is still operating).
496 
497  get_report();
498 
499  // Ready for another report
501  }
502  break;
503 
505  reset();
506  break;
507 
508  case vrpn_TRACKER_FAIL:
509  VRPN_MSG_WARNING("Tracking failed, trying to reset (try power cycle if more than 4 attempts made)");
511  break;
512  }
513 }
514 
515 
524 int vrpn_Tracker_InterSense::add_is900_button(const char *button_device_name, int sensor, int numbuttons)
525 {
526  // Make sure this is a valid sensor
527  if ( (sensor < 0) || (sensor >= ISD_MAX_STATIONS) ) {
528  return -1;
529  }
530 
531  // Add a new button device and set the pointer to point at it.
532  is900_buttons[sensor] = new vrpn_Button_Server(button_device_name, d_connection, numbuttons);
533  if (is900_buttons[sensor] == NULL) {
534  VRPN_MSG_ERROR("Cannot open button device");
535  return -1;
536  }
537 
538  // Send a new station-format command to the tracker so it will report the button states.
539  return set_sensor_output_format(sensor);
540 }
541 
542 
557 int vrpn_Tracker_InterSense::add_is900_analog(const char *analog_device_name, int sensor,
558  double c0Min, double c0Low, double c0Hi, double c0Max,
559  double c1Min, double c1Low, double c1Hi, double c1Max)
560 {
561  // Make sure this is a valid sensor
562  if ( (sensor < 0) || (sensor >= ISD_MAX_STATIONS) ) {
563  return -1;
564  }
565 
566  // Add a new analog device and set the pointer to point at it.
567  is900_analogs[sensor] = new vrpn_Clipping_Analog_Server(analog_device_name, d_connection);
568  if (is900_analogs[sensor] == NULL) {
569  VRPN_MSG_ERROR("Cannot open analog device");
570  return -1;
571  }
572 
573  // Set the analog to have two channels, and set its channels to 0 to start with
574  is900_analogs[sensor]->setNumChannels(2);
575  is900_analogs[sensor]->setChannelValue(0, 0.0);
576  is900_analogs[sensor]->setChannelValue(1, 0.0);
577 
578  // Set the scaling on the two channels.
579  is900_analogs[sensor]->setClipValues(0, c0Min, c0Low, c0Hi, c0Max);
580  is900_analogs[sensor]->setClipValues(1, c1Min, c1Low, c1Hi, c1Max);
581 
582  // Send a new station-format command to the tracker so it will report the analog status
583  return set_sensor_output_format(sensor);
584 }
585 #endif
vrpn_Tracker.h
vrpn_Connection::pack_message
virtual int pack_message(vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_uint32 class_of_service)
Pack a message that will be sent the next time mainloop() is called. Turn off the RELIABLE flag if yo...
Definition: vrpn_Connection.C:4632
vrpn_Tracker_InterSense::get_report
virtual void get_report(void)
Definition: vrpn_Tracker_isense.C:344
vrpn_Tracker_InterSense::m_Handle
ISD_TRACKER_HANDLE m_Handle
Definition: vrpn_Tracker_isense.h:65
vrpn_Tracker
Definition: vrpn_Tracker.h:49
vrpn_Tracker::encode_to
virtual int encode_to(char *buf)
Definition: vrpn_Tracker.C:533
vrpn_Analog_Server::setNumChannels
vrpn_int32 setNumChannels(vrpn_int32 sizeRequested)
Sets the size of the array; returns the size actually set. (May be clamped to vrpn_CHANNEL_MAX) This ...
Definition: vrpn_Analog.C:195
vrpn_Tracker::d_sensor
vrpn_int32 d_sensor
Definition: vrpn_Tracker.h:94
vrpn_Tracker_InterSense::getTrackerInfo
void getTrackerInfo(char *msg)
Definition: vrpn_Tracker_isense.C:39
vrpn_Clipping_Analog_Server::setClipValues
int setClipValues(int channel, double min, double lowzero, double highzero, double max)
Set the clipping values for the specified channel. min maps to -1, values between lowzero and highzer...
Definition: vrpn_Analog.C:225
vrpn_Tracker_InterSense::is900_zerotime
struct timeval is900_zerotime
Definition: vrpn_Tracker_isense.h:72
vrpn_TRACKER_REPORT_READY
const int vrpn_TRACKER_REPORT_READY
Definition: vrpn_Tracker.h:37
vrpn_Tracker::d_quat
vrpn_float64 d_quat[4]
Definition: vrpn_Tracker.h:95
vrpn_Tracker_InterSense::send_report
virtual void send_report(void)
Definition: vrpn_Tracker_isense.C:454
vrpn_Tracker::timestamp
struct timeval timestamp
Definition: vrpn_Tracker.h:100
vrpn_Serial.h
vrpn_Serial: Pulls all the serial port routines into one file to make porting to new operating system...
DEG_TO_RAD
#define DEG_TO_RAD
Definition: vrpn_Tracker_isense.C:36
vrpn_Clipping_Analog_Server::setChannelValue
int setChannelValue(int channel, double value)
This method should be used to set the value of a channel. It will be scaled and clipped as described ...
Definition: vrpn_Analog.C:253
vrpn_CONNECTION_LOW_LATENCY
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
Definition: vrpn_Connection.h:122
vrpn_Clipping_Analog_Server
class VRPN_API vrpn_Clipping_Analog_Server
Definition: vrpn_Tracker_Fastrak.h:24
vrpn_BaseClassUnique::d_connection
vrpn_Connection * d_connection
Connection that this object talks to.
Definition: vrpn_BaseClass.h:224
vrpn_Tracker_InterSense::m_TrackerInfo
ISD_TRACKER_INFO_TYPE m_TrackerInfo
Definition: vrpn_Tracker_isense.h:66
vrpn_Tracker_InterSense::mainloop
virtual void mainloop()
This function should be called each time through the main loop of the server code....
Definition: vrpn_Tracker_isense.C:477
vrpn_Tracker_InterSense::~vrpn_Tracker_InterSense
~vrpn_Tracker_InterSense()
Definition: vrpn_Tracker_isense.C:169
VRPN_MSG_WARNING
#define VRPN_MSG_WARNING(msg)
Definition: vrpn_MessageMacros.h:39
vrpn_Shared.h
vrpn_Button_Server::mainloop
virtual void mainloop()
Called once each time through the server program's mainloop to handle various functions (like setting...
Definition: vrpn_Button.C:470
vrpn_TRACKER_PARTIAL
const int vrpn_TRACKER_PARTIAL
Definition: vrpn_Tracker.h:38
vrpn_Tracker_InterSense::m_reset_at_start
int m_reset_at_start
Definition: vrpn_Tracker_isense.h:70
vrpn_BaseClassUnique::d_sender_id
vrpn_int32 d_sender_id
Sender ID registered with the connection.
Definition: vrpn_BaseClass.h:228
vrpn_Tracker_InterSense::m_CommPort
int m_CommPort
Definition: vrpn_Tracker_isense.h:64
vrpn_Button_Server::number_of_buttons
int number_of_buttons(void)
Tells how many buttons there are (may be clipped to MAX_BUTTONS)
Definition: vrpn_Button.C:468
vrpn_Tracker::position_m_id
vrpn_int32 position_m_id
Definition: vrpn_Tracker.h:80
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition: vrpn_Connection.h:510
vrpn_TRACKER_FAIL
const int vrpn_TRACKER_FAIL
Definition: vrpn_Tracker.h:40
vrpn_TRACKER_RESETTING
const int vrpn_TRACKER_RESETTING
Definition: vrpn_Tracker.h:39
vrpn_gettimeofday
#define vrpn_gettimeofday
Definition: vrpn_Shared.h:89
vrpn_Tracker::status
int status
Definition: vrpn_Tracker.h:129
vrpn_Tracker::register_server_handlers
int register_server_handlers(void)
Definition: vrpn_Tracker.C:318
vrpn_Tracker_isense.h
vrpn_Tracker_InterSense::is900_analogs
vrpn_Clipping_Analog_Server * is900_analogs[ISD_MAX_STATIONS]
Definition: vrpn_Tracker_isense.h:74
vrpn_Tracker_InterSense::add_is900_analog
int add_is900_analog(const char *analog_device_name, int sensor, double c0Min=-1, double c0Low=0, double c0Hi=0, double c0Max=1, double c1Min=-1, double c1Low=0, double c1Hi=0, double c1Max=1)
Add the analog part of an IS900 joystick device to one of the sensors This allows configuration of an...
Definition: vrpn_Tracker_isense.C:557
vrpn_TRACKER_SYNCING
const int vrpn_TRACKER_SYNCING
Definition: vrpn_Tracker.h:35
vrpn_Tracker_InterSense::add_is900_button
int add_is900_button(const char *button_device_name, int sensor, int numbuttons=5)
Add an IS900 button device to one of the sensors This allows configuration of an InterSense IS-900.
Definition: vrpn_Tracker_isense.C:524
vrpn_Tracker_InterSense::do_is900_timestamps
int do_is900_timestamps
Definition: vrpn_Tracker_isense.h:69
vrpn_Button_Server
class VRPN_API vrpn_Button_Server
Definition: vrpn_Tracker_Fastrak.h:23
VRPN_MSG_INFO
#define VRPN_MSG_INFO(msg)
Definition: vrpn_MessageMacros.h:32
vrpn_Tracker_InterSense::m_StationInfo
ISD_STATION_INFO_TYPE m_StationInfo[ISD_MAX_STATIONS]
Definition: vrpn_Tracker_isense.h:67
vrpn_TRACKER_AWAITING_STATION
const int vrpn_TRACKER_AWAITING_STATION
Definition: vrpn_Tracker.h:36
vrpn_MessageMacros.h
Header containing macros formerly duplicated in a lot of implementation files.
vrpn_Analog_Server::report_changes
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
Makes public the protected base class function.
Definition: vrpn_Analog.C:182
vrpn_Analog_Server::mainloop
virtual void mainloop()
For this server, the user must normally call report() or report_changes() directly....
Definition: vrpn_Analog.h:114
vrpn_Tracker_InterSense::vrpn_Tracker_InterSense
vrpn_Tracker_InterSense(const char *name, vrpn_Connection *c, int commPort, const char *additional_reset_commands=NULL, int is900_timestamps=0, int reset_at_start=0)
Definition: vrpn_Tracker_isense.C:105
vrpn_TimevalSum
timeval vrpn_TimevalSum(const timeval &tv1, const timeval &tv2)
Definition: vrpn_Shared.C:45
vrpn_BaseClassUnique::d_servicename
char * d_servicename
Name of this device, not including the connection part.
Definition: vrpn_BaseClass.h:225
vrpn_Button_Server::set_button
int set_button(int button, int new_value)
Allows the server program to set current button states (to 0 or 1)
Definition: vrpn_Button.C:476
vrpn_Tracker::pos
vrpn_float64 pos[3]
Definition: vrpn_Tracker.h:95
vrpn_Tracker_InterSense::reset
virtual void reset()
Definition: vrpn_Tracker_isense.C:263
vrpn_Tracker_InterSense::is900_buttons
vrpn_Button_Server * is900_buttons[ISD_MAX_STATIONS]
Definition: vrpn_Tracker_isense.h:73
VRPN_MSG_ERROR
#define VRPN_MSG_ERROR(msg)
Definition: vrpn_MessageMacros.h:46
vrpn_Tracker_InterSense::set_sensor_output_format
int set_sensor_output_format(int sensor)
Augments the basic Fastrak format to include IS900 features if needed.
Definition: vrpn_Tracker_isense.C:199
vrpn_Tracker_InterSense::add_reset_cmd
char add_reset_cmd[2048]
Definition: vrpn_Tracker_isense.h:62
vrpn_BaseClassUnique::server_mainloop
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...
Definition: vrpn_BaseClass.C:603