File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
src/components/pose-tracker Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ import { type JsonValue, Struct } from '@bufbuild/protobuf';
2
2
import type { CallOptions , PromiseClient } from '@connectrpc/connect' ;
3
3
import { PoseTrackerService } from '../../gen/component/posetracker/v1/pose_tracker_connect' ;
4
4
import type { RobotClient } from '../../robot' ;
5
- import type { Options } from '../../types' ;
5
+ import type { Options , PoseInFrame } from '../../types' ;
6
6
import { doCommandFromClient } from '../../utils' ;
7
7
import type { PoseTracker } from './pose-tracker' ;
8
8
import { GetGeometriesRequest } from '../../gen/common/v1/common_pb' ;
9
+ import { GetPosesRequest } from '../../gen/component/posetracker/v1/pose_tracker_pb' ;
9
10
10
11
/**
11
12
* A gRPC-web client for the Generic component.
@@ -46,4 +47,19 @@ export class PoseTrackerClient implements PoseTracker {
46
47
callOptions
47
48
) ;
48
49
}
50
+
51
+ async getPoses (
52
+ bodyNames ?: string [ ] ,
53
+ extra = { } ,
54
+ callOptions = this . callOptions
55
+ ) {
56
+ const request = new GetPosesRequest ( {
57
+ name : this . name ,
58
+ bodyNames,
59
+ extra : Struct . fromJson ( extra ) ,
60
+ } ) ;
61
+
62
+ const response = await this . client . getPoses ( request , callOptions ) ;
63
+ return response . bodyPoses ;
64
+ }
49
65
}
Original file line number Diff line number Diff line change 1
- import type { Geometry } from '../../gen/common/v1/common_pb' ;
1
+ import type { Geometry , PoseInFrame } from '../../gen/common/v1/common_pb' ;
2
2
import type { Struct , Resource } from '../../types' ;
3
3
4
4
/** Represents a generic component. */
@@ -23,4 +23,9 @@ export interface PoseTracker extends Resource {
23
23
* API](https://docs.viam.com/dev/reference/apis/components/generic/#getgeometries).
24
24
*/
25
25
getGeometries : ( extra ?: Struct ) => Promise < Geometry [ ] > ;
26
+
27
+ getPoses : (
28
+ bodyNames ?: string [ ] ,
29
+ extra ?: Struct
30
+ ) => Promise < Record < string , PoseInFrame > > ;
26
31
}
You can’t perform that action at this time.
0 commit comments