spot-sdk-ts
Version:
TypeScript bindings based on protobufs (proto3) provided by Boston Dynamics
36 lines • 1.95 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RobotCommandServiceClientImpl = exports.protobufPackage = void 0;
/* eslint-disable */
const robot_command_1 = require("./robot_command");
const minimal_1 = __importDefault(require("protobufjs/minimal"));
exports.protobufPackage = "bosdyn.api";
class RobotCommandServiceClientImpl {
rpc;
constructor(rpc) {
this.rpc = rpc;
this.RobotCommand = this.RobotCommand.bind(this);
this.RobotCommandFeedback = this.RobotCommandFeedback.bind(this);
this.ClearBehaviorFault = this.ClearBehaviorFault.bind(this);
}
RobotCommand(request) {
const data = robot_command_1.RobotCommandRequest.encode(request).finish();
const promise = this.rpc.request("bosdyn.api.RobotCommandService", "RobotCommand", data);
return promise.then((data) => robot_command_1.RobotCommandResponse.decode(new minimal_1.default.Reader(data)));
}
RobotCommandFeedback(request) {
const data = robot_command_1.RobotCommandFeedbackRequest.encode(request).finish();
const promise = this.rpc.request("bosdyn.api.RobotCommandService", "RobotCommandFeedback", data);
return promise.then((data) => robot_command_1.RobotCommandFeedbackResponse.decode(new minimal_1.default.Reader(data)));
}
ClearBehaviorFault(request) {
const data = robot_command_1.ClearBehaviorFaultRequest.encode(request).finish();
const promise = this.rpc.request("bosdyn.api.RobotCommandService", "ClearBehaviorFault", data);
return promise.then((data) => robot_command_1.ClearBehaviorFaultResponse.decode(new minimal_1.default.Reader(data)));
}
}
exports.RobotCommandServiceClientImpl = RobotCommandServiceClientImpl;
//# sourceMappingURL=robot_command_service.js.map