diff --git a/src/xrt/auxiliary/vive/vive_calibration.c b/src/xrt/auxiliary/vive/vive_calibration.c index 3a993da70..04a22b2b6 100644 --- a/src/xrt/auxiliary/vive/vive_calibration.c +++ b/src/xrt/auxiliary/vive/vive_calibration.c @@ -228,8 +228,8 @@ vive_get_slam_cams_calib(const struct vive_config *d, *out_calib1 = calib1; } -struct t_imu_calibration -vive_get_imu_calibration(const struct vive_config *d) +void +vive_get_imu_calibration(const struct vive_config *d, struct t_imu_calibration *out_calib) { struct xrt_vec3 ab = d->imu.acc_bias; @@ -253,15 +253,18 @@ vive_get_imu_calibration(const struct vive_config *d) .noise_std = {0.000282, 0.000282, 0.000282}, }, }; - return calib; + + *out_calib = calib; } -struct t_slam_imu_calibration -vive_get_slam_imu_calibration(const struct vive_config *d) +void +vive_get_slam_imu_calibration(const struct vive_config *d, struct t_slam_imu_calibration *out_calib) { struct t_slam_imu_calibration calib; const int IMU_FREQUENCY = 1000; - calib.base = vive_get_imu_calibration(d); + + vive_get_imu_calibration(d, &calib.base); calib.frequency = IMU_FREQUENCY; - return calib; + + *out_calib = calib; } diff --git a/src/xrt/auxiliary/vive/vive_calibration.h b/src/xrt/auxiliary/vive/vive_calibration.h index b927584d9..dfe81ab45 100644 --- a/src/xrt/auxiliary/vive/vive_calibration.h +++ b/src/xrt/auxiliary/vive/vive_calibration.h @@ -46,16 +46,16 @@ vive_get_slam_cams_calib(const struct vive_config *d, * * @ingroup drv_vive */ -struct t_imu_calibration -vive_get_imu_calibration(const struct vive_config *d); +void +vive_get_imu_calibration(const struct vive_config *d, struct t_imu_calibration *out_calib); /*! * Get a @ref t_slam_imu_calibration for the IMU. * * @ingroup drv_vive */ -struct t_slam_imu_calibration -vive_get_slam_imu_calibration(const struct vive_config *d); +void +vive_get_slam_imu_calibration(const struct vive_config *d, struct t_slam_imu_calibration *out_calib); #ifdef __cplusplus diff --git a/src/xrt/targets/common/target_builder_lighthouse.c b/src/xrt/targets/common/target_builder_lighthouse.c index 2f20bc622..f9d14225b 100644 --- a/src/xrt/targets/common/target_builder_lighthouse.c +++ b/src/xrt/targets/common/target_builder_lighthouse.c @@ -385,7 +385,7 @@ valve_index_setup_visual_trackers(struct lighthouse_system *lhs, // SLAM calibration lhs->slam_calib.cam_count = 2; vive_get_slam_cams_calib(lhs->hmd_config, &lhs->slam_calib.cams[0], &lhs->slam_calib.cams[1]); - lhs->slam_calib.imu = vive_get_slam_imu_calibration(lhs->hmd_config); + vive_get_slam_imu_calibration(lhs->hmd_config, &lhs->slam_calib.imu); // Initialize SLAM tracker struct xrt_slam_sinks *slam_sinks = NULL;