vrpn  07.33
Virtual Reality Peripheral Network
vrpn_Tracker_isense.h
Go to the documentation of this file.
1 #ifndef __TRACKER_ISENSE_H
2 #define __TRACKER_ISENSE_H
3 
4 #include "vrpn_Configure.h" // IWYU pragma: keep
5 
6 #ifdef VRPN_INCLUDE_INTERSENSE
7 
8 #ifdef __APPLE__
9 #define MACOSX
10 #endif
11 
12 #include <time.h>
13 #include <math.h>
14 #include <stdlib.h>
15 #include <stdio.h>
16 #ifndef _WIN32
17 #include <sys/time.h>
18 #endif
19 
20 #include "vrpn_Tracker.h"
21 #include "vrpn_Button.h"
22 #include "vrpn_Analog.h"
23 
24 #include "isense.h"
25 
27 
28  public:
29 
30  vrpn_Tracker_InterSense(const char *name,
31  vrpn_Connection *c,
32  int commPort, const char *additional_reset_commands = NULL,
33  int is900_timestamps = 0, int reset_at_start=0);
34 
36 
39  int add_is900_button(const char *button_device_name, int sensor, int numbuttons = 5);
40 
45  int add_is900_analog(const char *analog_device_name, int sensor,
46  double c0Min = -1, double c0Low = 0, double c0Hi = 0, double c0Max = 1,
47  double c1Min = -1, double c1Low = 0, double c1Hi = 0, double c1Max = 1);
48 
53 
54  virtual void mainloop();
55 
56  protected:
57 
58  virtual void get_report(void);
59  virtual void reset();
60  virtual void send_report(void);
61 
62  char add_reset_cmd[2048]; //< Additional reset commands to be sent
63 
65  ISD_TRACKER_HANDLE m_Handle;
66  ISD_TRACKER_INFO_TYPE m_TrackerInfo;
67  ISD_STATION_INFO_TYPE m_StationInfo[ISD_MAX_STATIONS];
68 
69  int do_is900_timestamps; //< Request and process IS-900 timestamps?
70  int m_reset_at_start; //< should the tracker reset at startup
71 
72  struct timeval is900_zerotime; //< When the IS-900 time counter was zeroed
73  vrpn_Button_Server *is900_buttons[ISD_MAX_STATIONS]; //< Pointer to button on each sensor (NULL if none)
74  vrpn_Clipping_Analog_Server *is900_analogs[ISD_MAX_STATIONS]; //< Pointer to analog on each sensor (NULL if none)
75 
77  int set_sensor_output_format(int sensor);
78 
79  void getTrackerInfo(char *msg);
80 };
81 #endif
82 
83 
84 #endif
ISD_TRACKER_INFO_TYPE m_TrackerInfo
Generic connection class not specific to the transport mechanism.
Analog server that can scale and clip its range to -1..1.
Definition: vrpn_Analog.h:130
#define VRPN_API
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
ISD_TRACKER_HANDLE m_Handle