-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.js
39 lines (38 loc) · 1 KB
/
schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { extendSchema } from '../dist/index.js';
export const SCHEMA = extendSchema(
{
SourceTypeEnum: {
size: 1,
decode: (dv, offset) => ['Lidar', 'Camera'][dv.getUint8(offset)],
encode: (dv, offset, value) => {
dv.setUint8(offset, ['Lidar', 'Camera'].indexOf(value));
}
}
},
{
'#': {
trackedEntities: 'Array<TrackedEntity>',
trackedEntitiesOfInterest: 'Map<TrackedEntityRef>',
},
TrackedEntity: {
id: 'Int32',
class: 'Uint8',
pose: 'Pose',
velocity: 'Optional<Vector3>',
source: 'TrackedEntitySource',
waypoints: 'Optional<Array<TrackedEntityWayPoint>>'
},
TrackedEntityWayPoint: {
timestamp: 'Int32',
pose: 'Pose',
probability: 'Optional<Float32>',
},
Pose: {
position: 'Vector3',
rotation: 'Vector3',
size: 'Vector3'
},
TrackedEntitySource: ['SourceTypeEnum', 'OneOf<String,Int32>', 'Optional<String>'],
TrackedEntityRef: 'Ref<TrackedEntity>',
}
);