UNPKG

spot-sdk-ts

Version:

TypeScript bindings based on protobufs (proto3) provided by Boston Dynamics

67 lines 4.38 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ChoreographyServiceClientImpl = exports.protobufPackage = void 0; /* eslint-disable */ const choreography_sequence_1 = require("./choreography_sequence"); const operators_1 = require("rxjs/operators"); const minimal_1 = __importDefault(require("protobufjs/minimal")); exports.protobufPackage = "bosdyn.api.spot"; class ChoreographyServiceClientImpl { rpc; constructor(rpc) { this.rpc = rpc; this.ListAllMoves = this.ListAllMoves.bind(this); this.ListAllSequences = this.ListAllSequences.bind(this); this.UploadChoreography = this.UploadChoreography.bind(this); this.UploadAnimatedMove = this.UploadAnimatedMove.bind(this); this.ExecuteChoreography = this.ExecuteChoreography.bind(this); this.StartRecordingState = this.StartRecordingState.bind(this); this.StopRecordingState = this.StopRecordingState.bind(this); this.DownloadRobotStateLog = this.DownloadRobotStateLog.bind(this); } ListAllMoves(request) { const data = choreography_sequence_1.ListAllMovesRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot.ChoreographyService", "ListAllMoves", data); return promise.then((data) => choreography_sequence_1.ListAllMovesResponse.decode(new minimal_1.default.Reader(data))); } ListAllSequences(request) { const data = choreography_sequence_1.ListAllSequencesRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot.ChoreographyService", "ListAllSequences", data); return promise.then((data) => choreography_sequence_1.ListAllSequencesResponse.decode(new minimal_1.default.Reader(data))); } UploadChoreography(request) { const data = choreography_sequence_1.UploadChoreographyRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot.ChoreographyService", "UploadChoreography", data); return promise.then((data) => choreography_sequence_1.UploadChoreographyResponse.decode(new minimal_1.default.Reader(data))); } UploadAnimatedMove(request) { const data = choreography_sequence_1.UploadAnimatedMoveRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot.ChoreographyService", "UploadAnimatedMove", data); return promise.then((data) => choreography_sequence_1.UploadAnimatedMoveResponse.decode(new minimal_1.default.Reader(data))); } ExecuteChoreography(request) { const data = choreography_sequence_1.ExecuteChoreographyRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot.ChoreographyService", "ExecuteChoreography", data); return promise.then((data) => choreography_sequence_1.ExecuteChoreographyResponse.decode(new minimal_1.default.Reader(data))); } StartRecordingState(request) { const data = choreography_sequence_1.StartRecordingStateRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot.ChoreographyService", "StartRecordingState", data); return promise.then((data) => choreography_sequence_1.StartRecordingStateResponse.decode(new minimal_1.default.Reader(data))); } StopRecordingState(request) { const data = choreography_sequence_1.StopRecordingStateRequest.encode(request).finish(); const promise = this.rpc.request("bosdyn.api.spot.ChoreographyService", "StopRecordingState", data); return promise.then((data) => choreography_sequence_1.StopRecordingStateResponse.decode(new minimal_1.default.Reader(data))); } DownloadRobotStateLog(request) { const data = choreography_sequence_1.DownloadRobotStateLogRequest.encode(request).finish(); const result = this.rpc.serverStreamingRequest("bosdyn.api.spot.ChoreographyService", "DownloadRobotStateLog", data); return result.pipe((0, operators_1.map)((data) => choreography_sequence_1.DownloadRobotStateLogResponse.decode(new minimal_1.default.Reader(data)))); } } exports.ChoreographyServiceClientImpl = ChoreographyServiceClientImpl; //# sourceMappingURL=choreography_service.js.map