The open source OpenXR runtime
0
fork

Configure Feed

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

d/psmv: Use gyro_bias from calibration data on ZCM2

+16 -6
+16 -6
src/xrt/drivers/psmv/psmv_driver.c
··· 255 255 struct psmv_vec3_i16_wire accel_min_y; 256 256 struct psmv_vec3_i16_wire accel_max_z; 257 257 struct psmv_vec3_i16_wire accel_min_z; 258 - uint16_t _pad0; 259 - uint16_t _pad1; 260 - uint16_t _pad2; 261 - uint16_t _pad3; 262 - uint16_t _pad4; 258 + //! Pretty sure this is gryo bias. 259 + struct psmv_vec3_i16_wire gyro_bias; 260 + uint8_t _pad0[4]; 263 261 struct psmv_vec3_i16_wire gyro_pos_x; 264 262 struct psmv_vec3_i16_wire gyro_pos_y; 265 263 struct psmv_vec3_i16_wire gyro_pos_z; 266 264 struct psmv_vec3_i16_wire gyro_neg_x; 267 265 struct psmv_vec3_i16_wire gyro_neg_y; 268 266 struct psmv_vec3_i16_wire gyro_neg_z; 269 - uint16_t _pad[6]; 267 + uint8_t _pad1[12]; 270 268 }; 271 269 272 270 /*! ··· 414 412 struct xrt_vec3_i32 gyro_pos_y; 415 413 struct xrt_vec3_i32 gyro_neg_z; 416 414 struct xrt_vec3_i32 gyro_pos_z; 415 + 416 + //! Pretty sure this is gryo bias. 417 + struct xrt_vec3_i32 gyro_bias; 417 418 }; 418 419 419 420 /*! ··· 1366 1367 psmv_from_vec3_i16_wire(&zcm2->gyro_pos_y, &data.gyro_pos_y); 1367 1368 psmv_from_vec3_i16_wire(&zcm2->gyro_neg_z, &data.gyro_neg_z); 1368 1369 psmv_from_vec3_i16_wire(&zcm2->gyro_pos_z, &data.gyro_pos_z); 1370 + psmv_from_vec3_i16_wire(&zcm2->gyro_bias, &data.gyro_bias); 1369 1371 1370 1372 1371 1373 /* ··· 1405 1407 psmv->calibration.gyro.factor.y = (60.0 * gy) / (2.0 * M_PI * 90.0); 1406 1408 psmv->calibration.gyro.factor.z = (60.0 * gz) / (2.0 * M_PI * 90.0); 1407 1409 1410 + #if 0 1408 1411 psmv->calibration.gyro.bias.x = 1409 1412 (zcm2->gyro_neg_y.x + zcm2->gyro_pos_y.x + zcm2->gyro_neg_z.x + 1410 1413 zcm2->gyro_pos_z.x) / ··· 1417 1420 (zcm2->gyro_neg_x.z + zcm2->gyro_pos_x.z + zcm2->gyro_neg_y.z + 1418 1421 zcm2->gyro_pos_y.z) / 1419 1422 4.0; 1423 + #else 1424 + psmv->calibration.gyro.bias.x = zcm2->gyro_bias.x; 1425 + psmv->calibration.gyro.bias.y = zcm2->gyro_bias.y; 1426 + psmv->calibration.gyro.bias.z = zcm2->gyro_bias.z; 1427 + #endif 1420 1428 1421 1429 1422 1430 /* ··· 1439 1447 "\t\tgyro_pos_y: %6i %6i %6i\n" 1440 1448 "\t\tgyro_neg_z: %6i %6i %6i\n" 1441 1449 "\t\tgyro_pos_z: %6i %6i %6i\n" 1450 + "\t\tgyro_bias: %6i %6i %6i\n" 1442 1451 "\tCalculated:\n" 1443 1452 "\t\taccel.factor: %f %f %f\n" 1444 1453 "\t\taccel.bias: %f %f %f\n" ··· 1456 1465 zcm2->gyro_pos_y.x, zcm2->gyro_pos_y.y, zcm2->gyro_pos_y.z, 1457 1466 zcm2->gyro_neg_z.x, zcm2->gyro_neg_z.y, zcm2->gyro_neg_z.z, 1458 1467 zcm2->gyro_pos_z.x, zcm2->gyro_pos_z.y, zcm2->gyro_pos_z.z, 1468 + zcm2->gyro_bias.x, zcm2->gyro_bias.y, zcm2->gyro_bias.z, 1459 1469 psmv->calibration.accel.factor.x, psmv->calibration.accel.factor.y, 1460 1470 psmv->calibration.accel.factor.z, psmv->calibration.accel.bias.x, 1461 1471 psmv->calibration.accel.bias.y, psmv->calibration.accel.bias.z,