From d3eb48ada433a9665207046557458b252ac98364 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 16 Sep 2019 16:36:16 +0100 Subject: [PATCH] d/psmv: Normalize acceleration to gravity --- src/xrt/drivers/psmv/psmv_driver.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/xrt/drivers/psmv/psmv_driver.c b/src/xrt/drivers/psmv/psmv_driver.c index c6badcad5..3934384a2 100644 --- a/src/xrt/drivers/psmv/psmv_driver.c +++ b/src/xrt/drivers/psmv/psmv_driver.c @@ -602,11 +602,14 @@ update_fusion(struct psmv_device *psmv, struct xrt_vec3_i32 *rg = &sample->gyro; psmv->read.accel.x = (ra->x - psmv->calibration.accel.bias.x) / - psmv->calibration.accel.factor.x; + psmv->calibration.accel.factor.x * + MATH_GRAVITY_M_S2; psmv->read.accel.y = (ra->y - psmv->calibration.accel.bias.y) / - psmv->calibration.accel.factor.y; + psmv->calibration.accel.factor.y * + MATH_GRAVITY_M_S2; psmv->read.accel.z = (ra->z - psmv->calibration.accel.bias.z) / - psmv->calibration.accel.factor.z; + psmv->calibration.accel.factor.z * + MATH_GRAVITY_M_S2; psmv->read.gyro.x = (rg->x - psmv->calibration.gyro.bias.x) / psmv->calibration.gyro.factor.x;