Closed gauteh closed 1 year ago
test waves::wire::tests::round_trip_integers ... ok
accel half avg diff: 0.0024894755
accel half max diff: 0.0078125
test waves::wire::tests::round_trip_accel_half16 ... ok
accel u16 avg diff: 0.00044897446
accel u16 max diff: 0.0008983612
test waves::wire::tests::round_trip_accel ... ok
gyro u16 avg diff: 0.00009988881
gyro u16 max diff: 0.00019979477
test waves::wire::tests::round_trip_gyro ... ok
gyro half avg diff: 0.0005784875
gyro half max diff: 0.001953125
test waves::wire::tests::round_trip_gyro_half16 ... ok
Seems like it does perform better.
Resolution obviously depends on range, now I use a fixed range of:
2 * 3 * 9.81 for accel, unit m/2^2
2 * 3 * 125 * DPS_TO_RAD for gyro, unit rad/s
rads is better than dps, maybe using g's would be better. conversion is done in f64 to avoid overflow.
@jerabaul29 I get about two decimals accuracy when doing round-trip serializations.
https://github.com/gauteh/sfy/pull/113/files#diff-b9a853ae65eda204eb14283f1428b451ff30095919f8ae0890aa1127c37def99R71