aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libsurvive/poser.h7
-rwxr-xr-xsrc/survive_cal.c2
-rw-r--r--src/survive_process.c16
3 files changed, 15 insertions, 10 deletions
diff --git a/include/libsurvive/poser.h b/include/libsurvive/poser.h
index 582590e..7e05184 100644
--- a/include/libsurvive/poser.h
+++ b/include/libsurvive/poser.h
@@ -20,12 +20,11 @@ typedef enum PoserType_t
typedef struct
{
PoserType pt;
- uint8_t data[0];
} PoserData;
typedef struct
{
- PoserType pt;
+ PoserData hdr;
uint8_t datamask; //0 = accel present, 1 = gyro present, 2 = mag present.
FLT accel[3];
FLT gyro[3];
@@ -35,7 +34,7 @@ typedef struct
typedef struct
{
- PoserType pt;
+ PoserData hdr;
int sensor_id;
int acode; //OOTX Code associated with this sweep. bit 1 indicates vertical(1) or horizontal(0) sweep
int lh; //Lighthouse making this sweep
@@ -46,7 +45,7 @@ typedef struct
typedef struct
{
- PoserType pt;
+ PoserData hdr;
//If "lengths[...]" < 0, means not a valid piece of sweep information.
FLT lengths[SENSORS_PER_OBJECT][NUM_LIGHTHOUSES][2];
diff --git a/src/survive_cal.c b/src/survive_cal.c
index 59cf68b..26ed1ad 100755
--- a/src/survive_cal.c
+++ b/src/survive_cal.c
@@ -604,7 +604,7 @@ static void handle_calibration( struct SurviveCalData *cd )
{
int i, j;
PoserDataFullScene fsd;
- fsd.pt = POSERDATA_FULL_SCENE;
+ fsd.hdr.pt = POSERDATA_FULL_SCENE;
for( j = 0; j < NUM_LIGHTHOUSES; j++ )
for( i = 0; i < SENSORS_PER_OBJECT; i++ )
{
diff --git a/src/survive_process.c b/src/survive_process.c
index 420e771..e45a979 100644
--- a/src/survive_process.c
+++ b/src/survive_process.c
@@ -52,7 +52,10 @@ void survive_default_angle_process( SurviveObject * so, int sensor_id, int acode
if( so->PoserFn )
{
PoserDataLight l = {
- .pt = POSERDATA_LIGHT,
+ .hdr =
+ {
+ .pt = POSERDATA_LIGHT,
+ },
.sensor_id = sensor_id,
.acode = acode,
.timecode = timecode,
@@ -126,11 +129,14 @@ void survive_default_imu_process( SurviveObject * so, int mask, FLT * accelgyrom
if( so->PoserFn )
{
PoserDataIMU imu = {
- .pt = POSERDATA_IMU,
+ .hdr =
+ {
+ .pt = POSERDATA_IMU,
+ },
.datamask = mask,
- .accel = { accelgyromag[0], accelgyromag[1], accelgyromag[2] },
- .gyro = { accelgyromag[3], accelgyromag[4], accelgyromag[5] },
- .mag = { accelgyromag[6], accelgyromag[7], accelgyromag[8] },
+ .accel = {accelgyromag[0], accelgyromag[1], accelgyromag[2]},
+ .gyro = {accelgyromag[3], accelgyromag[4], accelgyromag[5]},
+ .mag = {accelgyromag[6], accelgyromag[7], accelgyromag[8]},
.timecode = timecode,
};
so->PoserFn( so, (PoserData *)&imu );