mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-03 12:28:07 +00:00
d/wmr: Apply HMD IMU correction from calibration.
Apply the mix_matrix and bias_offsets adjustments for IMU readings.
This commit is contained in:
parent
ee030ff0c8
commit
c7549c8680
|
@ -264,11 +264,15 @@ hololens_sensors_read_packets(struct wmr_hmd *wh)
|
|||
struct xrt_vec3 raw_accel[4];
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
struct xrt_vec3 sample;
|
||||
vec3_from_hololens_gyro(wh->packet.gyro, i, &sample);
|
||||
struct xrt_vec3 raw_sample, sample;
|
||||
vec3_from_hololens_gyro(wh->packet.gyro, i, &raw_sample);
|
||||
math_matrix_3x3_transform_vec3(&wh->config.sensors.gyro.mix_matrix, &raw_sample, &sample);
|
||||
math_vec3_accum(&wh->config.sensors.gyro.bias_offsets, &sample);
|
||||
math_quat_rotate_vec3(&wh->gyro_to_centerline.orientation, &sample, &raw_gyro[i]);
|
||||
|
||||
vec3_from_hololens_accel(wh->packet.accel, i, &sample);
|
||||
math_matrix_3x3_transform_vec3(&wh->config.sensors.accel.mix_matrix, &raw_sample, &sample);
|
||||
math_vec3_accum(&wh->config.sensors.accel.bias_offsets, &sample);
|
||||
math_quat_rotate_vec3(&wh->accel_to_centerline.orientation, &sample, &raw_accel[i]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue