@wandelbots/nova-js
Version:
Official JS client for the Wandelbots API
94 lines • 3.67 kB
TypeScript
import type { Joints, TcpPose } from "@wandelbots/nova-api/v1";
import type { AutoReconnectingWebsocket } from "../AutoReconnectingWebsocket";
import type { MotionStreamConnection } from "./MotionStreamConnection";
import type { NovaClient } from "./NovaClient";
export type JoggerConnectionOpts = {
/**
* When an error message is received from the jogging websocket, it
* will be passed here. If this handler is not provided, the error will
* instead be thrown as an unhandled error.
*/
onError?: (err: unknown) => void;
};
export declare class JoggerConnection {
readonly motionStream: MotionStreamConnection;
readonly opts: JoggerConnectionOpts;
cartesianWebsocket: AutoReconnectingWebsocket | null;
jointWebsocket: AutoReconnectingWebsocket | null;
cartesianJoggingOpts: {
tcpId?: string;
coordSystemId?: string;
};
static open(nova: NovaClient, motionGroupId: string, opts?: JoggerConnectionOpts): Promise<JoggerConnection>;
constructor(motionStream: MotionStreamConnection, opts?: JoggerConnectionOpts);
get motionGroupId(): string;
get nova(): NovaClient;
get numJoints(): number;
get activeJoggingMode(): "cartesian" | "joint" | "increment";
get activeWebsocket(): AutoReconnectingWebsocket | null;
stop(): Promise<void>;
dispose(): void;
setJoggingMode(mode: "cartesian" | "joint" | "increment", cartesianJoggingOpts?: {
tcpId?: string;
coordSystemId?: string;
}): void;
/**
* Start rotation of a single robot joint at the specified velocity
*/
startJointRotation({ joint, direction, velocityRadsPerSec, }: {
/** Index of the joint to rotate */
joint: number;
/** Direction of rotation ("+" or "-") */
direction: "+" | "-";
/** Speed of the rotation in radians per second */
velocityRadsPerSec: number;
}): Promise<void>;
/**
* Start the TCP moving along a specified axis at a given velocity
*/
startTCPTranslation({ axis, direction, velocityMmPerSec, }: {
axis: "x" | "y" | "z";
direction: "-" | "+";
velocityMmPerSec: number;
}): Promise<void>;
/**
* Start the TCP rotating around a specified axis at a given velocity
*/
startTCPRotation({ axis, direction, velocityRadsPerSec, }: {
axis: "x" | "y" | "z";
direction: "-" | "+";
velocityRadsPerSec: number;
}): Promise<void>;
/**
* Move the robot by a fixed distance in a single cartesian
* axis, either rotating or translating relative to the TCP.
* Promise resolves only after the motion has completed.
*/
runIncrementalCartesianMotion({ currentTcpPose, currentJoints, coordSystemId, velocityInRelevantUnits, axis, direction, motion, }: {
currentTcpPose: TcpPose;
currentJoints: Joints;
coordSystemId: string;
velocityInRelevantUnits: number;
axis: "x" | "y" | "z";
direction: "-" | "+";
motion: {
type: "rotate";
distanceRads: number;
} | {
type: "translate";
distanceMm: number;
};
}): Promise<void>;
/**
* Rotate a single robot joint by a fixed number of radians
* Promise resolves only after the motion has completed.
*/
runIncrementalJointRotation({ joint, currentJoints, velocityRadsPerSec, direction, distanceRads, }: {
joint: number;
currentJoints: Joints;
velocityRadsPerSec: number;
direction: "-" | "+";
distanceRads: number;
}): Promise<void>;
}
//# sourceMappingURL=JoggerConnection.d.ts.map