1- import type { JsonValue , Struct } from '@bufbuild/protobuf' ;
1+ import { type JsonValue , Struct } from '@bufbuild/protobuf' ;
22import type { CallOptions , PromiseClient } from '@connectrpc/connect' ;
33import { GetPropertiesRequest } from '../../gen/component/base/v1/base_pb' ;
44import { CameraService } from '../../gen/component/camera/v1/camera_connect' ;
@@ -31,10 +31,15 @@ export class CameraClient implements Camera {
3131 this . options = options ;
3232 }
3333
34- async getImage ( mimeType : MimeType = '' , callOptions = this . callOptions ) {
34+ async getImage (
35+ mimeType : MimeType = '' ,
36+ extra = { } ,
37+ callOptions = this . callOptions
38+ ) {
3539 const request = new GetImageRequest ( {
3640 name : this . name ,
3741 mimeType,
42+ extra : Struct . fromJson ( extra ) ,
3843 } ) ;
3944
4045 this . options . requestLogger ?.( request ) ;
@@ -43,10 +48,15 @@ export class CameraClient implements Camera {
4348 return resp . image ;
4449 }
4550
46- async renderFrame ( mimeType : MimeType = '' , callOptions = this . callOptions ) {
51+ async renderFrame (
52+ mimeType : MimeType = '' ,
53+ extra = { } ,
54+ callOptions = this . callOptions
55+ ) {
4756 const request = new RenderFrameRequest ( {
4857 name : this . name ,
4958 mimeType,
59+ extra : Struct . fromJson ( extra ) ,
5060 } ) ;
5161
5262 this . options . requestLogger ?.( request ) ;
@@ -55,10 +65,11 @@ export class CameraClient implements Camera {
5565 return new Blob ( [ resp . data ] , { type : mimeType } ) ;
5666 }
5767
58- async getPointCloud ( callOptions = this . callOptions ) {
68+ async getPointCloud ( extra = { } , callOptions = this . callOptions ) {
5969 const request = new GetPointCloudRequest ( {
6070 name : this . name ,
6171 mimeType : PointCloudPCD ,
72+ extra : Struct . fromJson ( extra ) ,
6273 } ) ;
6374
6475 this . options . requestLogger ?.( request ) ;
0 commit comments