Skip to content

Commit a80b38b

Browse files
authored
RSDK-10128 - return extra from captureAllFromCamera (#478)
1 parent 00629a7 commit a80b38b

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/services/vision/client.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
createPromiseClient,
55
createRouterTransport,
66
} from '@connectrpc/connect';
7+
import { Struct } from '@bufbuild/protobuf';
78
import { beforeEach, describe, expect, it, vi } from 'vitest';
89
import { VisionService } from '../../gen/service/vision/v1/vision_connect';
910
import {
@@ -44,6 +45,8 @@ const pco: PointCloudObject = new PointCloudObject({
4445
geometries: undefined,
4546
});
4647

48+
const extra: Struct = Struct.fromJson({ key: 'value' });
49+
4750
describe('VisionClient Tests', () => {
4851
beforeEach(() => {
4952
const mockTransport = createRouterTransport(({ service }) => {
@@ -71,6 +74,7 @@ describe('VisionClient Tests', () => {
7174
classifications: [classification],
7275
detections: [detection],
7376
objects: [pco],
77+
extra,
7478
}),
7579
});
7680
});
@@ -153,6 +157,7 @@ describe('VisionClient Tests', () => {
153157
classifications: [classification],
154158
detections: [detection],
155159
objectPointClouds: [pco],
160+
extra,
156161
});
157162
});
158163
});

src/services/vision/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ export class VisionClient implements Vision {
190190
classifications: response.classifications,
191191
detections: response.detections,
192192
objectPointClouds: response.objects,
193+
extra: response.extra,
193194
};
194195
}
195196

src/services/vision/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Image } from '../../gen/component/camera/v1/camera_pb';
22

3-
import type { PlainMessage } from '@bufbuild/protobuf';
3+
import type { PlainMessage, Struct } from '@bufbuild/protobuf';
44
import * as commonApi from '../../gen/common/v1/common_pb';
55
import * as visionApi from '../../gen/service/vision/v1/vision_pb';
66

@@ -34,4 +34,5 @@ export interface CaptureAllResponse {
3434
classifications: Classification[];
3535
detections: Detection[];
3636
objectPointClouds: PointCloudObject[];
37+
extra: Struct | undefined;
3738
}

0 commit comments

Comments
 (0)