aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2017-03-08 01:43:56 -0500
committercnlohr <lohr85@gmail.com>2017-03-08 01:43:56 -0500
commitc65498054c77192b2a12fdb5ef44439a14110292 (patch)
tree90120d0a3d529aca81d77fe825229f8a6d641bc6 /include
parent2a4a803b2f162692ca11e700b32da0a77049bfd2 (diff)
downloadlibsurvive-c65498054c77192b2a12fdb5ef44439a14110292.tar.gz
libsurvive-c65498054c77192b2a12fdb5ef44439a14110292.tar.bz2
Architect the way the posers receive data.
Diffstat (limited to 'include')
-rw-r--r--include/libsurvive/poser.h4
-rw-r--r--include/libsurvive/survive.h4
-rw-r--r--include/libsurvive/survive_types.h2
3 files changed, 6 insertions, 4 deletions
diff --git a/include/libsurvive/poser.h b/include/libsurvive/poser.h
index c514953..98c926e 100644
--- a/include/libsurvive/poser.h
+++ b/include/libsurvive/poser.h
@@ -9,6 +9,7 @@ typedef enum PoserType_t
POSERDATA_IMU,
POSERDATA_LIGHT, //Single lighting event.
POSERDATA_FULL_SCENE, //Full, statified X, Y sweep data for both lighthouses.
+ POSERDATA_DISASSOCIATE, //If you get this, it doesn't contain data. It just tells you to please disassociate from the current SurviveObject and delete your poserdata.
} PoserType;
typedef struct
@@ -24,6 +25,7 @@ typedef struct
FLT accel[3];
FLT gyro[3];
FLT mag[3];
+ uint32_t timecode; //In object-local ticks.
} PoserDataIMU;
typedef struct
@@ -47,7 +49,7 @@ typedef struct
PoserDataIMU lastimu;
} PoserDataFullScene;
-//When you register your posers using the internal system,
+//When you write your posers, use the following definition, and register with REGISTER_LINKTIME.
typedef int (*PoserCB)( SurviveObject * so, PoserData * pd );
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h
index c35e43c..7fd6046 100644
--- a/include/libsurvive/survive.h
+++ b/include/libsurvive/survive.h
@@ -29,7 +29,7 @@ struct SurviveObject
SurvivePose OutPose;
SurvivePose FromLHPose[NUM_LIGHTHOUSES]; //Optionally filled out by poser, contains computed position from each lighthouse.
void * PoserData; //Initialized to zero, configured by poser, can be anything the poser wants.
- PoserCB * PoserFn;
+ PoserCB PoserFn;
//Device-specific information about the location of the sensors. This data will be used by the poser.
int8_t nr_locations;
@@ -126,7 +126,7 @@ void survive_cal_install( SurviveContext * ctx ); //XXX This will be removed if
//Call these from your callback if overridden.
//Accept higher-level data.
void survive_default_light_process( SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length );
-void survive_default_imu_process( SurviveObject * so, int16_t * accelgyro, uint32_t timecode, int id );
+void survive_default_imu_process( SurviveObject * so, int mode, FLT * accelgyro, uint32_t timecode, int id );
void survive_default_angle_process( SurviveObject * so, int sensor_id, int acode, uint32_t timecode, FLT length, FLT angle );
diff --git a/include/libsurvive/survive_types.h b/include/libsurvive/survive_types.h
index f235330..1600e11 100644
--- a/include/libsurvive/survive_types.h
+++ b/include/libsurvive/survive_types.h
@@ -29,7 +29,7 @@ typedef struct SurviveCalData SurviveCalData; //XXX Warning: This may be remov
typedef void (*text_feedback_func)( SurviveContext * ctx, const char * fault );
typedef void (*light_process_func)( SurviveObject * so, int sensor_id, int acode, int timeinsweep, uint32_t timecode, uint32_t length );
-typedef void (*imu_process_func)( SurviveObject * so, int16_t * accelgyro, uint32_t timecode, int id );
+typedef void (*imu_process_func)( SurviveObject * so, int mask, FLT * accelgyro, uint32_t timecode, int id );
typedef void (*angle_process_func)( SurviveObject * so, int sensor_id, int acode, uint32_t timecode, FLT length, FLT angle );