diff options
Diffstat (limited to 'src/survive_process.c')
-rw-r--r-- | src/survive_process.c | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/src/survive_process.c b/src/survive_process.c index f0928b4..1402dab 100644 --- a/src/survive_process.c +++ b/src/survive_process.c @@ -19,12 +19,13 @@ void survive_default_light_process( SurviveObject * so, int sensor_id, int acode } //We don't use sync times, yet. - if( sensor_id <= -1 ) - { - if( so->PoserFn ) - { + if (sensor_id <= -1) { + if (so->PoserFn) { PoserDataLight l = { - .hdr = { .pt = POSERDATA_SYNC, }, + .hdr = + { + .pt = POSERDATA_SYNC, + }, .sensor_id = sensor_id, .acode = acode, .timecode = timecode, @@ -32,7 +33,7 @@ void survive_default_light_process( SurviveObject * so, int sensor_id, int acode .angle = 0, .lh = lh, }; - so->PoserFn( so, (PoserData *)&l ); + so->PoserFn(so, (PoserData *)&l); } return; } @@ -131,9 +132,10 @@ void survive_default_raw_pose_process(SurviveObject *so, uint8_t lighthouse, Sur so->FromLHPose[lighthouse] = *pose; } -void survive_default_lighthouse_pose_process(SurviveContext *ctx, uint8_t lighthouse, SurvivePose *pose) { - if (pose) { - ctx->bsd[lighthouse].Pose = *pose; +void survive_default_lighthouse_pose_process(SurviveContext *ctx, uint8_t lighthouse, SurvivePose *lighthouse_pose, + SurvivePose *object_pose) { + if (lighthouse_pose) { + ctx->bsd[lighthouse].Pose = *lighthouse_pose; ctx->bsd[lighthouse].PositionSet = 1; } else { ctx->bsd[lighthouse].PositionSet = 0; @@ -148,19 +150,21 @@ int survive_default_htc_config_process(SurviveObject *so, char *ct0conf, int len } void survive_default_imu_process( SurviveObject * so, int mask, FLT * accelgyromag, uint32_t timecode, int id ) { - if( so->PoserFn ) - { - PoserDataIMU 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]}, - .timecode = timecode, - }; + PoserDataIMU 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]}, + .timecode = timecode, + }; + + SurviveSensorActivations_add_imu(&so->activations, &imu); + + if (so->PoserFn) { so->PoserFn( so, (PoserData *)&imu ); } } |