aboutsummaryrefslogtreecommitdiff
path: root/include/libsurvive/poser.h
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2017-03-03 02:15:04 -0500
committercnlohr <lohr85@gmail.com>2017-03-03 02:15:04 -0500
commit58b19da6848e64c9ca7aa47d8b3e0cd30db89d44 (patch)
treeae22943ea2072a92a50dc4524886d91341c52977 /include/libsurvive/poser.h
parentb5ff8e57a6bd86931f00465f8009626dcd36d94d (diff)
downloadlibsurvive-58b19da6848e64c9ca7aa47d8b3e0cd30db89d44.tar.gz
libsurvive-58b19da6848e64c9ca7aa47d8b3e0cd30db89d44.tar.bz2
Split out into some more things in the include folder. Getting closer to trying to have posers.
Diffstat (limited to 'include/libsurvive/poser.h')
-rw-r--r--include/libsurvive/poser.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/libsurvive/poser.h b/include/libsurvive/poser.h
new file mode 100644
index 0000000..4894acf
--- /dev/null
+++ b/include/libsurvive/poser.h
@@ -0,0 +1,54 @@
+#ifndef _LSPOSER_H
+#define _LSPOSER_H
+
+#include "survive_types.h"
+
+typedef enum PoserType_t
+{
+ POSERDATA_NONE = 0,
+ POSERDATA_IMU,
+ POSERDATA_LIGHT, //Single lighting event.
+ POSERDATA_FULL_SCENE, //Full, statified X, Y sweep data for both lighthouses.
+} PoserType;
+
+struct PoserData
+{
+ PoserType pt;
+ uint8_t data[0];
+};
+
+struct PoserDataIMU
+{
+ PoserType pt;
+ uint8_t datamask; //0 = accel present, 1 = gyro present, 2 = mag present.
+ FLT accel[3];
+ FLT gyro[3];
+ FLT mag[3];
+};
+
+struct PoserDataLight
+{
+ PoserType pt;
+ int sensor_id;
+ int acode; //OOTX Code associated with this sweep. base_station = acode >> 2; axis = acode & 1;
+ uint32_t timecode; //In object-local ticks.
+ FLT length; //In seconds
+ FLT angle; //In radians from center of lighthouse.
+};
+
+struct PoserDataFullScene
+{
+ PoserType pt;
+
+ //If "lengths[...]" < 0, means not a valid piece of sweep information.
+ FLT lengths[SENSORS_PER_OBJECT][NUM_LIGHTHOUSES][2];
+ FLT angles [SENSORS_PER_OBJECT][NUM_LIGHTHOUSES][2]; //2 Axes
+
+ struct PoserDataIMU lastimu;
+};
+
+//When you register your posers using the internal system,
+typedef int (*PoserCB)( struct SurviveObject * so, struct PoserData * pd );
+
+
+#endif