diff --git a/src/xrt/drivers/vive/vive_device.c b/src/xrt/drivers/vive/vive_device.c index 5a804ad81..7481eaea7 100644 --- a/src/xrt/drivers/vive/vive_device.c +++ b/src/xrt/drivers/vive/vive_device.c @@ -346,7 +346,7 @@ update_imu(struct vive_device *d, const void *buffer) /* From there, handle all new samples */ for (j = 3; j; --j, i = (i + 1) % 3) { - float scale; + double scale; uint8_t seq; sample = report->sample + i; @@ -365,7 +365,7 @@ update_imu(struct vive_device *d, const void *buffer) (int16_t)__le16_to_cpu(sample->acc[2]), }; - scale = (float)d->config.imu.acc_range / 32768.0f; + scale = (double)d->config.imu.acc_range / 32768.0f; struct xrt_vec3 acceleration = { scale * d->config.imu.acc_scale.x * acc[0] - d->config.imu.acc_bias.x, scale * d->config.imu.acc_scale.y * acc[1] - d->config.imu.acc_bias.y, @@ -378,7 +378,7 @@ update_imu(struct vive_device *d, const void *buffer) (int16_t)__le16_to_cpu(sample->gyro[2]), }; - scale = (float)d->config.imu.gyro_range / 32768.0f; + scale = (double)d->config.imu.gyro_range / 32768.0f; struct xrt_vec3 angular_velocity = { scale * d->config.imu.gyro_scale.x * gyro[0] - d->config.imu.gyro_bias.x, scale * d->config.imu.gyro_scale.y * gyro[1] - d->config.imu.gyro_bias.y,