mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 19:16:21 +00:00
a/vive: Make imu config return be a out variable [NFC]
This commit is contained in:
parent
b93ed31cce
commit
d984950be1
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue