Skip to content

Commit

Permalink
RSDK-7987 - Arm should re-export JointPositions type from proto (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaporter-work committed Jun 27, 2024
1 parent 3624126 commit 2bb7106
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/arm.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export type { Arm } from './arm/arm';
export type { Arm, ArmJointPositions } from './arm/arm';
export { ArmClient } from './arm/client';
4 changes: 3 additions & 1 deletion src/components/arm/arm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import type { JointPositions } from '../../gen/component/arm/v1/arm_pb';

import type { Pose, Resource, StructType } from '../../types';

export type ArmJointPositions = JointPositions.AsObject;

/** Represents a physical robot arm that exists in three-dimensional space. */
export interface Arm extends Resource {
/** Get the position of the end of the arm expressed as a pose */
Expand All @@ -26,7 +28,7 @@ export interface Arm extends Resource {
) => Promise<void>;

/** Gets the current position of each joint. */
getJointPositions: (extra?: StructType) => Promise<JointPositions>;
getJointPositions: (extra?: StructType) => Promise<ArmJointPositions>;

/** Stops the motion of the arm. */
stop: (extra?: StructType) => Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion src/components/arm/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class ArmClient implements Arm {
if (!result) {
throw new Error('no pose');
}
return result;
return result.toObject();
}

async stop(extra = {}) {
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export { type BillingClient } from './app/billing-client';
* @group Raw Protobufs
*/
export { default as armApi } from './gen/component/arm/v1/arm_pb';
export { type Arm, ArmClient } from './components/arm';
export { type Arm, type ArmJointPositions, ArmClient } from './components/arm';

/**
* Raw Protobuf interfaces for a Base component.
Expand Down

0 comments on commit 2bb7106

Please sign in to comment.