diff options
author | Justin Berger <j.david.berger@gmail.com> | 2018-04-03 23:44:14 -0600 |
---|---|---|
committer | Justin Berger <j.david.berger@gmail.com> | 2018-04-03 23:44:14 -0600 |
commit | c7d9d271796b20f886e2441de852498ecb25ca82 (patch) | |
tree | 5929c2793c33c80e5392982a9baaa8d5ccaca724 /include/libsurvive/survive.h | |
parent | fe025b0ff6bfb440da7cec8f388fa951910a86f0 (diff) | |
parent | 6a45298c9bc34aac59cc2ebb9de2d82c7a42756e (diff) | |
download | libsurvive-c7d9d271796b20f886e2441de852498ecb25ca82.tar.gz libsurvive-c7d9d271796b20f886e2441de852498ecb25ca82.tar.bz2 |
Merge branch 'master' into imu
Diffstat (limited to 'include/libsurvive/survive.h')
-rw-r--r-- | include/libsurvive/survive.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h index 7248b1c..65343b7 100644 --- a/include/libsurvive/survive.h +++ b/include/libsurvive/survive.h @@ -75,6 +75,7 @@ struct SurviveObject { // Pose Information, also "poser" field. FLT PoseConfidence; // 0..1 SurvivePose OutPose; // Final pose? (some day, one can dream!) + uint32_t OutPose_timecode; SurvivePose FromLHPose[NUM_LIGHTHOUSES]; // 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; @@ -114,12 +115,20 @@ struct SurviveObject { haptic_func haptic; SurviveSensorActivations activations; + void *user_ptr; // Debug int tsl; }; // These exports are mostly for language binding against SURVIVE_EXPORT const char *survive_object_codename(SurviveObject *so); + +SURVIVE_EXPORT const char *survive_object_drivername(SurviveObject *so); +SURVIVE_EXPORT const int8_t survive_object_charge(SurviveObject *so); +SURVIVE_EXPORT const bool survive_object_charging(SurviveObject *so); + +SURVIVE_EXPORT const SurvivePose *survive_object_pose(SurviveObject *so); + SURVIVE_EXPORT int8_t survive_object_sensor_ct(SurviveObject *so); SURVIVE_EXPORT const FLT *survive_object_sensor_locations(SurviveObject *so); SURVIVE_EXPORT const FLT *survive_object_sensor_normals(SurviveObject *so); @@ -199,7 +208,7 @@ struct SurviveContext { imu_process_func imuproc; angle_process_func angleproc; button_process_func buttonproc; - raw_pose_func rawposeproc; + pose_func poseproc; lighthouse_pose_func lighthouseposeproc; htc_config_func configfunction; handle_lightcap_func lightcapfunction; @@ -232,7 +241,7 @@ struct SurviveContext { struct survive_calibration_config calibration_config; }; -void survive_verify_FLT_size( +SURVIVE_EXPORT void survive_verify_FLT_size( uint32_t user_size); // Baked in size of FLT to verify users of the library have the correct setting. SURVIVE_EXPORT SurviveContext *survive_init_internal(int argc, char *const *argv); @@ -261,7 +270,7 @@ SURVIVE_EXPORT void survive_install_light_fn(SurviveContext *ctx, light_process_ SURVIVE_EXPORT void survive_install_imu_fn(SurviveContext *ctx, imu_process_func fbp); SURVIVE_EXPORT void survive_install_angle_fn(SurviveContext *ctx, angle_process_func fbp); SURVIVE_EXPORT void survive_install_button_fn(SurviveContext *ctx, button_process_func fbp); -SURVIVE_EXPORT void survive_install_raw_pose_fn(SurviveContext *ctx, raw_pose_func fbp); +SURVIVE_EXPORT void survive_install_pose_fn(SurviveContext *ctx, pose_func fbp); SURVIVE_EXPORT void survive_install_lighthouse_pose_fn(SurviveContext *ctx, lighthouse_pose_func fbp); SURVIVE_EXPORT int survive_startup(SurviveContext *ctx); SURVIVE_EXPORT int survive_poll(SurviveContext *ctx); @@ -271,7 +280,7 @@ SURVIVE_EXPORT SurviveObject *survive_get_so_by_name(SurviveContext *ctx, const // Utilitiy functions. int survive_simple_inflate(SurviveContext *ctx, const char *input, int inlen, char *output, int outlen); -int survive_send_magic(SurviveContext *ctx, int magic_code, void *data, int datalen); +SURVIVE_EXPORT int survive_send_magic(SurviveContext *ctx, int magic_code, void *data, int datalen); // These functions search both the stored-general and temporary sections for a parameter and return it. #define SC_GET 0 // Get, only. @@ -303,7 +312,7 @@ SURVIVE_EXPORT void survive_default_angle_process(SurviveObject *so, int sensor_ SURVIVE_EXPORT void survive_default_button_process(SurviveObject *so, uint8_t eventType, uint8_t buttonId, uint8_t axis1Id, uint16_t axis1Val, uint8_t axis2Id, uint16_t axis2Val); -SURVIVE_EXPORT void survive_default_raw_pose_process(SurviveObject *so, uint8_t lighthouse, SurvivePose *pose); +SURVIVE_EXPORT void survive_default_raw_pose_process(SurviveObject *so, uint32_t timecode, SurvivePose *pose); SURVIVE_EXPORT void survive_default_lighthouse_pose_process(SurviveContext *ctx, uint8_t lighthouse, SurvivePose *lh_pose, SurvivePose *obj_pose); SURVIVE_EXPORT int survive_default_htc_config_process(SurviveObject *so, char *ct0conf, int len); |