15 #ifdef VRPN_USE_TRIVISIOCOLIBRI 36 # include VRPN_TRIVISIOCOLIBRI_H 40 # include VRPN_TRIVISIOCOLIBRI_H 44 int numSensors,
int Hz,
int bufLen) :
48 struct TrivisioSensor* sensorList =
new TrivisioSensor[numSensors];
49 int sensorCount = colibriGetDeviceList(sensorList, numSensors);
53 if (sensorCount < 0) {
63 printf(
"Warning: No Colibri sensors found\n");
70 printf(
"%s:\t %s (FW %d.%d)\n", sensorList[i].dev, sensorList[i].ID,
71 sensorList[i].FWver, sensorList[i].FWsubver);
81 float Ka[9] = { 0.68f, 0.00f, 0.00f,
83 0.00f, 0.00f, 0.68f };
84 float Kg[9] = { 0.68f, 0.00f, 0.00f,
86 0.00f, 0.00f, 0.68f };
94 imu[i] = colibriCreate(bufLen);
96 if (colibriOpen(
imu[i], 0, sensorList[i].dev) < 0) {
97 printf(
"Warning: Could not access Colibri device on %s\n", sensorList[i]);
101 struct ColibriConfig conf;
104 colibriGetConfig(
imu[i], &conf);
107 conf.sensor = (ColibriConfig::Sensor)1023;
109 colibriSetConfig(
imu[i], &conf);
111 colibriSetKa(
imu[i], Ka);
112 colibriSetKaStatus(
imu[i], 1);
113 colibriSetKg(
imu[i], Kg);
114 colibriSetKgStatus(
imu[i], 1);
115 colibriSetJitterStatus(
imu[i], 1);
120 printf(
"Colibri IMU %d\n", i);
121 colibriGetID(
imu,
id);
122 printf(
"\tDevice ID: %s\n",
id);
123 printf(
"\tSensor config: %d\n", conf.sensor);
124 printf(
"\tMagnetic div: %d\n", (
unsigned)conf.magDiv);
125 printf(
"\tFrequency: %d\n", conf.freq);
126 printf(
"\tASCII output: %d\n", conf.ascii);
127 printf(
"\tAutoStart: %d\n", conf.autoStart);
128 printf(
"\tRAW mode: %d\n", conf.raw);
129 printf(
"\tJitter reduction: %d\n", colibriGetJitterStatus(
imu[i]));
136 colibriStart(
imu[i]);
148 colibriClose(
imu[i]);
168 TrivisioIMUData data;
169 colibriGetData(
imu[i], &data);
194 fprintf(stderr,
"Tracker: cannot write message: tossing\n");
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...
virtual void get_report()
virtual void mainloop()
This function should be called each time through the main loop of the server code. It checks for a report from the tracker and sends it if there is one.
int register_server_handlers(void)
virtual void send_report()
Generic connection class not specific to the transport mechanism.
const int vrpn_TRACKER_FAIL
vrpn_Tracker_TrivisioColibri(const char *name, vrpn_Connection *c, int numSensors=1, int Hz=60, int bufLen=0)
vrpn_Connection * d_connection
Connection that this object talks to.
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...
virtual int encode_to(char *buf)
#define vrpn_gettimeofday
vrpn_int32 d_sender_id
Sender ID registered with the connection.
~vrpn_Tracker_TrivisioColibri()