spot-sdk-ts
Version:
TypeScript bindings based on protobufs (proto3) provided by Boston Dynamics
1,462 lines (1,372 loc) • 189 kB
text/typescript
/* eslint-disable */
import { Timestamp } from "../../../google/protobuf/timestamp";
import Long from "long";
import { RequestHeader, ResponseHeader } from "../header";
import { Lease, LeaseUseResult } from "../lease";
import { Duration } from "../../../google/protobuf/duration";
import { SE3Pose, Vec3Value, Quaternion } from "../geometry";
import { DataChunk } from "../data_chunk";
import {
JumpParams,
RotateBodyParams,
StepParams,
ButtCircleParams,
TurnParams,
Pace2StepParams,
TwerkParams,
ChickenHeadParams,
ClapParams,
FrontUpParams,
SwayParams,
BodyHoldParams,
ArmMoveParams,
KneelLegMoveParams,
RunningManParams,
KneelCircleParams,
GripperParams,
HopParams,
RandomRotateParams,
CrawlParams,
SideParams,
BourreeParams,
WorkspaceArmMoveParams,
Figure8Params,
KneelLegMove2Params,
FidgetStandParams,
GotoParams,
FrameSnapshotParams,
SetColorParams,
RippleColorParams,
FadeColorParams,
IndependentColorParams,
AnimateParams,
EulerZYXValue,
} from "./choreography_params";
import _m0 from "protobufjs/minimal";
import {
StringValue,
DoubleValue,
BoolValue,
} from "../../../google/protobuf/wrappers";
export const protobufPackage = "bosdyn.api.spot";
/** Request a list of all possible moves and the associated parameters (min/max values). */
export interface ListAllMovesRequest {
/** Common request header */
header: RequestHeader | undefined;
}
/** Response for ListAllMoves that defines the list of available moves and their parameter types. */
export interface ListAllMovesResponse {
/** Common response header */
header: ResponseHeader | undefined;
/** List of moves that the robot knows about. */
moves: MoveInfo[];
/** A copy of the MoveParamsConfig.txt that the robot is using. */
moveParamConfig: string;
}
/** Request a list of all playable choreography sequences that the robot knows about */
export interface ListAllSequencesRequest {
/** Common request header */
header: RequestHeader | undefined;
}
/** */
export interface ListAllSequencesResponse {
/** Common response header. */
header: ResponseHeader | undefined;
/** List of choreography sequences the robot knows about. */
knownSequences: string[];
}
export interface UploadChoreographyRequest {
/** Common request header. */
header: RequestHeader | undefined;
/** ChoreographySequence to upload and store in memory */
choreographySequence: ChoreographySequence | undefined;
/**
* Should we run a sequences that has correctable errors?
* If true, the service will fix any correctable errors and run the corrected choreography
* sequence. If false, the service will reject a choreography sequence that has any errors.
*/
nonStrictParsing: boolean;
}
export interface UploadChoreographyResponse {
/**
* Common response header. If the dance upload is invalid, the header INVALID request error will
* be set, which means that the choreography did not respect bounds of the parameters or has
* other attributes missing or incorrect.
*/
header: ResponseHeader | undefined;
/**
* If the uploaded choreography is invalid (will throw a header InvalidRequest status), then
* certain warning messages will be populated here to indicate which choreography moves or
* parameters violated constraints of the robot.
*/
warnings: string[];
}
export interface UploadAnimatedMoveRequest {
/** Common request header */
header: RequestHeader | undefined;
/**
* Unique ID for the animated moves. This will be automatically generated by the client
* and is used to uniquely identify the entire animation by creating a hash from the Animation
* protobuf message after serialization. The ID will be conveyed within the MoveInfo protobuf
* message in the ListAllMoves RPC. This ID allows the choreography client to only reupload
* animations that have changed or do not exist on robot already.
*/
animatedMoveGeneratedId: string | undefined;
/** AnimatedMove to upload to the robot and create a dance move from. */
animatedMove: Animation | undefined;
}
export interface UploadAnimatedMoveResponse {
/** Common response header. */
header: ResponseHeader | undefined;
status: UploadAnimatedMoveResponse_Status;
/**
* If the uploaded animated move is invalid (will throw a STATUS_ANIMATION_VALIDATION_FAILED), then
* warning messages describing the failure cases will be populated here to indicate which
* parts of the animated move failed. Note: there could be some warning messages even when an animation
* is marked as ok.
*/
warnings: string[];
}
export enum UploadAnimatedMoveResponse_Status {
/** STATUS_UNKNOWN - Do not use. */
STATUS_UNKNOWN = 0,
/** STATUS_OK - Uploading + parsing the animated move succeeded. */
STATUS_OK = 1,
/** STATUS_ANIMATION_VALIDATION_FAILED - The animated move is considered invalid, see the warnings. */
STATUS_ANIMATION_VALIDATION_FAILED = 2,
UNRECOGNIZED = -1,
}
export function uploadAnimatedMoveResponse_StatusFromJSON(
object: any
): UploadAnimatedMoveResponse_Status {
switch (object) {
case 0:
case "STATUS_UNKNOWN":
return UploadAnimatedMoveResponse_Status.STATUS_UNKNOWN;
case 1:
case "STATUS_OK":
return UploadAnimatedMoveResponse_Status.STATUS_OK;
case 2:
case "STATUS_ANIMATION_VALIDATION_FAILED":
return UploadAnimatedMoveResponse_Status.STATUS_ANIMATION_VALIDATION_FAILED;
case -1:
case "UNRECOGNIZED":
default:
return UploadAnimatedMoveResponse_Status.UNRECOGNIZED;
}
}
export function uploadAnimatedMoveResponse_StatusToJSON(
object: UploadAnimatedMoveResponse_Status
): string {
switch (object) {
case UploadAnimatedMoveResponse_Status.STATUS_UNKNOWN:
return "STATUS_UNKNOWN";
case UploadAnimatedMoveResponse_Status.STATUS_OK:
return "STATUS_OK";
case UploadAnimatedMoveResponse_Status.STATUS_ANIMATION_VALIDATION_FAILED:
return "STATUS_ANIMATION_VALIDATION_FAILED";
case UploadAnimatedMoveResponse_Status.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export interface ExecuteChoreographyRequest {
/** Common request header */
header: RequestHeader | undefined;
/** The string name of the ChoreographySequence to use. */
choreographySequenceName: string;
/**
* The absolute time to start the choreography at. This should be in the robot's clock so we can
* synchronize music playing and the robot's choreography.
*/
startTime: Date | undefined;
/** The slice (betas/sub-beats) that the choreography should begin excution at. */
choreographyStartingSlice: number;
/** / The Lease to show ownership of the robot body. */
lease: Lease | undefined;
}
export interface ExecuteChoreographyResponse {
/** Common response header */
header: ResponseHeader | undefined;
leaseUseResult: LeaseUseResult | undefined;
status: ExecuteChoreographyResponse_Status;
}
export enum ExecuteChoreographyResponse_Status {
STATUS_UNKNOWN = 0,
STATUS_OK = 1,
STATUS_INVALID_UPLOADED_CHOREOGRAPHY = 2,
STATUS_ROBOT_COMMAND_ISSUES = 3,
STATUS_LEASE_ERROR = 4,
UNRECOGNIZED = -1,
}
export function executeChoreographyResponse_StatusFromJSON(
object: any
): ExecuteChoreographyResponse_Status {
switch (object) {
case 0:
case "STATUS_UNKNOWN":
return ExecuteChoreographyResponse_Status.STATUS_UNKNOWN;
case 1:
case "STATUS_OK":
return ExecuteChoreographyResponse_Status.STATUS_OK;
case 2:
case "STATUS_INVALID_UPLOADED_CHOREOGRAPHY":
return ExecuteChoreographyResponse_Status.STATUS_INVALID_UPLOADED_CHOREOGRAPHY;
case 3:
case "STATUS_ROBOT_COMMAND_ISSUES":
return ExecuteChoreographyResponse_Status.STATUS_ROBOT_COMMAND_ISSUES;
case 4:
case "STATUS_LEASE_ERROR":
return ExecuteChoreographyResponse_Status.STATUS_LEASE_ERROR;
case -1:
case "UNRECOGNIZED":
default:
return ExecuteChoreographyResponse_Status.UNRECOGNIZED;
}
}
export function executeChoreographyResponse_StatusToJSON(
object: ExecuteChoreographyResponse_Status
): string {
switch (object) {
case ExecuteChoreographyResponse_Status.STATUS_UNKNOWN:
return "STATUS_UNKNOWN";
case ExecuteChoreographyResponse_Status.STATUS_OK:
return "STATUS_OK";
case ExecuteChoreographyResponse_Status.STATUS_INVALID_UPLOADED_CHOREOGRAPHY:
return "STATUS_INVALID_UPLOADED_CHOREOGRAPHY";
case ExecuteChoreographyResponse_Status.STATUS_ROBOT_COMMAND_ISSUES:
return "STATUS_ROBOT_COMMAND_ISSUES";
case ExecuteChoreographyResponse_Status.STATUS_LEASE_ERROR:
return "STATUS_LEASE_ERROR";
case ExecuteChoreographyResponse_Status.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export interface StartRecordingStateRequest {
/** Common request header */
header: RequestHeader | undefined;
/**
* How long should the robot record for if no stop RPC is sent. A recording session can be
* extended by setting the recording_session_id below to a non-zero value matching the ID for the
* current recording session.
* For both start and continuation commands, the service will stop recording at
* end_time = (system time when the Start/Continue RPC is received) + (continue_recording_duration),
* unless another continuation request updates this end time.
* The robot has an internal maximum recording time of 5 minutes for the complete session log.
*/
continueRecordingDuration: Duration | undefined;
/**
* Provide the unique identifier of the recording session to extend the recording end time for.
* If the recording_session_id is 0, then it will create a new session and the robot will clear
* the recorded robot state buffer and restart recording.
* If this is a continuation of an existing recording session, than the robot will continue
* to record until the specified end time.
*/
recordingSessionId: number;
}
export interface StartRecordingStateResponse {
/** Common response header */
header: ResponseHeader | undefined;
status: StartRecordingStateResponse_Status;
/** Unique identifier for the current recording session */
recordingSessionId: number;
}
/** The status for the start recording request. */
export enum StartRecordingStateResponse_Status {
/** STATUS_UNKNOWN - Status unknown; do not use. */
STATUS_UNKNOWN = 0,
/**
* STATUS_OK - The request succeeded and choreography has either started, or continued with an extended
* duration based on if a session_id was provided.
*/
STATUS_OK = 1,
/**
* STATUS_UNKNOWN_RECORDING_SESSION_ID - The provided recording_session_id is unknown: it must either be 0 (start a new recording log)
* or it can match the current recording session id returned by the most recent start recording request.
*/
STATUS_UNKNOWN_RECORDING_SESSION_ID = 2,
/**
* STATUS_RECORDING_BUFFER_FULL - The Choreography Service's internal buffer is filled. It will record for a maximum of 5 minutes. It
* will stop recording, but save the recorded data until
*/
STATUS_RECORDING_BUFFER_FULL = 3,
UNRECOGNIZED = -1,
}
export function startRecordingStateResponse_StatusFromJSON(
object: any
): StartRecordingStateResponse_Status {
switch (object) {
case 0:
case "STATUS_UNKNOWN":
return StartRecordingStateResponse_Status.STATUS_UNKNOWN;
case 1:
case "STATUS_OK":
return StartRecordingStateResponse_Status.STATUS_OK;
case 2:
case "STATUS_UNKNOWN_RECORDING_SESSION_ID":
return StartRecordingStateResponse_Status.STATUS_UNKNOWN_RECORDING_SESSION_ID;
case 3:
case "STATUS_RECORDING_BUFFER_FULL":
return StartRecordingStateResponse_Status.STATUS_RECORDING_BUFFER_FULL;
case -1:
case "UNRECOGNIZED":
default:
return StartRecordingStateResponse_Status.UNRECOGNIZED;
}
}
export function startRecordingStateResponse_StatusToJSON(
object: StartRecordingStateResponse_Status
): string {
switch (object) {
case StartRecordingStateResponse_Status.STATUS_UNKNOWN:
return "STATUS_UNKNOWN";
case StartRecordingStateResponse_Status.STATUS_OK:
return "STATUS_OK";
case StartRecordingStateResponse_Status.STATUS_UNKNOWN_RECORDING_SESSION_ID:
return "STATUS_UNKNOWN_RECORDING_SESSION_ID";
case StartRecordingStateResponse_Status.STATUS_RECORDING_BUFFER_FULL:
return "STATUS_RECORDING_BUFFER_FULL";
case StartRecordingStateResponse_Status.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export interface StopRecordingStateRequest {
/** Common request header */
header: RequestHeader | undefined;
}
export interface StopRecordingStateResponse {
/** Common response header */
header: ResponseHeader | undefined;
}
export interface DownloadRobotStateLogRequest {
/** Common request header */
header: RequestHeader | undefined;
/** Which data should we download. */
logType: DownloadRobotStateLogRequest_LogType;
}
export enum DownloadRobotStateLogRequest_LogType {
/** LOG_TYPE_UNKNOWN - Unknown. Do not use. */
LOG_TYPE_UNKNOWN = 0,
/**
* LOG_TYPE_MANUAL - The robot state information recorded from the time of the manual start RPC (StartRecordingState)
* to either {the time of the manual stop RPC (StopRecordingState), the time of the download logs RPC,
* or the time of the internal service's buffer filling up}.
*/
LOG_TYPE_MANUAL = 1,
/**
* LOG_TYPE_LAST_CHOREOGRAPHY - The robot will automatically record robot state information for the entire duration of an executing
* choreography in addition to any manual logging. This log type will download this information for the
* last completed choreography.
*/
LOG_TYPE_LAST_CHOREOGRAPHY = 2,
UNRECOGNIZED = -1,
}
export function downloadRobotStateLogRequest_LogTypeFromJSON(
object: any
): DownloadRobotStateLogRequest_LogType {
switch (object) {
case 0:
case "LOG_TYPE_UNKNOWN":
return DownloadRobotStateLogRequest_LogType.LOG_TYPE_UNKNOWN;
case 1:
case "LOG_TYPE_MANUAL":
return DownloadRobotStateLogRequest_LogType.LOG_TYPE_MANUAL;
case 2:
case "LOG_TYPE_LAST_CHOREOGRAPHY":
return DownloadRobotStateLogRequest_LogType.LOG_TYPE_LAST_CHOREOGRAPHY;
case -1:
case "UNRECOGNIZED":
default:
return DownloadRobotStateLogRequest_LogType.UNRECOGNIZED;
}
}
export function downloadRobotStateLogRequest_LogTypeToJSON(
object: DownloadRobotStateLogRequest_LogType
): string {
switch (object) {
case DownloadRobotStateLogRequest_LogType.LOG_TYPE_UNKNOWN:
return "LOG_TYPE_UNKNOWN";
case DownloadRobotStateLogRequest_LogType.LOG_TYPE_MANUAL:
return "LOG_TYPE_MANUAL";
case DownloadRobotStateLogRequest_LogType.LOG_TYPE_LAST_CHOREOGRAPHY:
return "LOG_TYPE_LAST_CHOREOGRAPHY";
case DownloadRobotStateLogRequest_LogType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export interface LoggedJoints {
/** front left leg joint angles. */
fl: LegJointAngles | undefined;
/** front right leg joint angles. */
fr: LegJointAngles | undefined;
/** hind left leg joint angles. */
hl: LegJointAngles | undefined;
/** hind right leg joint angles. */
hr: LegJointAngles | undefined;
/** Full set of joint angles for the arm and gripper. */
arm: ArmJointAngles | undefined;
gripperAngle: number | undefined;
}
export interface LoggedFootContacts {
/** Boolean indicating whether or not the robot's foot is in contact with the ground. */
frContact: boolean;
flContact: boolean;
hrContact: boolean;
hlContact: boolean;
}
export interface LoggedStateKeyFrame {
/** Full set of joint angles for the robot. */
jointAngles: LoggedJoints | undefined;
/** Foot contacts for the robot. */
footContactState: LoggedFootContacts | undefined;
/**
* The current pose of the robot body in animation frame. The animation frame is defined
* based on the robot's footprint when the log first started recording.
*/
animationTformBody: SE3Pose | undefined;
/** The timestamp (in robot time) for the key frame. */
timestamp: Date | undefined;
}
export interface ChoreographyStateLog {
/**
* A set of key frames recorded at a high rate. The key frames can be for the duration of an executing
* choreography or for the duration of a manual recorded log (triggered by the StartRecordingState and
* StopRecordingState RPCs). The specific set of keyframes is specified by the LogType when requesting
* to download the data.
*/
keyFrames: LoggedStateKeyFrame[];
}
export interface DownloadRobotStateLogResponse {
/** Common response header */
header: ResponseHeader | undefined;
/** Return status for the request. */
status: DownloadRobotStateLogResponse_Status;
/**
* Chunk of data to download. Responses are sent in sequence until the
* data chunk is complete. After receiving all chunks, concatenate them
* into a single byte string. Then, deserialize the byte string into an
* ChoreographyStateLog object.
*/
chunk: DataChunk | undefined;
}
export enum DownloadRobotStateLogResponse_Status {
/** STATUS_UNKNOWN - Status unknown. Do not use. */
STATUS_UNKNOWN = 0,
/** STATUS_OK - The log data downloaded successfully and is complete. */
STATUS_OK = 1,
/** STATUS_NO_RECORDED_INFORMATION - Error where there is no robot state information logged in the choreography service. */
STATUS_NO_RECORDED_INFORMATION = 2,
/**
* STATUS_INCOMPLETE_DATA - Error where the complete duration of the recorded session caused the service's recording
* buffer to fill up. When full, the robot will stop recording but preserve whatever was
* recorded until that point. The robot has an internal maximum recording time of 5 minutes.
* The data streamed in this response will go from the start time until the time the buffer
* was filled.
*/
STATUS_INCOMPLETE_DATA = 3,
UNRECOGNIZED = -1,
}
export function downloadRobotStateLogResponse_StatusFromJSON(
object: any
): DownloadRobotStateLogResponse_Status {
switch (object) {
case 0:
case "STATUS_UNKNOWN":
return DownloadRobotStateLogResponse_Status.STATUS_UNKNOWN;
case 1:
case "STATUS_OK":
return DownloadRobotStateLogResponse_Status.STATUS_OK;
case 2:
case "STATUS_NO_RECORDED_INFORMATION":
return DownloadRobotStateLogResponse_Status.STATUS_NO_RECORDED_INFORMATION;
case 3:
case "STATUS_INCOMPLETE_DATA":
return DownloadRobotStateLogResponse_Status.STATUS_INCOMPLETE_DATA;
case -1:
case "UNRECOGNIZED":
default:
return DownloadRobotStateLogResponse_Status.UNRECOGNIZED;
}
}
export function downloadRobotStateLogResponse_StatusToJSON(
object: DownloadRobotStateLogResponse_Status
): string {
switch (object) {
case DownloadRobotStateLogResponse_Status.STATUS_UNKNOWN:
return "STATUS_UNKNOWN";
case DownloadRobotStateLogResponse_Status.STATUS_OK:
return "STATUS_OK";
case DownloadRobotStateLogResponse_Status.STATUS_NO_RECORDED_INFORMATION:
return "STATUS_NO_RECORDED_INFORMATION";
case DownloadRobotStateLogResponse_Status.STATUS_INCOMPLETE_DATA:
return "STATUS_INCOMPLETE_DATA";
case DownloadRobotStateLogResponse_Status.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
/** Defines varying parameters for a particular instance of a move. */
export interface MoveParams {
/** Unique ID of the move type that these params are associated with. */
type: string;
/** How many slices since the start of the song this move should be executed at. */
startSlice: number;
/**
* The number of slices (beats/sub-beats) that this move is supposed to last for. If the move
* was extendable, then this corresponds to the number of slices that the user requested.
*/
requestedSlices: number;
jumpParams: JumpParams | undefined;
rotateBodyParams: RotateBodyParams | undefined;
stepParams: StepParams | undefined;
buttCircleParams: ButtCircleParams | undefined;
turnParams: TurnParams | undefined;
pace2stepParams: Pace2StepParams | undefined;
twerkParams: TwerkParams | undefined;
chickenHeadParams: ChickenHeadParams | undefined;
clapParams: ClapParams | undefined;
frontUpParams: FrontUpParams | undefined;
swayParams: SwayParams | undefined;
bodyHoldParams: BodyHoldParams | undefined;
armMoveParams: ArmMoveParams | undefined;
kneelLegMoveParams: KneelLegMoveParams | undefined;
runningManParams: RunningManParams | undefined;
kneelCircleParams: KneelCircleParams | undefined;
gripperParams: GripperParams | undefined;
hopParams: HopParams | undefined;
randomRotateParams: RandomRotateParams | undefined;
crawlParams: CrawlParams | undefined;
sideParams: SideParams | undefined;
bourreeParams: BourreeParams | undefined;
workspaceArmMoveParams: WorkspaceArmMoveParams | undefined;
figure8Params: Figure8Params | undefined;
kneelLegMove2Params: KneelLegMove2Params | undefined;
fidgetStandParams: FidgetStandParams | undefined;
gotoParams: GotoParams | undefined;
frameSnapshotParams: FrameSnapshotParams | undefined;
setColorParams: SetColorParams | undefined;
rippleColorParams: RippleColorParams | undefined;
fadeColorParams: FadeColorParams | undefined;
independentColorParams: IndependentColorParams | undefined;
animateParams: AnimateParams | undefined;
}
/** Defines properties of a choreography move. */
export interface MoveInfo {
/** Unique ID of the move type. */
name: string;
/** The duration of this move in slices (usually 1/4 beats). */
moveLengthSlices: number;
/** The duration of this move in seconds. If specified, overrides move_length_slices. */
moveLengthTime: number;
/** If true, the duration may be adjusted from the default specified by move_length_slices or move_length_time. */
isExtendable: boolean;
/**
* Bounds on the duration may be adjusted in slices (usually 1/4 beats).
* These apply to extendable moves, but may also override move_length_time for some BPM.
*/
minMoveLengthSlices: number;
maxMoveLengthSlices: number;
/**
* Bounds on the duration in time.
* These apply to extendable moves, but may also override move_length_slices for some BPM.
*/
minTime: number;
maxTime: number;
/** The admissible states the robot can be in currently for this move to execute. */
entranceStates: MoveInfo_TransitionState[];
/** The state of the robot after the move is complete. */
exitState: MoveInfo_TransitionState;
/** Indicators as to which parts of the robot that the move controls. */
controlsArm: boolean;
controlsLegs: boolean;
controlsBody: boolean;
controlsGripper: boolean;
controlsLights: boolean;
controlsAnnotations: boolean;
/** Information for the GUI tool to visualize the sequence move info. */
display: ChoreographerDisplayInfo | undefined;
/**
* Unique ID for the animated moves. This is sent with the UploadAnimatedMove request and use
* to track which version of the animated move is currently saved on robot. The ID can be unset,
* meaning the RPC which uploaded the animation did not provide an identifying hash.
*/
animatedMoveGeneratedId: string | undefined;
}
/** The state that the robot is in at the start or end of a move. */
export enum MoveInfo_TransitionState {
/** TRANSITION_STATE_UNKNOWN - Unknown or unset state. */
TRANSITION_STATE_UNKNOWN = 0,
/** TRANSITION_STATE_STAND - The robot is in a normal (standing) state. */
TRANSITION_STATE_STAND = 1,
/** TRANSITION_STATE_KNEEL - The robot is kneeling down. */
TRANSITION_STATE_KNEEL = 2,
/** TRANSITION_STATE_SIT - The robot is sitting. */
TRANSITION_STATE_SIT = 3,
/** TRANSITION_STATE_SPRAWL - The robot requires a self-right. */
TRANSITION_STATE_SPRAWL = 4,
UNRECOGNIZED = -1,
}
export function moveInfo_TransitionStateFromJSON(
object: any
): MoveInfo_TransitionState {
switch (object) {
case 0:
case "TRANSITION_STATE_UNKNOWN":
return MoveInfo_TransitionState.TRANSITION_STATE_UNKNOWN;
case 1:
case "TRANSITION_STATE_STAND":
return MoveInfo_TransitionState.TRANSITION_STATE_STAND;
case 2:
case "TRANSITION_STATE_KNEEL":
return MoveInfo_TransitionState.TRANSITION_STATE_KNEEL;
case 3:
case "TRANSITION_STATE_SIT":
return MoveInfo_TransitionState.TRANSITION_STATE_SIT;
case 4:
case "TRANSITION_STATE_SPRAWL":
return MoveInfo_TransitionState.TRANSITION_STATE_SPRAWL;
case -1:
case "UNRECOGNIZED":
default:
return MoveInfo_TransitionState.UNRECOGNIZED;
}
}
export function moveInfo_TransitionStateToJSON(
object: MoveInfo_TransitionState
): string {
switch (object) {
case MoveInfo_TransitionState.TRANSITION_STATE_UNKNOWN:
return "TRANSITION_STATE_UNKNOWN";
case MoveInfo_TransitionState.TRANSITION_STATE_STAND:
return "TRANSITION_STATE_STAND";
case MoveInfo_TransitionState.TRANSITION_STATE_KNEEL:
return "TRANSITION_STATE_KNEEL";
case MoveInfo_TransitionState.TRANSITION_STATE_SIT:
return "TRANSITION_STATE_SIT";
case MoveInfo_TransitionState.TRANSITION_STATE_SPRAWL:
return "TRANSITION_STATE_SPRAWL";
case MoveInfo_TransitionState.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
/** Information for the Choreographer to display. */
export interface ChoreographerDisplayInfo {
color: ChoreographerDisplayInfo_Color | undefined;
/**
* For the GUI, these are marked events in steps. For example if the move puts a foot down, the
* mark might be exactly when the foot is placed on the ground, relative to the start of the
* move.
*/
markers: number[];
/** Textual description to be displayed in the GUI. */
description: string;
/** Image path (local to the UI) to display as an icon. May be an animated gif. */
image: string;
category: ChoreographerDisplayInfo_Category;
}
/**
* Move Category affects the grouping in the choreographer list view, as well as the color it's
* displayed with.
*/
export enum ChoreographerDisplayInfo_Category {
CATEGORY_UNKNOWN = 0,
CATEGORY_BODY = 1,
CATEGORY_STEP = 2,
CATEGORY_DYNAMIC = 3,
CATEGORY_TRANSITION = 4,
CATEGORY_KNEEL = 5,
CATEGORY_ARM = 6,
CATEGORY_ANIMATION = 7,
CATEGORY_MPC = 8,
CATEGORY_LIGHTS = 9,
CATEGORY_ANNOTATIONS = 10,
UNRECOGNIZED = -1,
}
export function choreographerDisplayInfo_CategoryFromJSON(
object: any
): ChoreographerDisplayInfo_Category {
switch (object) {
case 0:
case "CATEGORY_UNKNOWN":
return ChoreographerDisplayInfo_Category.CATEGORY_UNKNOWN;
case 1:
case "CATEGORY_BODY":
return ChoreographerDisplayInfo_Category.CATEGORY_BODY;
case 2:
case "CATEGORY_STEP":
return ChoreographerDisplayInfo_Category.CATEGORY_STEP;
case 3:
case "CATEGORY_DYNAMIC":
return ChoreographerDisplayInfo_Category.CATEGORY_DYNAMIC;
case 4:
case "CATEGORY_TRANSITION":
return ChoreographerDisplayInfo_Category.CATEGORY_TRANSITION;
case 5:
case "CATEGORY_KNEEL":
return ChoreographerDisplayInfo_Category.CATEGORY_KNEEL;
case 6:
case "CATEGORY_ARM":
return ChoreographerDisplayInfo_Category.CATEGORY_ARM;
case 7:
case "CATEGORY_ANIMATION":
return ChoreographerDisplayInfo_Category.CATEGORY_ANIMATION;
case 8:
case "CATEGORY_MPC":
return ChoreographerDisplayInfo_Category.CATEGORY_MPC;
case 9:
case "CATEGORY_LIGHTS":
return ChoreographerDisplayInfo_Category.CATEGORY_LIGHTS;
case 10:
case "CATEGORY_ANNOTATIONS":
return ChoreographerDisplayInfo_Category.CATEGORY_ANNOTATIONS;
case -1:
case "UNRECOGNIZED":
default:
return ChoreographerDisplayInfo_Category.UNRECOGNIZED;
}
}
export function choreographerDisplayInfo_CategoryToJSON(
object: ChoreographerDisplayInfo_Category
): string {
switch (object) {
case ChoreographerDisplayInfo_Category.CATEGORY_UNKNOWN:
return "CATEGORY_UNKNOWN";
case ChoreographerDisplayInfo_Category.CATEGORY_BODY:
return "CATEGORY_BODY";
case ChoreographerDisplayInfo_Category.CATEGORY_STEP:
return "CATEGORY_STEP";
case ChoreographerDisplayInfo_Category.CATEGORY_DYNAMIC:
return "CATEGORY_DYNAMIC";
case ChoreographerDisplayInfo_Category.CATEGORY_TRANSITION:
return "CATEGORY_TRANSITION";
case ChoreographerDisplayInfo_Category.CATEGORY_KNEEL:
return "CATEGORY_KNEEL";
case ChoreographerDisplayInfo_Category.CATEGORY_ARM:
return "CATEGORY_ARM";
case ChoreographerDisplayInfo_Category.CATEGORY_ANIMATION:
return "CATEGORY_ANIMATION";
case ChoreographerDisplayInfo_Category.CATEGORY_MPC:
return "CATEGORY_MPC";
case ChoreographerDisplayInfo_Category.CATEGORY_LIGHTS:
return "CATEGORY_LIGHTS";
case ChoreographerDisplayInfo_Category.CATEGORY_ANNOTATIONS:
return "CATEGORY_ANNOTATIONS";
case ChoreographerDisplayInfo_Category.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
/** Color of the object. Set it to override the default category color. */
export interface ChoreographerDisplayInfo_Color {
/** RGB values for color ranging from [0,255]. */
r: number;
g: number;
b: number;
/** Alpha value for the coloration ranges from [0,1]. */
a: number;
}
/** Represents a particular choreography sequence, made up of MoveParams. */
export interface ChoreographySequence {
/** Display name or file name associated with the choreography sequence. */
name: string;
/**
* Number of slices per minute in the choreography sequence. Typically a slice will correspond
* to 1/4 a beat.
*/
slicesPerMinute: number;
/** All of the moves in this choreography sequence. */
moves: MoveParams[];
}
/**
* Describes the metadata and information only used by the Choreographer GUI, which isn't used in
* the API
*/
export interface ChoreographerSave {
/** The main ChoreographySequence that makes up the dance and is sent to the robot. */
choreographySequence: ChoreographySequence | undefined;
/** If specified this is the UI local path of the music to load. */
musicFile: string;
/**
* UI specific member that describes exactly when the music should start, in slices. This is for
* time sync issues.
*/
musicStartSlice: number;
/** The start slice for the choreographer save. */
choreographyStartSlice: number;
}
/** Represents an animated dance move that can be used whithin choreographies after uploading. */
export interface Animation {
/** The name of the animated move, which is how it will be referenced in choreographies. */
name: string;
/**
* The animated move is composed of animation keyframes, which specify the duration of
* each frame. The keyframe describes the position of the body/arms/gripper.
*/
animationKeyframes: AnimationKeyframe[];
/** Indicators as to which parts of the robot that the move controls. */
controlsArm: boolean;
controlsLegs: boolean;
controlsBody: boolean;
controlsGripper: boolean;
/** Track animated swing trajectories. Otherwise, takes standard swings between animated liftoff and touchdown locations. */
trackSwingTrajectories: boolean;
/**
* For moves that control the legs, but not the body.
* If legs are specified by joint angles, we still need body roll and pitch to know the foot height.
* If `assume_zero_roll_and_pitch` is true, they needn't be explicitly specified.
*/
assumeZeroRollAndPitch: boolean;
armPlayback: Animation_ArmPlayback;
/** Optional bpm that the animation is successful at. */
bpm: number;
/**
* When true, rescales the time of each keyframe slightly such that the move takes an
* integer number of slices. If false/absent, the move will be padded or truncated slightly
* to fit an integer number of slices.
*/
retimeToIntegerSlices: boolean;
/**
* The different parameters (minimum, default, and maximum) that can change the move.
* The min/max bounds are used by Choreographer to constrain the parameter widget, and will
* also be used when uploading a ChoreographySequence containing the animation to validate
* that the animated move is allowed.
*/
minimumParameters: AnimateParams | undefined;
defaultParameters: AnimateParams | undefined;
maximumParameters: AnimateParams | undefined;
/**
* Indicates if the animated moves can be shortened (the animated move will be cut off). Not
* supported for leg moves.
*/
truncatable: boolean;
/**
* Indicates if the animated moves can be stretched (animated move will loop). Not supported for
* leg moves.
*/
extendable: boolean;
/** Indicates if the move should start in a neutral stand position. */
neutralStart: boolean;
/**
* Step exactly at the animated locations, even at the expense of balance.
* By default, the optimizer may adjust step locations slightly.
*/
preciseSteps: boolean;
/**
* Time everything exactly as animated, even at the expense of balance.
* By default, the optimizer may adjust timing slightly.
*/
preciseTiming: boolean;
/** If set true, this animation will not run unless the robot has an arm. */
armRequired: boolean;
/** If set true, this animation will not run unless the robot has no arm. */
armProhibited: boolean;
/** If the animation completes before the move's duration, freeze rather than looping. */
noLooping: boolean;
}
/** Mode for hand trajectory playback */
export enum Animation_ArmPlayback {
/**
* ARM_PLAYBACK_DEFAULT - Playback as specified. Arm animations specified with joint angles playback in jointspace
* and arm animations specified as hand poses playback in workspace.
*/
ARM_PLAYBACK_DEFAULT = 0,
/** ARM_PLAYBACK_JOINTSPACE - Playback in jointspace. Arm animation will be most consistent relative to the body */
ARM_PLAYBACK_JOINTSPACE = 1,
/**
* ARM_PLAYBACK_WORKSPACE - Playback in workspace. Hand pose animation will be most consistent relative to the
* current footprint. Reference frame is animation frame.
*/
ARM_PLAYBACK_WORKSPACE = 2,
/**
* ARM_PLAYBACK_WORKSPACE_DANCE_FRAME - Playback in workspace with poses relative to the dance frame. hand pose animation will be
* most consistent relative to a fixed point in the world.
*/
ARM_PLAYBACK_WORKSPACE_DANCE_FRAME = 3,
UNRECOGNIZED = -1,
}
export function animation_ArmPlaybackFromJSON(
object: any
): Animation_ArmPlayback {
switch (object) {
case 0:
case "ARM_PLAYBACK_DEFAULT":
return Animation_ArmPlayback.ARM_PLAYBACK_DEFAULT;
case 1:
case "ARM_PLAYBACK_JOINTSPACE":
return Animation_ArmPlayback.ARM_PLAYBACK_JOINTSPACE;
case 2:
case "ARM_PLAYBACK_WORKSPACE":
return Animation_ArmPlayback.ARM_PLAYBACK_WORKSPACE;
case 3:
case "ARM_PLAYBACK_WORKSPACE_DANCE_FRAME":
return Animation_ArmPlayback.ARM_PLAYBACK_WORKSPACE_DANCE_FRAME;
case -1:
case "UNRECOGNIZED":
default:
return Animation_ArmPlayback.UNRECOGNIZED;
}
}
export function animation_ArmPlaybackToJSON(
object: Animation_ArmPlayback
): string {
switch (object) {
case Animation_ArmPlayback.ARM_PLAYBACK_DEFAULT:
return "ARM_PLAYBACK_DEFAULT";
case Animation_ArmPlayback.ARM_PLAYBACK_JOINTSPACE:
return "ARM_PLAYBACK_JOINTSPACE";
case Animation_ArmPlayback.ARM_PLAYBACK_WORKSPACE:
return "ARM_PLAYBACK_WORKSPACE";
case Animation_ArmPlayback.ARM_PLAYBACK_WORKSPACE_DANCE_FRAME:
return "ARM_PLAYBACK_WORKSPACE_DANCE_FRAME";
case Animation_ArmPlayback.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export interface AnimationKeyframe {
/** Time from the start of the animation for this frame. */
time: number;
/**
* Different body parts the animated move can control.
* It can control multiple body parts at once.
*/
gripper: AnimateGripper | undefined;
arm: AnimateArm | undefined;
body: AnimateBody | undefined;
legs: AnimateLegs | undefined;
}
export interface AnimateGripper {
gripperAngle: number | undefined;
}
export interface AnimateArm {
/** Full arm joint angle specification. */
jointAngles: ArmJointAngles | undefined;
/** The hand position in the animation frame */
handPose: AnimateArm_HandPose | undefined;
}
/**
* An SE3 Pose for the hand where orientation is specified using either a quaternion or
* euler angles
*/
export interface AnimateArm_HandPose {
position: Vec3Value | undefined;
/** The hand's orientation described with euler angles (yaw, pitch, roll). */
eulerAngles: EulerZYXValue | undefined;
/** The hand's orientation described with a quaternion. */
quaternion: Quaternion | undefined;
}
/**
* The AnimateArm keyframe describes the joint angles of the arm joints in radians.
* Any joint not specified, will hold the previous angle it was at when the keyframe
* begins. At least one arm joint must be specified.
*/
export interface ArmJointAngles {
shoulder0: number | undefined;
shoulder1: number | undefined;
elbow0: number | undefined;
elbow1: number | undefined;
wrist0: number | undefined;
wrist1: number | undefined;
}
/**
* The AnimateBody keyframe describes the body's position and orientation. At least
* one dimension of the body must be specified.
*/
export interface AnimateBody {
/** The body position in the animation frame. */
bodyPos: Vec3Value | undefined;
/** The body's center of mass position in the animation frame. */
comPos: Vec3Value | undefined;
/** The body's orientation described with euler angles (yaw, pitch, roll). */
eulerAngles: EulerZYXValue | undefined;
/** The body's orientation described with a quaternion. */
quaternion: Quaternion | undefined;
}
/** The AnimateLegs keyframe describes each leg using either joint angles or the foot position. */
export interface AnimateLegs {
/** Front left leg. */
fl: AnimateSingleLeg | undefined;
/** Front right leg. */
fr: AnimateSingleLeg | undefined;
/** Hind left leg. */
hl: AnimateSingleLeg | undefined;
/** Hind right leg. */
hr: AnimateSingleLeg | undefined;
}
/** A single leg keyframe to describe the leg motion. */
export interface AnimateSingleLeg {
/** Full leg joint angle specification. */
jointAngles: LegJointAngles | undefined;
/** The foot position of the leg in the animation frame. */
footPos: Vec3Value | undefined;
/**
* If true, the foot is in contact with the ground and standing. If false, the
* foot is in swing. If unset, the contact will be inferred from the leg joint angles
* or foot position.
*/
stance: boolean | undefined;
}
/** Descprition of each leg joint angle (hip x/y and knee) in radians. */
export interface LegJointAngles {
hipX: number;
hipY: number;
knee: number;
}
function createBaseListAllMovesRequest(): ListAllMovesRequest {
return { header: undefined };
}
export const ListAllMovesRequest = {
encode(
message: ListAllMovesRequest,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.header !== undefined) {
RequestHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): ListAllMovesRequest {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseListAllMovesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = RequestHeader.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): ListAllMovesRequest {
return {
header: isSet(object.header)
? RequestHeader.fromJSON(object.header)
: undefined,
};
},
toJSON(message: ListAllMovesRequest): unknown {
const obj: any = {};
message.header !== undefined &&
(obj.header = message.header
? RequestHeader.toJSON(message.header)
: undefined);
return obj;
},
fromPartial<I extends Exact<DeepPartial<ListAllMovesRequest>, I>>(
object: I
): ListAllMovesRequest {
const message = createBaseListAllMovesRequest();
message.header =
object.header !== undefined && object.header !== null
? RequestHeader.fromPartial(object.header)
: undefined;
return message;
},
};
function createBaseListAllMovesResponse(): ListAllMovesResponse {
return { header: undefined, moves: [], moveParamConfig: "" };
}
export const ListAllMovesResponse = {
encode(
message: ListAllMovesResponse,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.header !== undefined) {
ResponseHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
for (const v of message.moves) {
MoveInfo.encode(v!, writer.uint32(18).fork()).ldelim();
}
if (message.moveParamConfig !== "") {
writer.uint32(26).string(message.moveParamConfig);
}
return writer;
},
decode(
input: _m0.Reader | Uint8Array,
length?: number
): ListAllMovesResponse {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseListAllMovesResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = ResponseHeader.decode(reader, reader.uint32());
break;
case 2:
message.moves.push(MoveInfo.decode(reader, reader.uint32()));
break;
case 3:
message.moveParamConfig = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): ListAllMovesResponse {
return {
header: isSet(object.header)
? ResponseHeader.fromJSON(object.header)
: undefined,
moves: Array.isArray(object?.moves)
? object.moves.map((e: any) => MoveInfo.fromJSON(e))
: [],
moveParamConfig: isSet(object.moveParamConfig)
? String(object.moveParamConfig)
: "",
};
},
toJSON(message: ListAllMovesResponse): unknown {
const obj: any = {};
message.header !== undefined &&
(obj.header = message.header
? ResponseHeader.toJSON(message.header)
: undefined);
if (message.moves) {
obj.moves = message.moves.map((e) =>
e ? MoveInfo.toJSON(e) : undefined
);
} else {
obj.moves = [];
}
message.moveParamConfig !== undefined &&
(obj.moveParamConfig = message.moveParamConfig);
return obj;
},
fromPartial<I extends Exact<DeepPartial<ListAllMovesResponse>, I>>(
object: I
): ListAllMovesResponse {
const message = createBaseListAllMovesResponse();
message.header =
object.header !== undefined && object.header !== null
? ResponseHeader.fromPartial(object.header)
: undefined;
message.moves = object.moves?.map((e) => MoveInfo.fromPartial(e)) || [];
message.moveParamConfig = object.moveParamConfig ?? "";
return message;
},
};
function createBaseListAllSequencesRequest(): ListAllSequencesRequest {
return { header: undefined };
}
export const ListAllSequencesRequest = {
encode(
message: ListAllSequencesRequest,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.header !== undefined) {
RequestHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(
input: _m0.Reader | Uint8Array,
length?: number
): ListAllSequencesRequest {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseListAllSequencesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = RequestHeader.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): ListAllSequencesRequest {
return {
header: isSet(object.header)
? RequestHeader.fromJSON(object.header)
: undefined,
};
},
toJSON(message: ListAllSequencesRequest): unknown {
const obj: any = {};
message.header !== undefined &&
(obj.header = message.header
? RequestHeader.toJSON(message.header)
: undefined);
return obj;
},
fromPartial<I extends Exact<DeepPartial<ListAllSequencesRequest>, I>>(
object: I
): ListAllSequencesRequest {
const message = createBaseListAllSequencesRequest();
message.header =
object.header !== undefined && object.header !== null
? RequestHeader.fromPartial(object.header)
: undefined;
return message;
},
};
function createBaseListAllSequencesResponse(): ListAllSequencesResponse {
return { header: undefined, knownSequences: [] };
}
export const ListAllSequencesResponse = {
encode(
message: ListAllSequencesResponse,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.header !== undefined) {
ResponseHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
for (const v of message.knownSequences) {
writer.uint32(18).string(v!);
}
return writer;
},
decode(
input: _m0.Reader | Uint8Array,
length?: number
): ListAllSequencesResponse {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseListAllSequencesResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = ResponseHeader.decode(reader, reader.uint32());
break;
case 2:
message.knownSequences.push(reader.string());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): ListAllSequencesResponse {
return {
header: isSet(object.header)
? ResponseHeader.fromJSON(object.header)
: undefined,
knownSequences: Array.isArray(object?.knownSequences)
? object.knownSequences.map((e: any) => String(e))
: [],
};
},
toJSON(message: ListAllSequencesResponse): unknown {
const obj: any = {};
message.header !== undefined &&
(obj.header = message.header
? ResponseHeader.toJSON(message.header)
: undefined);
if (message.knownSequences) {
obj.knownSequences = message.knownSequences.map((e) => e);
} else {
obj.knownSequences = [];
}
return obj;
},
fromPartial<I extends Exact<DeepPartial<ListAllSequencesResponse>, I>>(
object: I
): ListAllSequencesResponse {
const message = createBaseListAllSequencesResponse();
message.header =
object.header !== undefined && object.header !== null
? ResponseHeader.fromPartial(object.header)
: undefined;
message.knownSequences = object.knownSequences?.map((e) => e) || [];
return message;
},
};
function createBaseUploadChoreographyRequest(): UploadChoreographyRequest {
return {
header: undefined,
choreographySequence: undefined,
nonStrictParsing: false,
};
}
export const UploadChoreographyRequest = {
encode(
message: UploadChoreographyRequest,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.header !== undefined) {
RequestHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.choreographySequence !== undefined) {
ChoreographySequence.encode(
message.choreographySequence,
writer.uint32(18).fork()
).ldelim();
}
if (message.nonStrictParsing === true) {
writer.uint32(24).bool(message.nonStrictParsing);
}
return writer;
},
decode(
input: _m0.Reader | Uint8Array,
length?: number
): UploadChoreographyRequest {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUploadChoreographyRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = RequestHeader.decode(reader, reader.uint32());
break;
case 2:
message.choreographySequence = ChoreographySequence.decode(
reader,
reader.uint32()
);
break;
case 3:
message.nonStrictParsing = reader.bool();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object: any): UploadChoreographyRequest {
return {
header: isSet(object.header)
? RequestHeader.fromJSON(object.header)
: undefined,
choreographySequence: isSet(object.choreographySequence)
? ChoreographySequence.fromJSON(object.choreographySequence)
: undefined,
nonStrictParsing: isSet(object.nonStrictParsing)
? Boolean(object.nonStrictParsing)
: false,
};
},
toJSON(message: UploadChoreographyRequest): unknown {
const obj: any = {};
message.header !== undefined &&
(obj.header = message.header
? RequestHeader.toJSON(message.header)
: undefined);
message.choreographySequence !== undefined &&
(obj.choreographySequence = message.choreographySequence
?