aboutsummaryrefslogtreecommitdiff
path: root/src/survive_process.c
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-03-11 15:31:28 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-03-12 09:52:50 -0600
commit95eab1b8938e0033a0aa0d10d6ec53d7d2782907 (patch)
treee92f9abf0287fea8c91abadf8a095318507a8885 /src/survive_process.c
parent7fadeeff29074520224be385ecd6c50271a07220 (diff)
downloadlibsurvive-95eab1b8938e0033a0aa0d10d6ec53d7d2782907.tar.gz
libsurvive-95eab1b8938e0033a0aa0d10d6ec53d7d2782907.tar.bz2
Added callback for lighthouse found; example in test.c
Diffstat (limited to 'src/survive_process.c')
-rw-r--r--src/survive_process.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/survive_process.c b/src/survive_process.c
index d156d9e..420e771 100644
--- a/src/survive_process.c
+++ b/src/survive_process.c
@@ -2,6 +2,7 @@
//All MIT/x11 Licensed Code in this file may be relicensed freely under the GPL or LGPL licenses.
#include "survive_cal.h"
+#include "survive_config.h"
//XXX TODO: Once data is avialble in the context, use the stuff here to handle converting from time codes to
//proper angles, then from there perform the rest of the solution.
@@ -108,6 +109,18 @@ void survive_default_raw_pose_process(SurviveObject *so, uint8_t lighthouse, Sur
}
+void survive_default_lighthouse_pose_process(SurviveContext *ctx, uint8_t lighthouse, SurvivePose *pose) {
+ if (pose) {
+ ctx->bsd[lighthouse].Pose = *pose;
+ ctx->bsd[lighthouse].PositionSet = 1;
+ } else {
+ ctx->bsd[lighthouse].PositionSet = 0;
+ }
+
+ config_set_lighthouse(ctx->lh_config, &ctx->bsd[lighthouse], lighthouse);
+ config_save(ctx, "config.json");
+}
+
void survive_default_imu_process( SurviveObject * so, int mask, FLT * accelgyromag, uint32_t timecode, int id )
{
if( so->PoserFn )