@formant/data-sdk 1.25.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/assets/PcdLoaderWorker-cb508551.js.map +1 -0
  2. package/dist/assets/ui-sdk-realtime-player-core-worker.umd-68a6e16a.js.map +1 -0
  3. package/dist/data-sdk.cjs.js +89 -56
  4. package/dist/data-sdk.cjs.js.map +1 -1
  5. package/dist/data-sdk.es.js +15289 -12519
  6. package/dist/data-sdk.es.js.map +1 -1
  7. package/dist/data-sdk.es6.js +15289 -12519
  8. package/dist/data-sdk.umd.js +89 -56
  9. package/dist/types/data-sdk/src/connector/common/Color.d.ts +13 -0
  10. package/dist/types/data-sdk/src/connector/common/Timeout.d.ts +1 -0
  11. package/dist/types/data-sdk/src/connector/common/defined.d.ts +3 -0
  12. package/dist/types/data-sdk/src/connector/common/delay.d.ts +1 -0
  13. package/dist/types/data-sdk/src/connector/common/duration.d.ts +10 -0
  14. package/dist/types/data-sdk/src/connector/common/equals.d.ts +1 -0
  15. package/dist/types/data-sdk/src/connector/common/filterDataByTime.d.ts +2 -0
  16. package/dist/types/data-sdk/src/connector/common/filterDataByType.d.ts +3 -0
  17. package/dist/types/data-sdk/src/connector/common/flattenPoints.d.ts +8 -0
  18. package/dist/types/data-sdk/src/connector/common/fork.d.ts +5 -0
  19. package/dist/types/data-sdk/src/connector/common/range.d.ts +1 -0
  20. package/dist/types/data-sdk/src/connector/common/throttle.d.ts +1 -0
  21. package/dist/types/data-sdk/src/connector/common/toJsonLines.d.ts +1 -0
  22. package/dist/types/data-sdk/src/connector/data/BaseUniverseDataConnector.d.ts +65 -0
  23. package/dist/types/data-sdk/src/connector/data/LiveUniverseData.d.ts +36 -0
  24. package/dist/types/data-sdk/src/connector/data/PcdLoaderWorker.d.ts +1 -0
  25. package/dist/types/data-sdk/src/connector/data/StoreCache.d.ts +17 -0
  26. package/dist/types/data-sdk/src/connector/data/TelemetryUniverseData.d.ts +43 -0
  27. package/dist/types/data-sdk/src/connector/data/pcd.d.ts +23 -0
  28. package/dist/types/data-sdk/src/connector/data/queryStore.d.ts +11 -0
  29. package/dist/types/data-sdk/src/connector/data/range.d.ts +1 -0
  30. package/dist/types/data-sdk/src/connector/model/IPcd.d.ts +20 -0
  31. package/dist/types/data-sdk/src/connector/model/IPose.d.ts +3 -0
  32. package/dist/types/data-sdk/src/connector/model/IUniverseData.d.ts +122 -0
  33. package/dist/types/data-sdk/src/connector/model/IUniverseGridMap.d.ts +10 -0
  34. package/dist/types/data-sdk/src/connector/model/IUniverseOdometry.d.ts +5 -0
  35. package/dist/types/data-sdk/src/connector/model/IUniversePath.d.ts +3 -0
  36. package/dist/types/data-sdk/src/connector/model/IUniversePointCloud.d.ts +6 -0
  37. package/dist/types/data-sdk/src/main.d.ts +15 -0
  38. package/package.json +7 -2
@@ -0,0 +1,13 @@
1
+ export declare class Color {
2
+ r: number;
3
+ g: number;
4
+ b: number;
5
+ a: number;
6
+ h: number;
7
+ s: number;
8
+ l: number;
9
+ static fromString(color: string): Color | undefined;
10
+ constructor(r: number, g: number, b: number, a?: number);
11
+ toString(): string;
12
+ withAlpha(a: number): Color;
13
+ }
@@ -0,0 +1 @@
1
+ export type Timeout = ReturnType<typeof setTimeout>;
@@ -0,0 +1,3 @@
1
+ export declare function defined<T>(value: T | undefined, errorMessage?: string): T;
2
+ export declare function notNull<T>(value: T | null, errorMessage?: string): T;
3
+ export declare function definedAndNotNull<T>(value: T | undefined | null, errorMessage?: string): T;
@@ -0,0 +1 @@
1
+ export declare function delay(ms: number): Promise<unknown>;
@@ -0,0 +1,10 @@
1
+ export declare const duration: {
2
+ readonly millisecond: 1;
3
+ readonly second: 1000;
4
+ readonly minute: number;
5
+ readonly hour: number;
6
+ readonly day: number;
7
+ readonly week: number;
8
+ readonly month: number;
9
+ readonly year: number;
10
+ };
@@ -0,0 +1 @@
1
+ export declare function equals<T>(a: T, b: T): boolean;
@@ -0,0 +1,2 @@
1
+ import { IStreamData } from "../../model/IStreamData";
2
+ export declare function filterDataByTime(datas: IStreamData[], start: Date, end: Date): IStreamData[];
@@ -0,0 +1,3 @@
1
+ import { IStreamData } from "../../model/IStreamData";
2
+ import { StreamType } from "../../model/StreamType";
3
+ export declare function filterDataByType<T extends StreamType>(datas: IStreamData[], type: T): IStreamData<T>[];
@@ -0,0 +1,8 @@
1
+ import { IStreamData, StreamType, Timestamp } from "../../main";
2
+ export interface IFlattenedPoint {
3
+ streamName: string;
4
+ streamType: StreamType;
5
+ timestamp: Timestamp;
6
+ value: any;
7
+ }
8
+ export declare function flattenPoints(streamData: IStreamData): IFlattenedPoint[];
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Used to fire-and-forget a promise.
3
+ * This is useful as a function wrapper to suppress floating promise warnings.
4
+ */
5
+ export declare function fork<T>(_: Promise<T>): void;
@@ -0,0 +1 @@
1
+ export declare const range: (start: number, end: number) => number[];
@@ -0,0 +1 @@
1
+ export declare const throttle: <T>(callback: (...args: T[]) => void, time: number) => (...args: T[]) => void;
@@ -0,0 +1 @@
1
+ export declare function toJsonLines(objects: any[]): string;
@@ -0,0 +1,65 @@
1
+ import { H264BytestreamCanvasDrawer } from "@formant/ui-sdk-realtime-player-core";
2
+ import { CloseSubscription, DataSourceState, IRealtimeStream, ITelemetryRosStream, ITelemetryStream, IUniverseStatistics, Interaction, RealtimeButtonConfiguration, UniverseDataSource } from "../model/IUniverseData";
3
+ import { Device } from "../../devices/Device";
4
+ import { PeerDevice } from "../../devices/PeerDevice";
5
+ import { IRtcStreamMessage } from "@formant/realtime-sdk";
6
+ import { IStreamData } from "../../model/IStreamData";
7
+ import { ITransform } from "@formant/realtime-sdk/dist/model/ITransform";
8
+ import { IBitset } from "../../model/IBitset";
9
+ import { ITransformNode } from "../../model/ITransformNode";
10
+ import { ILocation } from "../../model/ILocation";
11
+ export type DeviceId = string;
12
+ export type DataSourceId = string;
13
+ export type DataResult<T> = {
14
+ deviceId: DeviceId;
15
+ sourceId: DataSourceId;
16
+ data: T | undefined;
17
+ };
18
+ export declare class BasicUniverseDataConnector {
19
+ pcdWorker: any;
20
+ subscriberSources: Map<string, Map<string, UniverseDataSource>>;
21
+ subscriberLoaders: Map<DeviceId, Map<DataSourceId, (data: any) => Promise<DataResult<any>>>>;
22
+ subscriberDistributorsLoaders: Map<DeviceId, Map<DataSourceId, ((data: any) => void)[]>>;
23
+ mapRealtimeConnections: Map<string, Device | PeerDevice | "loading">;
24
+ lastQueriedHistoricTime: Date | undefined;
25
+ time: Date | "live";
26
+ timeChangeListeners: ((time: Date | "live") => void)[];
27
+ setTime(time: Date | "live"): void;
28
+ constructor();
29
+ private generateTelemetryFilter;
30
+ protected sendRtcMessage(deviceId: string, msg: IRtcStreamMessage): Promise<void>;
31
+ protected createRealtimeConnection(deviceId: string, sessionType?: number): Promise<void>;
32
+ protected addRemovableTelemetrySubscription<T>(deviceId: string, source: UniverseDataSource, loader: (data: IStreamData[]) => Promise<DataResult<T>>, distribute: (data: T) => void): () => void;
33
+ protected createH264Drawer(): H264BytestreamCanvasDrawer;
34
+ sendCommand(deviceId: string, name: string, data?: string | undefined): Promise<void>;
35
+ sendRealtimePose(deviceId: string, streamName: string, pose: ITransform): Promise<void>;
36
+ sendRealtimeBoolean(deviceId: string, streamName: string, value: boolean): Promise<void>;
37
+ sendRealtimeBitset(deviceId: string, streamName: string, bitset: IBitset): Promise<void>;
38
+ getUrdfs(deviceId: string): Promise<string[]>;
39
+ getTelemetryStreams(_deviceId: string): Promise<ITelemetryStream[]>;
40
+ getTeleopRosStreams(_deviceId: string): Promise<ITelemetryRosStream[]>;
41
+ getHardwareStreams(_deviceId: string): Promise<IRealtimeStream[]>;
42
+ addInteraction(_interaction: Interaction): void;
43
+ removeInteraction(_id: string): void;
44
+ getInteractions(): Interaction[];
45
+ addInteractionsChangedListener(_callback: (interactions: Interaction[]) => void): () => void;
46
+ addInteractionListener(_callback: (interaction: Interaction) => void): () => void;
47
+ getRealtimeButtons(_deviceId: string): Promise<RealtimeButtonConfiguration[]>;
48
+ getLatestTransformTrees(_deviceId: string): Promise<{
49
+ streamName: string;
50
+ transformTree: ITransformNode;
51
+ }[]>;
52
+ getLatestLocations(): Promise<{
53
+ streamName: string;
54
+ location: ILocation;
55
+ }[]>;
56
+ getDeviceContexts(): Promise<{
57
+ deviceName: string;
58
+ deviceId: string;
59
+ }[]>;
60
+ getDeviceContextName(_deviceId: string): Promise<string | undefined>;
61
+ getTelemetryStreamType(_deviceId: string, _streamName: string): Promise<string | undefined>;
62
+ getStatistics(): Promise<IUniverseStatistics>;
63
+ subscribeDataSourceStateChange(_deviceId: string, _source: UniverseDataSource, _onDataSourceStateChange?: (state: DataSourceState) => void): CloseSubscription;
64
+ fetchImage(url: string): Promise<HTMLImageElement>;
65
+ }
@@ -0,0 +1,36 @@
1
+ import { RealtimeListener } from "../../devices/device.types";
2
+ import { IBitset } from "../../model/IBitset";
3
+ import { IJointState } from "../../model/IJointState";
4
+ import { INumericSetEntry } from "../../model/INumericSetEntry";
5
+ import { ITransformNode } from "../../model/ITransformNode";
6
+ import { IPose } from "../model/IPose";
7
+ import { IUniverseData, UniverseDataSource, CloseSubscription } from "../model/IUniverseData";
8
+ import { IUniverseGridMap } from "../model/IUniverseGridMap";
9
+ import { IUniverseOdometry } from "../model/IUniverseOdometry";
10
+ import { IUniversePath } from "../model/IUniversePath";
11
+ import { IUniversePointCloud } from "../model/IUniversePointCloud";
12
+ import { BasicUniverseDataConnector } from "./BaseUniverseDataConnector";
13
+ import { IMarker3DArray } from "../../model/IMarker3DArray";
14
+ import { ILocation } from "../../model/ILocation";
15
+ export declare class LiveUniverseData extends BasicUniverseDataConnector implements IUniverseData {
16
+ constructor();
17
+ subscribeToPath(_deviceId: string, _source: UniverseDataSource, _callback: (data: Symbol | IUniversePath) => void): CloseSubscription;
18
+ subscribeToImage(_deviceId: string, _source: UniverseDataSource, _callback: (image: HTMLCanvasElement) => void): CloseSubscription;
19
+ subcribeToVideo(_deviceId: string, _source: UniverseDataSource, _callback: (frame: HTMLVideoElement) => void): CloseSubscription;
20
+ subscribeToBitset(deviceId: string, source: UniverseDataSource, callback: (data: IBitset | Symbol) => void): CloseSubscription;
21
+ subscribeToOdometry(deviceId: string, source: UniverseDataSource, callback: (data: IUniverseOdometry) => void): CloseSubscription;
22
+ subscribeToPose(deviceId: string, source: UniverseDataSource, callback: (data: IPose) => void): CloseSubscription;
23
+ subscribeToNumeric(deviceId: string, source: UniverseDataSource, callback: (num: [number, number][]) => void): CloseSubscription;
24
+ subscribeToNumericSet(deviceId: string, source: UniverseDataSource, callback: (entry: [number, INumericSetEntry[]][]) => void): CloseSubscription;
25
+ subscribeToRealtimeMessages(deviceId: string, streamName: string, callback: RealtimeListener): Promise<void>;
26
+ unsubscribeToRealtimeMessages(deviceId: string, streamName: string, callback: RealtimeListener): Promise<void>;
27
+ subscribeToJson<T>(deviceId: string, source: UniverseDataSource, callback: (data: T) => void): CloseSubscription;
28
+ subscribeToText(deviceId: string, source: UniverseDataSource, callback: (data: string) => void): CloseSubscription;
29
+ subscribeToPointCloud(deviceId: string, source: UniverseDataSource, callback: (data: IUniversePointCloud) => void): () => void;
30
+ subscribeToGeometry(_deviceId: string, _source: UniverseDataSource, _callback: (data: IMarker3DArray) => void): () => void;
31
+ subscribeToJointState(deviceId: string, source: UniverseDataSource, callback: (data: IJointState) => void): () => void;
32
+ subscribeToGridMap(deviceId: string, source: UniverseDataSource, callback: (data: IUniverseGridMap) => void): () => void;
33
+ subscribeToVideo(deviceId: string, source: UniverseDataSource, callback: (frame: HTMLCanvasElement) => void): () => void;
34
+ subscribeToTransformTree(deviceId: string, source: UniverseDataSource, callback: (data: ITransformNode) => void): () => void;
35
+ subscribeToLocation(_deviceId: string, _source: UniverseDataSource, _callback: (data: ILocation) => void): () => void;
36
+ }
@@ -0,0 +1,17 @@
1
+ export declare class StoreCache<Key, Value> {
2
+ private entries;
3
+ private metadata;
4
+ private capacity;
5
+ private timeout;
6
+ constructor({ capacity, timeout, }?: {
7
+ capacity?: number;
8
+ timeout?: number;
9
+ });
10
+ get(key: Key, generator?: () => Promise<Value>): Value | undefined;
11
+ set(key: Key, value: Value): void;
12
+ clear(): void;
13
+ clearKey(key: string): void;
14
+ private keyToCacheKey;
15
+ private deleteOldestEntry;
16
+ private generate;
17
+ }
@@ -0,0 +1,43 @@
1
+ import { BasicUniverseDataConnector } from "./BaseUniverseDataConnector";
2
+ import { StoreCache } from "./StoreCache";
3
+ import { CloseSubscription, IUniverseData, UniverseDataSource } from "../model/IUniverseData";
4
+ import { IUniversePath } from "../model/IUniversePath";
5
+ import { IUniversePointCloud } from "../model/IUniversePointCloud";
6
+ import { IUniverseOdometry } from "../model/IUniverseOdometry";
7
+ import { IPose } from "../model/IPose";
8
+ import { IBitset } from "../../model/IBitset";
9
+ import { ITransformNode } from "../../model/ITransformNode";
10
+ import { ILocation } from "../../model/ILocation";
11
+ import { IUniverseGridMap } from "../model/IUniverseGridMap";
12
+ import { IJointState } from "../../model/IJointState";
13
+ import { IMarker3DArray } from "../../model/IMarker3DArray";
14
+ import { INumericSetEntry } from "../../model/INumericSetEntry";
15
+ import { StreamType } from "../../model/StreamType";
16
+ import { IDataPoint } from "../../model/IDataPoint";
17
+ export declare class TelemetryUniverseData extends BasicUniverseDataConnector implements IUniverseData {
18
+ liveIntervalHandle: number | undefined;
19
+ constructor();
20
+ subscribeToBitset(_deviceId: string, _source: UniverseDataSource, _callback: (data: IBitset | Symbol) => void): CloseSubscription;
21
+ subscribeToPath(deviceId: string, source: UniverseDataSource, callback: (data: Symbol | IUniversePath) => void): CloseSubscription;
22
+ onTimeChange(time: Date | "live"): void;
23
+ findDataForTime(time: Date): void;
24
+ timeFinders: ((time: Date) => void)[];
25
+ addFinder<T extends StreamType>(t: (f: "too much data" | IDataPoint<T>[] | undefined) => Promise<void>, deviceId: string, name: string, dataType: T, latestOnly: boolean): (time: Date) => void;
26
+ removeFinder(fn: (time: Date) => void): void;
27
+ subscribeTelemetry<T extends StreamType>(deviceId: string, source: UniverseDataSource, type: T, callback: (f: "too much data" | IDataPoint<T>[] | undefined) => Promise<void>): CloseSubscription;
28
+ subscribeToPointCloud(deviceId: string, source: UniverseDataSource, callback: (data: IUniversePointCloud | Symbol) => void): CloseSubscription;
29
+ subscribeToOdometry(deviceId: string, source: UniverseDataSource, callback: (data: Symbol | IUniverseOdometry) => void): CloseSubscription;
30
+ subscribeToPose(_deviceId: string, _source: UniverseDataSource, _callback: (data: Symbol | IPose) => void): CloseSubscription;
31
+ subscribeToGeometry(deviceId: string, source: UniverseDataSource, callback: (data: Symbol | IMarker3DArray) => void): CloseSubscription;
32
+ subscribeToJointState(deviceId: string, source: UniverseDataSource, callback: (data: Symbol | IJointState) => void): CloseSubscription;
33
+ subscribeToGridMap(deviceId: string, source: UniverseDataSource, callback: (data: Symbol | IUniverseGridMap) => void): CloseSubscription;
34
+ videoCache: StoreCache<string, HTMLVideoElement>;
35
+ subscribeToVideo(deviceId: string, source: UniverseDataSource, callback: (frame: Symbol | HTMLCanvasElement) => void): CloseSubscription;
36
+ subscribeToTransformTree(deviceId: string, source: UniverseDataSource, callback: (data: Symbol | ITransformNode) => void): CloseSubscription;
37
+ subscribeToLocation(deviceId: string, source: UniverseDataSource, callback: (data: Symbol | ILocation) => void): CloseSubscription;
38
+ subscribeToJson<T>(deviceId: string, source: UniverseDataSource, callback: (data: Symbol | T) => void): CloseSubscription;
39
+ subscribeToText(deviceId: string, source: UniverseDataSource, callback: (text: string | Symbol) => void): CloseSubscription;
40
+ subscribeToNumeric(deviceId: string, source: UniverseDataSource, callback: (num: Symbol | [number, number][]) => void): CloseSubscription;
41
+ subscribeToNumericSet(deviceId: string, source: UniverseDataSource, callback: (entry: Symbol | [number, INumericSetEntry[]][]) => void): CloseSubscription;
42
+ subscribeToImage(deviceId: string, source: UniverseDataSource, callback: (image: Symbol | HTMLCanvasElement) => void): CloseSubscription;
43
+ }
@@ -0,0 +1,23 @@
1
+ export type Field = "x" | "y" | "z" | "rgb" | "rgba" | "intensity";
2
+ export type Type = "i" | "u" | "f";
3
+ export type Data = "ascii" | "binary" | "binary_compressed";
4
+ export interface IPcdHeader {
5
+ version: string;
6
+ fields: Field[];
7
+ size: number[];
8
+ type: Type[];
9
+ count: number[];
10
+ height: number;
11
+ width: number;
12
+ points: number;
13
+ data: Data;
14
+ }
15
+ export interface IPcd {
16
+ header: IPcdHeader;
17
+ positions?: Float32Array;
18
+ colors?: Float32Array;
19
+ intensity?: Float32Array;
20
+ }
21
+ export declare function parse(buffer: ArrayBuffer): IPcd;
22
+ export declare function loadFromUrl(path: string): Promise<IPcd>;
23
+ export declare function loadFromBase64(data: string): IPcd;
@@ -0,0 +1,11 @@
1
+ import { IStreamData } from "../../model/IStreamData";
2
+ import { IFilter } from "../../model/IFilter";
3
+ import { StreamType } from "../../model/StreamType";
4
+ export declare class QueryStore {
5
+ private queryStoreCache;
6
+ private liveQueryStoreCache;
7
+ moduleQuery<T extends StreamType>(filter: IFilter, name: string, type: T, start: Date, end: Date, latestOnly?: boolean): IStreamData<T>[] | "too much data" | undefined;
8
+ query(filter: IFilter, start: Date, end: Date, latestOnly?: boolean): IStreamData[] | "too much data" | undefined;
9
+ private queryCache;
10
+ private liveQueryCache;
11
+ }
@@ -0,0 +1 @@
1
+ export declare const range: (start: number, end: number) => number[];
@@ -0,0 +1,20 @@
1
+ export type Field = "x" | "y" | "z" | "rgb" | "rgba" | "intensity";
2
+ export type Type = "i" | "u" | "f";
3
+ export type Data = "ascii" | "binary" | "binary_compressed";
4
+ export interface IPcdHeader {
5
+ version: string;
6
+ fields: Field[];
7
+ size: number[];
8
+ type: Type[];
9
+ count: number[];
10
+ height: number;
11
+ width: number;
12
+ points: number;
13
+ data: Data;
14
+ }
15
+ export interface IPcd {
16
+ header: IPcdHeader;
17
+ positions?: Float32Array | number[];
18
+ colors?: Float32Array | number[];
19
+ intensity?: Float32Array | number[];
20
+ }
@@ -0,0 +1,3 @@
1
+ import { ITransform } from "../../model/ITransform";
2
+ export interface IPose extends ITransform {
3
+ }
@@ -0,0 +1,122 @@
1
+ import { IJointState } from "../../model/IJointState";
2
+ import { ILocation } from "../../model/ILocation";
3
+ import { IMarker3DArray } from "../../model/IMarker3DArray";
4
+ import { ITransformNode } from "../../model/ITransformNode";
5
+ import { INumericSetEntry } from "../../model/INumericSetEntry";
6
+ import { IBitset } from "../../model/IBitset";
7
+ import { IUniverseOdometry } from "./IUniverseOdometry";
8
+ import { IPose } from "./IPose";
9
+ import { IUniverseGridMap } from "./IUniverseGridMap";
10
+ import { IUniversePointCloud } from "./IUniversePointCloud";
11
+ import { IUniversePath } from "./IUniversePath";
12
+ import { StreamType } from "../../model/StreamType";
13
+ export type DataSourceState = "missing_data" | "connected" | "disconnected" | "connecting" | "disconnecting";
14
+ export declare const NoData: unique symbol;
15
+ export declare const LoadingData: unique symbol;
16
+ export declare const FailedData: unique symbol;
17
+ export type DataStatus = Symbol;
18
+ export type RtcStreamType = "ping" | "pong" | "stream-control" | "streams-info" | "agent-info" | "numeric" | "boolean" | "bitset" | "twist" | "compressed-image" | "h264-video-frame" | "audio-chunk" | "pose" | "goal-id" | "joint-state" | "pose-with-covariance" | "point-cloud" | "marker-array" | "point" | "json-string";
19
+ export type CloseSubscription = () => void;
20
+ export interface UniverseRosDataSource {
21
+ id: string;
22
+ sourceType: "realtime";
23
+ rosTopicName: string;
24
+ rosTopicType: string;
25
+ }
26
+ export interface UniverseHardwareDataSource {
27
+ id: string;
28
+ sourceType: "hardware";
29
+ rtcStreamName: string;
30
+ }
31
+ export interface UniverseTelemetrySource {
32
+ id: string;
33
+ sourceType: "telemetry";
34
+ streamName: string;
35
+ streamType?: StreamType;
36
+ latestDataPoint?: boolean;
37
+ }
38
+ export type UniverseDataSource = UniverseRosDataSource | UniverseTelemetrySource | UniverseHardwareDataSource;
39
+ export interface ITelemetryStream {
40
+ name: string;
41
+ disabled?: boolean;
42
+ validation?: {
43
+ schemaId: string;
44
+ };
45
+ configuration: {
46
+ type: string;
47
+ mapTopic?: string;
48
+ };
49
+ }
50
+ export interface ITelemetryRosStream {
51
+ topicName: string;
52
+ topicType: string;
53
+ }
54
+ export interface IRealtimeStream {
55
+ rtcStreamType: RtcStreamType;
56
+ name: string;
57
+ }
58
+ export interface IUniverseStatistics {
59
+ rtcDevices: {
60
+ deviceId: string;
61
+ deviceName: string;
62
+ totalRtcDataBytes: number;
63
+ }[];
64
+ }
65
+ export interface Interaction {
66
+ deviceId: string;
67
+ id: string;
68
+ name: string;
69
+ description: string;
70
+ icon: string;
71
+ }
72
+ export interface RealtimeButtonConfiguration {
73
+ streamName: string;
74
+ }
75
+ export interface IUniverseData {
76
+ addInteraction: (interaction: Interaction) => void;
77
+ removeInteraction: (id: string) => void;
78
+ getInteractions: () => Interaction[];
79
+ addInteractionsChangedListener: (callback: (interactions: Interaction[]) => void) => () => void;
80
+ addInteractionListener: (callback: (interaction: Interaction) => void) => () => void;
81
+ setTime(time: Date | "live"): void;
82
+ getLatestTransformTrees(deviceId: string): Promise<{
83
+ streamName: string;
84
+ transformTree: ITransformNode;
85
+ }[]>;
86
+ getLatestLocations(deviceId: string): Promise<{
87
+ streamName: string;
88
+ location: ILocation;
89
+ }[]>;
90
+ getDeviceContexts(): Promise<{
91
+ deviceName: string;
92
+ deviceId: string;
93
+ }[]>;
94
+ getDeviceContextName(deviceId: string): Promise<string | undefined>;
95
+ getTelemetryStreamType(deviceId: string, streamName: string): Promise<string | undefined>;
96
+ getTelemetryStreams(deviceId: string): Promise<ITelemetryStream[]>;
97
+ getTeleopRosStreams(deviceId: string): Promise<ITelemetryRosStream[]>;
98
+ getUrdfs(deviceId: string): Promise<string[]>;
99
+ getHardwareStreams(deviceId: string): Promise<IRealtimeStream[]>;
100
+ subscribeToBitset(deviceId: string, source: UniverseDataSource, callback: (data: IBitset | DataStatus) => void): CloseSubscription;
101
+ subscribeToPointCloud(deviceId: string, source: UniverseDataSource, callback: (data: IUniversePointCloud | DataStatus) => void): CloseSubscription;
102
+ subscribeToOdometry(deviceId: string, source: UniverseDataSource, callback: (data: IUniverseOdometry | DataStatus) => void): CloseSubscription;
103
+ subscribeToPath(deviceId: string, source: UniverseDataSource, callback: (data: IUniversePath | DataStatus) => void): CloseSubscription;
104
+ subscribeToPose(deviceId: string, source: UniverseDataSource, callback: (data: IPose | DataStatus) => void): CloseSubscription;
105
+ subscribeToGeometry(deviceId: string, source: UniverseDataSource, callback: (data: IMarker3DArray | DataStatus) => void): CloseSubscription;
106
+ subscribeToJointState(deviceId: string, source: UniverseDataSource, callback: (data: IJointState | DataStatus) => void): CloseSubscription;
107
+ subscribeToGridMap(deviceId: string, source: UniverseDataSource, callback: (data: IUniverseGridMap | DataStatus) => void): CloseSubscription;
108
+ subscribeToVideo(deviceId: string, source: UniverseDataSource, callback: (frame: HTMLCanvasElement | DataStatus) => void): CloseSubscription;
109
+ subscribeToTransformTree(deviceId: string, source: UniverseDataSource, callback: (data: ITransformNode | DataStatus) => void): CloseSubscription;
110
+ subscribeToLocation(deviceId: string, source: UniverseDataSource, callback: (data: ILocation | DataStatus) => void): CloseSubscription;
111
+ subscribeToJson<T>(deviceId: string, source: UniverseDataSource, callback: (data: T | DataStatus) => void): CloseSubscription;
112
+ subscribeToText(deviceId: string, source: UniverseDataSource, callback: (text: string | DataStatus) => void): CloseSubscription;
113
+ subscribeToNumeric(deviceId: string, source: UniverseDataSource, callback: (num: [number, number][] | DataStatus) => void): CloseSubscription;
114
+ subscribeToNumericSet(deviceId: string, source: UniverseDataSource, callback: (entry: [number, INumericSetEntry[]][] | DataStatus) => void): CloseSubscription;
115
+ getStatistics(): Promise<IUniverseStatistics>;
116
+ subscribeDataSourceStateChange(deviceId: string, source: UniverseDataSource, onDataSourceStateChange?: (state: DataSourceState | DataStatus) => void): CloseSubscription;
117
+ subscribeToImage(deviceId: string, source: UniverseDataSource, callback: (image: HTMLCanvasElement | DataStatus) => void): CloseSubscription;
118
+ sendRealtimePose(deviceId: string, streamName: string, pose: IPose): Promise<void>;
119
+ sendRealtimeBoolean(deviceId: string, streamName: string, value: boolean): Promise<void>;
120
+ sendRealtimeBitset(deviceId: string, streamName: string, bitset: IBitset): Promise<void>;
121
+ sendCommand(deviceId: string, name: string, data?: string): Promise<void>;
122
+ }
@@ -0,0 +1,10 @@
1
+ import { ITransform } from "../../model/ITransform";
2
+ export interface IUniverseGridMap {
3
+ canvas: HTMLCanvasElement;
4
+ worldToLocal?: ITransform;
5
+ width: number;
6
+ height: number;
7
+ resolution: number;
8
+ origin: ITransform;
9
+ data: number[];
10
+ }
@@ -0,0 +1,5 @@
1
+ import { IPoseWithCovariance } from "../../model/IPoseWithCovariance";
2
+ import { ITransform } from "../../model/ITransform";
3
+ export interface IUniverseOdometry extends IPoseWithCovariance {
4
+ worldToLocal?: ITransform;
5
+ }
@@ -0,0 +1,3 @@
1
+ import { IPath } from "../../model/IPath";
2
+ export interface IUniversePath extends IPath {
3
+ }
@@ -0,0 +1,6 @@
1
+ import { ITransform } from "../../model/ITransform";
2
+ import { IPcd } from "./IPcd";
3
+ export interface IUniversePointCloud {
4
+ pcd?: IPcd;
5
+ worldToLocal?: ITransform;
6
+ }
@@ -155,3 +155,18 @@ export type { IConfirmForgotPasswordRequest } from "./stores/IConfirmForgotPassw
155
155
  export type { IRespondToNewPasswordRequiredChallengeRequest } from "./stores/IRespondToNewPasswordRequiredChallengeRequest";
156
156
  import "./init.ts";
157
157
  export { createRtcStreamMessage } from "@formant/realtime-sdk";
158
+ export * from "./connector/data/LiveUniverseData";
159
+ export * from "./connector/data/queryStore";
160
+ export * from "./connector/data/TelemetryUniverseData";
161
+ export * from "./connector/data/BaseUniverseDataConnector";
162
+ export * from "./connector/model/IPose";
163
+ export * from "./connector/model/IUniverseOdometry";
164
+ export * from "./connector/model/IUniverseData";
165
+ export { defined, definedAndNotNull } from "../../common/defined";
166
+ export type IUniverseGridMap = import("./connector/model/IUniverseGridMap").IUniverseGridMap;
167
+ export type IUniverseOdometry = import("./connector/model/IUniverseOdometry").IUniverseOdometry;
168
+ export type IPcd = import("./connector/model/IPcd").IPcd;
169
+ export type IPose = import("./connector/model/IPose").IPose;
170
+ export type IUniversePointCloud = import("./connector/model/IUniversePointCloud").IUniversePointCloud;
171
+ export type IUniversePath = import("./connector/model/IUniversePath").IUniversePath;
172
+ export type IUniverseData = import("./connector/model/IUniverseData").IUniverseData;
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  }
25
25
  }
26
26
  },
27
- "version": "1.25.0",
27
+ "version": "1.27.0",
28
28
  "scripts": {
29
29
  "preversion": "npm run verify",
30
30
  "postversion": "make",
@@ -62,11 +62,16 @@
62
62
  },
63
63
  "types": "./dist/types/data-sdk/src/main.d.ts",
64
64
  "dependencies": {
65
+ "@formant/ui-sdk-realtime-player-core": "^0.0.2",
66
+ "@formant/ui-sdk-realtime-player-core-worker": "^0.0.4",
67
+ "@types/validator": "^13.11.8",
65
68
  "base-64": "^1.0.0",
66
69
  "base64-js": "^1.5.1",
67
70
  "date-fns": "^2.30.0",
68
71
  "eventemitter3": "^5.0.1",
69
- "pako": "^2.1.0"
72
+ "lzfjs": "^1.0.1",
73
+ "pako": "^2.1.0",
74
+ "validator": "^13.11.0"
70
75
  },
71
76
  "engines": {
72
77
  "node": "^18.12.0 || ^16.13.0"