File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import type { PlainMessage, Struct } from '@bufbuild/protobuf';
22import type { Pose , Resource , Vector3 } from '../../types' ;
33
44import * as armApi from '../../gen/component/arm/v1/arm_pb' ;
5- import type { Geometry } from '../../gen/common/v1/common_pb' ;
5+ import type { Geometry , Mesh } from '../../gen/common/v1/common_pb' ;
66import type { Frame } from '../../gen/app/v1/robot_pb' ;
77
88export type ArmJointPositions = PlainMessage < armApi . JointPositions > ;
@@ -42,6 +42,19 @@ export interface Arm extends Resource {
4242 */
4343 getGeometries : ( extra ?: Struct ) => Promise < Geometry [ ] > ;
4444
45+ /**
46+ * Get the 3D models of the component
47+ *
48+ * @example
49+ *
50+ * ```ts
51+ * const arm = new VIAM.ArmClient(machine, 'my_arm');
52+ * const models = await arm.get3DModels();
53+ * console.log(models);
54+ * ```
55+ */
56+ get3DModels : ( extra ?: Struct ) => Promise < Record < string , Mesh > > ;
57+
4558 /**
4659 * Get the kinematics information associated with the arm.
4760 *
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ import type { Arm } from './arm';
1717import {
1818 GetGeometriesRequest ,
1919 GetKinematicsRequest ,
20+ Get3DModelsRequest ,
21+ Mesh ,
2022} from '../../gen/common/v1/common_pb' ;
2123
2224/**
@@ -62,6 +64,19 @@ export class ArmClient implements Arm {
6264 return response . geometries ;
6365 }
6466
67+ async get3DModels (
68+ extra = { } ,
69+ callOptions = this . callOptions
70+ ) : Promise < Record < string , Mesh > > {
71+ const request = new Get3DModelsRequest ( {
72+ name : this . name ,
73+ extra : Struct . fromJson ( extra ) ,
74+ } ) ;
75+
76+ const response = await this . client . get3DModels ( request , callOptions ) ;
77+ return response . models ;
78+ }
79+
6580 async getKinematics ( extra = { } , callOptions = this . callOptions ) {
6681 const request = new GetKinematicsRequest ( {
6782 name : this . name ,
You can’t perform that action at this time.
0 commit comments