mirror of
https://github.com/lbgos/rift-s-linux.git
synced 2026-10-29 04:02:05 +01:00
d/vive: Use double for imu ranges
This commit is contained in:
1 parent
0f34fea864
commit
638666100d
1 file changed
+3
-3
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user