User Manual Part 1

IS-900 User Guide Page 67 of 159
To decode position:
lo = (dataRecord[3] & 0x007F);
hi = (dataRecord[4] & 0x007F);
int14bit = (lo « 2) | (hi « 9);
result = (float) int14bit * 3.0 / 32768.0;
Result is a number representing position (in meters) and has a
full range of ± 3.0 meters (300.0 to+299.963 centimeters or
118.110 to 118.096 inches).
To decode Euler angles:
lo = (dataRecord[3] & 0x007F);
hi = (dataRecord[4] & 0x007F);
int14bit = (lo « 2) | (hi « 9);
result = (float) int14bit * 180.0 / 32768.0;
Resulting number represents orientation and has a full range of
± 180.0 (180.0 to +179.978) degrees.
To decode Orientation Quaternion:
lo = (dataRecord[3] & 0x007F);
hi = (dataRecord[4] & 0x007F);
int14bit = (lo « 2) | (hi « 9);
result = (float) int14bit * 1.0 / 32768.0;
Resulting quaternion value has range of ± 1.0.
Data Item 22 Buttons.
One 3-digit integer in ASCII format or one byte in binary format.
Bits represent the button states of a station’s buttons. If a button
is pressed, the corresponding bit is 1 otherwise it is 0. The bit
assignments for the wand are (where bit 0 is the least significant
bit):
Bit Button MicroTrax Wand button
0 1 1 on wand image
1 2 2 on wand image
2 3 3 on wand image
3 4 4 on wand image
4 5 center (press joystick)
5 6 trigger