The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/vive: Use double for imu ranges

authored by

Christoph Haag and committed by
Jakob Bornecrantz
63866610 0f34fea8

+3 -3
+3 -3
src/xrt/drivers/vive/vive_device.c
··· 346 346 347 347 /* From there, handle all new samples */ 348 348 for (j = 3; j; --j, i = (i + 1) % 3) { 349 - float scale; 349 + double scale; 350 350 uint8_t seq; 351 351 352 352 sample = report->sample + i; ··· 365 365 (int16_t)__le16_to_cpu(sample->acc[2]), 366 366 }; 367 367 368 - scale = (float)d->config.imu.acc_range / 32768.0f; 368 + scale = (double)d->config.imu.acc_range / 32768.0f; 369 369 struct xrt_vec3 acceleration = { 370 370 scale * d->config.imu.acc_scale.x * acc[0] - d->config.imu.acc_bias.x, 371 371 scale * d->config.imu.acc_scale.y * acc[1] - d->config.imu.acc_bias.y, ··· 378 378 (int16_t)__le16_to_cpu(sample->gyro[2]), 379 379 }; 380 380 381 - scale = (float)d->config.imu.gyro_range / 32768.0f; 381 + scale = (double)d->config.imu.gyro_range / 32768.0f; 382 382 struct xrt_vec3 angular_velocity = { 383 383 scale * d->config.imu.gyro_scale.x * gyro[0] - d->config.imu.gyro_bias.x, 384 384 scale * d->config.imu.gyro_scale.y * gyro[1] - d->config.imu.gyro_bias.y,