aboutsummaryrefslogtreecommitdiff
path: root/include/libsurvive
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-03-18 23:15:54 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-03-20 16:09:07 -0600
commit8ec5d7facc76e05859444335adbdbfd2bbbad852 (patch)
tree9a07a479dadebe56365ad1affe3e55878aeecfb7 /include/libsurvive
parent5cd3cca4191737ab4ae566975190c3b28bf11f2e (diff)
downloadlibsurvive-8ec5d7facc76e05859444335adbdbfd2bbbad852.tar.gz
libsurvive-8ec5d7facc76e05859444335adbdbfd2bbbad852.tar.bz2
Added code to cancel out object rotation when calibrating
Diffstat (limited to 'include/libsurvive')
-rw-r--r--include/libsurvive/poser.h3
-rw-r--r--include/libsurvive/survive.h7
2 files changed, 8 insertions, 2 deletions
diff --git a/include/libsurvive/poser.h b/include/libsurvive/poser.h
index 6c74c52..9667f1a 100644
--- a/include/libsurvive/poser.h
+++ b/include/libsurvive/poser.h
@@ -31,8 +31,7 @@ typedef struct
void PoserData_poser_raw_pose_func(PoserData *poser_data, SurviveObject *so, uint8_t lighthouse, SurvivePose *pose);
void PoserData_lighthouse_pose_func(PoserData *poser_data, SurviveObject *so, uint8_t lighthouse, SurvivePose *pose);
-typedef struct
-{
+typedef struct PoserDataIMU {
PoserData hdr;
uint8_t datamask; //0 = accel present, 1 = gyro present, 2 = mag present.
FLT accel[3];
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h
index 180d83c..a3639dc 100644
--- a/include/libsurvive/survive.h
+++ b/include/libsurvive/survive.h
@@ -16,14 +16,21 @@ extern "C" {
typedef struct {
FLT angles[SENSORS_PER_OBJECT][NUM_LIGHTHOUSES][2]; // 2 Axes (Angles in LH space)
uint32_t timecode[SENSORS_PER_OBJECT][NUM_LIGHTHOUSES][2]; // Timecode per axis in ticks
+
+ FLT accel[3];
+ FLT gyro[3];
+ FLT mag[3];
} SurviveSensorActivations;
struct PoserDataLight;
+struct PoserDataIMU;
/**
* Adds a lightData packet to the table.
*/
void SurviveSensorActivations_add(SurviveSensorActivations *self, struct PoserDataLight *lightData);
+void SurviveSensorActivations_add_imu(SurviveSensorActivations *self, struct PoserDataIMU *imuData);
+
/**
* Returns true iff both angles for the given sensor and lighthouse were seen at most `tolerance` ticks before the given
* `timecode_now`.