mirror of
https://github.com/jwetzell/rttrp-js.git
synced 2026-08-21 14:59:05 +00:00
add decoder for orientation submodules
This commit is contained in:
@@ -35,6 +35,40 @@ const goodTests = [
|
||||
},
|
||||
decoder: Decoders.CentroidPosition,
|
||||
},
|
||||
{
|
||||
description: 'Orientation (Quaternion)',
|
||||
bytes: new Uint8Array([
|
||||
0x03, 0x00, 37, 0x00, 0x10, 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, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
]),
|
||||
expected: {
|
||||
type: 0x03,
|
||||
size: 37,
|
||||
latency: 16,
|
||||
Qx: 1.0,
|
||||
Qy: 2.0,
|
||||
Qz: 3.0,
|
||||
Qw: 4.0,
|
||||
},
|
||||
decoder: Decoders.OrientationQuaternion,
|
||||
},
|
||||
{
|
||||
description: 'Orientation (Euler)',
|
||||
bytes: new Uint8Array([
|
||||
0x04, 0x00, 31, 0x00, 0x10, 0x01, 0x23, 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x40, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
]),
|
||||
expected: {
|
||||
type: 0x04,
|
||||
size: 31,
|
||||
latency: 16,
|
||||
order: 0x0123,
|
||||
r1: 1.0,
|
||||
r2: 2.0,
|
||||
r3: 3.0,
|
||||
},
|
||||
decoder: Decoders.OrientationEuler,
|
||||
},
|
||||
];
|
||||
|
||||
describe('RTTrP Bytes Decoding', () => {
|
||||
|
||||
Reference in New Issue
Block a user