mirror of
https://github.com/jwetzell/rttrp-js.git
synced 2026-09-08 23:59:02 +00:00
add decoder for accel velocity submodules
This commit is contained in:
@@ -86,6 +86,51 @@ const goodTests = [
|
||||
},
|
||||
decoder: Decoders.OrientationEuler,
|
||||
},
|
||||
{
|
||||
description: 'Centroid Acceleration and Velocity',
|
||||
bytes: new Uint8Array([
|
||||
0x20, 0x00, 51, 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x40, 0xa0, 0x00, 0x00, 0x40, 0xc0, 0x00,
|
||||
0x00, 0x40, 0xe0, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x41, 0x10, 0x00, 0x00,
|
||||
]),
|
||||
expected: {
|
||||
type: 0x20,
|
||||
size: 51,
|
||||
x: 1.0,
|
||||
y: 2.0,
|
||||
z: 3.0,
|
||||
accelX: 4.0,
|
||||
accelY: 5.0,
|
||||
accelZ: 6.0,
|
||||
velocityX: 7.0,
|
||||
velocityY: 8.0,
|
||||
velocityZ: 9.0,
|
||||
},
|
||||
decoder: Decoders.CentroidAccelVelocity,
|
||||
},
|
||||
{
|
||||
description: 'Tracked Point Acceleration and Velocity',
|
||||
bytes: new Uint8Array([
|
||||
0x21, 0x00, 52, 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x00, 0x00, 0x40, 0xa0, 0x00, 0x00, 0x40, 0xc0, 0x00,
|
||||
0x00, 0x40, 0xe0, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x41, 0x10, 0x00, 0x00, 0x01,
|
||||
]),
|
||||
expected: {
|
||||
type: 0x21,
|
||||
size: 52,
|
||||
x: 1.0,
|
||||
y: 2.0,
|
||||
z: 3.0,
|
||||
accelX: 4.0,
|
||||
accelY: 5.0,
|
||||
accelZ: 6.0,
|
||||
velocityX: 7.0,
|
||||
velocityY: 8.0,
|
||||
velocityZ: 9.0,
|
||||
index: 1,
|
||||
},
|
||||
decoder: Decoders.TrackedPointAccelVelocity,
|
||||
},
|
||||
];
|
||||
|
||||
describe('RTTrP Bytes Decoding', () => {
|
||||
|
||||
Reference in New Issue
Block a user