diff options
author | Justin Berger <j.david.berger@gmail.com> | 2018-03-11 15:31:28 -0600 |
---|---|---|
committer | Justin Berger <j.david.berger@gmail.com> | 2018-03-12 09:52:50 -0600 |
commit | 95eab1b8938e0033a0aa0d10d6ec53d7d2782907 (patch) | |
tree | e92f9abf0287fea8c91abadf8a095318507a8885 /test.c | |
parent | 7fadeeff29074520224be385ecd6c50271a07220 (diff) | |
download | libsurvive-95eab1b8938e0033a0aa0d10d6ec53d7d2782907.tar.gz libsurvive-95eab1b8938e0033a0aa0d10d6ec53d7d2782907.tar.bz2 |
Added callback for lighthouse found; example in test.c
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -84,6 +84,13 @@ void testprog_button_process(SurviveObject * so, uint8_t eventType, uint8_t butt } } +void testprog_lighthouse_process(SurviveContext *ctx, uint8_t lighthouse, SurvivePose *pose) { + survive_default_lighthouse_pose_process(ctx, lighthouse, pose); + + printf("Lighthouse: [%1.1x][% 08.8f,% 08.8f,% 08.8f] [% 08.8f,% 08.8f,% 08.8f,% 08.8f]\n", lighthouse, pose->Pos[0], + pose->Pos[1], pose->Pos[2], pose->Rot[0], pose->Rot[1], pose->Rot[2], pose->Rot[3]); +} + void testprog_raw_pose_process(SurviveObject *so, uint8_t lighthouse, SurvivePose *pose) { survive_default_raw_pose_process(so, lighthouse, pose); @@ -139,6 +146,7 @@ int main() survive_install_button_fn(ctx, testprog_button_process); survive_install_raw_pose_fn(ctx, testprog_raw_pose_process); survive_install_imu_fn(ctx, testprog_imu_process); + survive_install_lighthouse_pose_fn(ctx, testprog_lighthouse_process); if( !ctx ) { |