spot-sdk-ts
Version:
TypeScript bindings based on protobufs (proto3) provided by Boston Dynamics
930 lines • 42.4 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.ClearBehaviorFaultResponse = exports.ClearBehaviorFaultRequest = exports.RobotCommandFeedbackResponse = exports.RobotCommandFeedbackRequest = exports.RobotCommandResponse = exports.RobotCommandRequest = exports.RobotCommandFeedback = exports.RobotCommand = exports.clearBehaviorFaultResponse_StatusToJSON = exports.clearBehaviorFaultResponse_StatusFromJSON = exports.ClearBehaviorFaultResponse_Status = exports.robotCommandFeedbackResponse_StatusToJSON = exports.robotCommandFeedbackResponse_StatusFromJSON = exports.RobotCommandFeedbackResponse_Status = exports.robotCommandResponse_StatusToJSON = exports.robotCommandResponse_StatusFromJSON = exports.RobotCommandResponse_Status = exports.protobufPackage = void 0;
/* eslint-disable */
const full_body_command_1 = require("./full_body_command");
const synchronized_command_1 = require("./synchronized_command");
const mobility_command_1 = require("./mobility_command");
const header_1 = require("./header");
const lease_1 = require("./lease");
const minimal_1 = __importDefault(require("protobufjs/minimal"));
exports.protobufPackage = "bosdyn.api";
var RobotCommandResponse_Status;
(function (RobotCommandResponse_Status) {
/** STATUS_UNKNOWN - An unknown / unexpected error occurred. */
RobotCommandResponse_Status[RobotCommandResponse_Status["STATUS_UNKNOWN"] = 0] = "STATUS_UNKNOWN";
/** STATUS_OK - Request was accepted. */
RobotCommandResponse_Status[RobotCommandResponse_Status["STATUS_OK"] = 1] = "STATUS_OK";
/** STATUS_INVALID_REQUEST - [Programming Error] Request was invalid / malformed in some way. */
RobotCommandResponse_Status[RobotCommandResponse_Status["STATUS_INVALID_REQUEST"] = 2] = "STATUS_INVALID_REQUEST";
/** STATUS_UNSUPPORTED - [Programming Error] The robot does not understand this command. */
RobotCommandResponse_Status[RobotCommandResponse_Status["STATUS_UNSUPPORTED"] = 3] = "STATUS_UNSUPPORTED";
/** STATUS_NO_TIMESYNC - [Timesync Error] Client has not done timesync with robot. */
RobotCommandResponse_Status[RobotCommandResponse_Status["STATUS_NO_TIMESYNC"] = 4] = "STATUS_NO_TIMESYNC";
/** STATUS_EXPIRED - [Timesync Error] The command was received after its end_time had already passed. */
RobotCommandResponse_Status[RobotCommandResponse_Status["STATUS_EXPIRED"] = 5] = "STATUS_EXPIRED";
/** STATUS_TOO_DISTANT - [Timesync Error] The command end time was too far in the future. */
RobotCommandResponse_Status[RobotCommandResponse_Status["STATUS_TOO_DISTANT"] = 6] = "STATUS_TOO_DISTANT";
/** STATUS_NOT_POWERED_ON - [Hardware Error] The robot must be powered on to accept a command. */
RobotCommandResponse_Status[RobotCommandResponse_Status["STATUS_NOT_POWERED_ON"] = 7] = "STATUS_NOT_POWERED_ON";
/** STATUS_BEHAVIOR_FAULT - [Robot State Error] The robot must not have behavior faults. */
RobotCommandResponse_Status[RobotCommandResponse_Status["STATUS_BEHAVIOR_FAULT"] = 9] = "STATUS_BEHAVIOR_FAULT";
/** STATUS_DOCKED - [Robot State Error] The robot cannot be docked for certain commands. */
RobotCommandResponse_Status[RobotCommandResponse_Status["STATUS_DOCKED"] = 10] = "STATUS_DOCKED";
/** STATUS_UNKNOWN_FRAME - [Frame Error] The frame_name for a command was not a known frame. */
RobotCommandResponse_Status[RobotCommandResponse_Status["STATUS_UNKNOWN_FRAME"] = 8] = "STATUS_UNKNOWN_FRAME";
RobotCommandResponse_Status[RobotCommandResponse_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(RobotCommandResponse_Status = exports.RobotCommandResponse_Status || (exports.RobotCommandResponse_Status = {}));
function robotCommandResponse_StatusFromJSON(object) {
switch (object) {
case 0:
case "STATUS_UNKNOWN":
return RobotCommandResponse_Status.STATUS_UNKNOWN;
case 1:
case "STATUS_OK":
return RobotCommandResponse_Status.STATUS_OK;
case 2:
case "STATUS_INVALID_REQUEST":
return RobotCommandResponse_Status.STATUS_INVALID_REQUEST;
case 3:
case "STATUS_UNSUPPORTED":
return RobotCommandResponse_Status.STATUS_UNSUPPORTED;
case 4:
case "STATUS_NO_TIMESYNC":
return RobotCommandResponse_Status.STATUS_NO_TIMESYNC;
case 5:
case "STATUS_EXPIRED":
return RobotCommandResponse_Status.STATUS_EXPIRED;
case 6:
case "STATUS_TOO_DISTANT":
return RobotCommandResponse_Status.STATUS_TOO_DISTANT;
case 7:
case "STATUS_NOT_POWERED_ON":
return RobotCommandResponse_Status.STATUS_NOT_POWERED_ON;
case 9:
case "STATUS_BEHAVIOR_FAULT":
return RobotCommandResponse_Status.STATUS_BEHAVIOR_FAULT;
case 10:
case "STATUS_DOCKED":
return RobotCommandResponse_Status.STATUS_DOCKED;
case 8:
case "STATUS_UNKNOWN_FRAME":
return RobotCommandResponse_Status.STATUS_UNKNOWN_FRAME;
case -1:
case "UNRECOGNIZED":
default:
return RobotCommandResponse_Status.UNRECOGNIZED;
}
}
exports.robotCommandResponse_StatusFromJSON = robotCommandResponse_StatusFromJSON;
function robotCommandResponse_StatusToJSON(object) {
switch (object) {
case RobotCommandResponse_Status.STATUS_UNKNOWN:
return "STATUS_UNKNOWN";
case RobotCommandResponse_Status.STATUS_OK:
return "STATUS_OK";
case RobotCommandResponse_Status.STATUS_INVALID_REQUEST:
return "STATUS_INVALID_REQUEST";
case RobotCommandResponse_Status.STATUS_UNSUPPORTED:
return "STATUS_UNSUPPORTED";
case RobotCommandResponse_Status.STATUS_NO_TIMESYNC:
return "STATUS_NO_TIMESYNC";
case RobotCommandResponse_Status.STATUS_EXPIRED:
return "STATUS_EXPIRED";
case RobotCommandResponse_Status.STATUS_TOO_DISTANT:
return "STATUS_TOO_DISTANT";
case RobotCommandResponse_Status.STATUS_NOT_POWERED_ON:
return "STATUS_NOT_POWERED_ON";
case RobotCommandResponse_Status.STATUS_BEHAVIOR_FAULT:
return "STATUS_BEHAVIOR_FAULT";
case RobotCommandResponse_Status.STATUS_DOCKED:
return "STATUS_DOCKED";
case RobotCommandResponse_Status.STATUS_UNKNOWN_FRAME:
return "STATUS_UNKNOWN_FRAME";
case RobotCommandResponse_Status.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.robotCommandResponse_StatusToJSON = robotCommandResponse_StatusToJSON;
var RobotCommandFeedbackResponse_Status;
(function (RobotCommandFeedbackResponse_Status) {
/** STATUS_UNKNOWN - Status enum is DEPRECATED as of 2.1.0. Behavior execution is in an unknown / unexpected state. */
RobotCommandFeedbackResponse_Status[RobotCommandFeedbackResponse_Status["STATUS_UNKNOWN"] = 0] = "STATUS_UNKNOWN";
/** STATUS_PROCESSING - Status enum is DEPRECATED as of 2.1.0. The robot is actively working on the command */
RobotCommandFeedbackResponse_Status[RobotCommandFeedbackResponse_Status["STATUS_PROCESSING"] = 1] = "STATUS_PROCESSING";
/** STATUS_COMMAND_OVERRIDDEN - Status enum is DEPRECATED as of 2.1.0. The command was replaced by a new command */
RobotCommandFeedbackResponse_Status[RobotCommandFeedbackResponse_Status["STATUS_COMMAND_OVERRIDDEN"] = 2] = "STATUS_COMMAND_OVERRIDDEN";
/** STATUS_COMMAND_TIMED_OUT - Status enum is DEPRECATED as of 2.1.0. The command expired */
RobotCommandFeedbackResponse_Status[RobotCommandFeedbackResponse_Status["STATUS_COMMAND_TIMED_OUT"] = 3] = "STATUS_COMMAND_TIMED_OUT";
/** STATUS_ROBOT_FROZEN - Status enum is DEPRECATED as of 2.1.0. The robot is in an unsafe state, and will only respond to known safe commands. */
RobotCommandFeedbackResponse_Status[RobotCommandFeedbackResponse_Status["STATUS_ROBOT_FROZEN"] = 4] = "STATUS_ROBOT_FROZEN";
RobotCommandFeedbackResponse_Status[RobotCommandFeedbackResponse_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(RobotCommandFeedbackResponse_Status = exports.RobotCommandFeedbackResponse_Status || (exports.RobotCommandFeedbackResponse_Status = {}));
function robotCommandFeedbackResponse_StatusFromJSON(object) {
switch (object) {
case 0:
case "STATUS_UNKNOWN":
return RobotCommandFeedbackResponse_Status.STATUS_UNKNOWN;
case 1:
case "STATUS_PROCESSING":
return RobotCommandFeedbackResponse_Status.STATUS_PROCESSING;
case 2:
case "STATUS_COMMAND_OVERRIDDEN":
return RobotCommandFeedbackResponse_Status.STATUS_COMMAND_OVERRIDDEN;
case 3:
case "STATUS_COMMAND_TIMED_OUT":
return RobotCommandFeedbackResponse_Status.STATUS_COMMAND_TIMED_OUT;
case 4:
case "STATUS_ROBOT_FROZEN":
return RobotCommandFeedbackResponse_Status.STATUS_ROBOT_FROZEN;
case -1:
case "UNRECOGNIZED":
default:
return RobotCommandFeedbackResponse_Status.UNRECOGNIZED;
}
}
exports.robotCommandFeedbackResponse_StatusFromJSON = robotCommandFeedbackResponse_StatusFromJSON;
function robotCommandFeedbackResponse_StatusToJSON(object) {
switch (object) {
case RobotCommandFeedbackResponse_Status.STATUS_UNKNOWN:
return "STATUS_UNKNOWN";
case RobotCommandFeedbackResponse_Status.STATUS_PROCESSING:
return "STATUS_PROCESSING";
case RobotCommandFeedbackResponse_Status.STATUS_COMMAND_OVERRIDDEN:
return "STATUS_COMMAND_OVERRIDDEN";
case RobotCommandFeedbackResponse_Status.STATUS_COMMAND_TIMED_OUT:
return "STATUS_COMMAND_TIMED_OUT";
case RobotCommandFeedbackResponse_Status.STATUS_ROBOT_FROZEN:
return "STATUS_ROBOT_FROZEN";
case RobotCommandFeedbackResponse_Status.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.robotCommandFeedbackResponse_StatusToJSON = robotCommandFeedbackResponse_StatusToJSON;
var ClearBehaviorFaultResponse_Status;
(function (ClearBehaviorFaultResponse_Status) {
/** STATUS_UNKNOWN - An unknown / unexpected error occurred. */
ClearBehaviorFaultResponse_Status[ClearBehaviorFaultResponse_Status["STATUS_UNKNOWN"] = 0] = "STATUS_UNKNOWN";
/** STATUS_CLEARED - The BehaviorFault has been cleared. */
ClearBehaviorFaultResponse_Status[ClearBehaviorFaultResponse_Status["STATUS_CLEARED"] = 1] = "STATUS_CLEARED";
/** STATUS_NOT_CLEARED - The BehaviorFault could not be cleared. */
ClearBehaviorFaultResponse_Status[ClearBehaviorFaultResponse_Status["STATUS_NOT_CLEARED"] = 2] = "STATUS_NOT_CLEARED";
ClearBehaviorFaultResponse_Status[ClearBehaviorFaultResponse_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(ClearBehaviorFaultResponse_Status = exports.ClearBehaviorFaultResponse_Status || (exports.ClearBehaviorFaultResponse_Status = {}));
function clearBehaviorFaultResponse_StatusFromJSON(object) {
switch (object) {
case 0:
case "STATUS_UNKNOWN":
return ClearBehaviorFaultResponse_Status.STATUS_UNKNOWN;
case 1:
case "STATUS_CLEARED":
return ClearBehaviorFaultResponse_Status.STATUS_CLEARED;
case 2:
case "STATUS_NOT_CLEARED":
return ClearBehaviorFaultResponse_Status.STATUS_NOT_CLEARED;
case -1:
case "UNRECOGNIZED":
default:
return ClearBehaviorFaultResponse_Status.UNRECOGNIZED;
}
}
exports.clearBehaviorFaultResponse_StatusFromJSON = clearBehaviorFaultResponse_StatusFromJSON;
function clearBehaviorFaultResponse_StatusToJSON(object) {
switch (object) {
case ClearBehaviorFaultResponse_Status.STATUS_UNKNOWN:
return "STATUS_UNKNOWN";
case ClearBehaviorFaultResponse_Status.STATUS_CLEARED:
return "STATUS_CLEARED";
case ClearBehaviorFaultResponse_Status.STATUS_NOT_CLEARED:
return "STATUS_NOT_CLEARED";
case ClearBehaviorFaultResponse_Status.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.clearBehaviorFaultResponse_StatusToJSON = clearBehaviorFaultResponse_StatusToJSON;
function createBaseRobotCommand() {
return {
fullBodyCommand: undefined,
synchronizedCommand: undefined,
mobilityCommand: undefined,
};
}
exports.RobotCommand = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.fullBodyCommand !== undefined) {
full_body_command_1.FullBodyCommand_Request.encode(message.fullBodyCommand, writer.uint32(10).fork()).ldelim();
}
if (message.synchronizedCommand !== undefined) {
synchronized_command_1.SynchronizedCommand_Request.encode(message.synchronizedCommand, writer.uint32(26).fork()).ldelim();
}
if (message.mobilityCommand !== undefined) {
mobility_command_1.MobilityCommand_Request.encode(message.mobilityCommand, writer.uint32(18).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRobotCommand();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.fullBodyCommand = full_body_command_1.FullBodyCommand_Request.decode(reader, reader.uint32());
break;
case 3:
message.synchronizedCommand = synchronized_command_1.SynchronizedCommand_Request.decode(reader, reader.uint32());
break;
case 2:
message.mobilityCommand = mobility_command_1.MobilityCommand_Request.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
fullBodyCommand: isSet(object.fullBodyCommand)
? full_body_command_1.FullBodyCommand_Request.fromJSON(object.fullBodyCommand)
: undefined,
synchronizedCommand: isSet(object.synchronizedCommand)
? synchronized_command_1.SynchronizedCommand_Request.fromJSON(object.synchronizedCommand)
: undefined,
mobilityCommand: isSet(object.mobilityCommand)
? mobility_command_1.MobilityCommand_Request.fromJSON(object.mobilityCommand)
: undefined,
};
},
toJSON(message) {
const obj = {};
message.fullBodyCommand !== undefined &&
(obj.fullBodyCommand = message.fullBodyCommand
? full_body_command_1.FullBodyCommand_Request.toJSON(message.fullBodyCommand)
: undefined);
message.synchronizedCommand !== undefined &&
(obj.synchronizedCommand = message.synchronizedCommand
? synchronized_command_1.SynchronizedCommand_Request.toJSON(message.synchronizedCommand)
: undefined);
message.mobilityCommand !== undefined &&
(obj.mobilityCommand = message.mobilityCommand
? mobility_command_1.MobilityCommand_Request.toJSON(message.mobilityCommand)
: undefined);
return obj;
},
fromPartial(object) {
const message = createBaseRobotCommand();
message.fullBodyCommand =
object.fullBodyCommand !== undefined && object.fullBodyCommand !== null
? full_body_command_1.FullBodyCommand_Request.fromPartial(object.fullBodyCommand)
: undefined;
message.synchronizedCommand =
object.synchronizedCommand !== undefined &&
object.synchronizedCommand !== null
? synchronized_command_1.SynchronizedCommand_Request.fromPartial(object.synchronizedCommand)
: undefined;
message.mobilityCommand =
object.mobilityCommand !== undefined && object.mobilityCommand !== null
? mobility_command_1.MobilityCommand_Request.fromPartial(object.mobilityCommand)
: undefined;
return message;
},
};
function createBaseRobotCommandFeedback() {
return {
fullBodyFeedback: undefined,
synchronizedFeedback: undefined,
mobilityFeedback: undefined,
};
}
exports.RobotCommandFeedback = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.fullBodyFeedback !== undefined) {
full_body_command_1.FullBodyCommand_Feedback.encode(message.fullBodyFeedback, writer.uint32(18).fork()).ldelim();
}
if (message.synchronizedFeedback !== undefined) {
synchronized_command_1.SynchronizedCommand_Feedback.encode(message.synchronizedFeedback, writer.uint32(26).fork()).ldelim();
}
if (message.mobilityFeedback !== undefined) {
mobility_command_1.MobilityCommand_Feedback.encode(message.mobilityFeedback, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRobotCommandFeedback();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 2:
message.fullBodyFeedback = full_body_command_1.FullBodyCommand_Feedback.decode(reader, reader.uint32());
break;
case 3:
message.synchronizedFeedback = synchronized_command_1.SynchronizedCommand_Feedback.decode(reader, reader.uint32());
break;
case 1:
message.mobilityFeedback = mobility_command_1.MobilityCommand_Feedback.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
fullBodyFeedback: isSet(object.fullBodyFeedback)
? full_body_command_1.FullBodyCommand_Feedback.fromJSON(object.fullBodyFeedback)
: undefined,
synchronizedFeedback: isSet(object.synchronizedFeedback)
? synchronized_command_1.SynchronizedCommand_Feedback.fromJSON(object.synchronizedFeedback)
: undefined,
mobilityFeedback: isSet(object.mobilityFeedback)
? mobility_command_1.MobilityCommand_Feedback.fromJSON(object.mobilityFeedback)
: undefined,
};
},
toJSON(message) {
const obj = {};
message.fullBodyFeedback !== undefined &&
(obj.fullBodyFeedback = message.fullBodyFeedback
? full_body_command_1.FullBodyCommand_Feedback.toJSON(message.fullBodyFeedback)
: undefined);
message.synchronizedFeedback !== undefined &&
(obj.synchronizedFeedback = message.synchronizedFeedback
? synchronized_command_1.SynchronizedCommand_Feedback.toJSON(message.synchronizedFeedback)
: undefined);
message.mobilityFeedback !== undefined &&
(obj.mobilityFeedback = message.mobilityFeedback
? mobility_command_1.MobilityCommand_Feedback.toJSON(message.mobilityFeedback)
: undefined);
return obj;
},
fromPartial(object) {
const message = createBaseRobotCommandFeedback();
message.fullBodyFeedback =
object.fullBodyFeedback !== undefined && object.fullBodyFeedback !== null
? full_body_command_1.FullBodyCommand_Feedback.fromPartial(object.fullBodyFeedback)
: undefined;
message.synchronizedFeedback =
object.synchronizedFeedback !== undefined &&
object.synchronizedFeedback !== null
? synchronized_command_1.SynchronizedCommand_Feedback.fromPartial(object.synchronizedFeedback)
: undefined;
message.mobilityFeedback =
object.mobilityFeedback !== undefined && object.mobilityFeedback !== null
? mobility_command_1.MobilityCommand_Feedback.fromPartial(object.mobilityFeedback)
: undefined;
return message;
},
};
function createBaseRobotCommandRequest() {
return {
header: undefined,
lease: undefined,
command: undefined,
clockIdentifier: "",
};
}
exports.RobotCommandRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.RequestHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.lease !== undefined) {
lease_1.Lease.encode(message.lease, writer.uint32(18).fork()).ldelim();
}
if (message.command !== undefined) {
exports.RobotCommand.encode(message.command, writer.uint32(26).fork()).ldelim();
}
if (message.clockIdentifier !== "") {
writer.uint32(34).string(message.clockIdentifier);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRobotCommandRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.RequestHeader.decode(reader, reader.uint32());
break;
case 2:
message.lease = lease_1.Lease.decode(reader, reader.uint32());
break;
case 3:
message.command = exports.RobotCommand.decode(reader, reader.uint32());
break;
case 4:
message.clockIdentifier = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.RequestHeader.fromJSON(object.header)
: undefined,
lease: isSet(object.lease) ? lease_1.Lease.fromJSON(object.lease) : undefined,
command: isSet(object.command)
? exports.RobotCommand.fromJSON(object.command)
: undefined,
clockIdentifier: isSet(object.clockIdentifier)
? String(object.clockIdentifier)
: "",
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.RequestHeader.toJSON(message.header)
: undefined);
message.lease !== undefined &&
(obj.lease = message.lease ? lease_1.Lease.toJSON(message.lease) : undefined);
message.command !== undefined &&
(obj.command = message.command
? exports.RobotCommand.toJSON(message.command)
: undefined);
message.clockIdentifier !== undefined &&
(obj.clockIdentifier = message.clockIdentifier);
return obj;
},
fromPartial(object) {
const message = createBaseRobotCommandRequest();
message.header =
object.header !== undefined && object.header !== null
? header_1.RequestHeader.fromPartial(object.header)
: undefined;
message.lease =
object.lease !== undefined && object.lease !== null
? lease_1.Lease.fromPartial(object.lease)
: undefined;
message.command =
object.command !== undefined && object.command !== null
? exports.RobotCommand.fromPartial(object.command)
: undefined;
message.clockIdentifier = object.clockIdentifier ?? "";
return message;
},
};
function createBaseRobotCommandResponse() {
return {
header: undefined,
leaseUseResult: undefined,
status: 0,
message: "",
robotCommandId: 0,
};
}
exports.RobotCommandResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.ResponseHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.leaseUseResult !== undefined) {
lease_1.LeaseUseResult.encode(message.leaseUseResult, writer.uint32(18).fork()).ldelim();
}
if (message.status !== 0) {
writer.uint32(24).int32(message.status);
}
if (message.message !== "") {
writer.uint32(34).string(message.message);
}
if (message.robotCommandId !== 0) {
writer.uint32(40).uint32(message.robotCommandId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRobotCommandResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.ResponseHeader.decode(reader, reader.uint32());
break;
case 2:
message.leaseUseResult = lease_1.LeaseUseResult.decode(reader, reader.uint32());
break;
case 3:
message.status = reader.int32();
break;
case 4:
message.message = reader.string();
break;
case 5:
message.robotCommandId = reader.uint32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.ResponseHeader.fromJSON(object.header)
: undefined,
leaseUseResult: isSet(object.leaseUseResult)
? lease_1.LeaseUseResult.fromJSON(object.leaseUseResult)
: undefined,
status: isSet(object.status)
? robotCommandResponse_StatusFromJSON(object.status)
: 0,
message: isSet(object.message) ? String(object.message) : "",
robotCommandId: isSet(object.robotCommandId)
? Number(object.robotCommandId)
: 0,
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.ResponseHeader.toJSON(message.header)
: undefined);
message.leaseUseResult !== undefined &&
(obj.leaseUseResult = message.leaseUseResult
? lease_1.LeaseUseResult.toJSON(message.leaseUseResult)
: undefined);
message.status !== undefined &&
(obj.status = robotCommandResponse_StatusToJSON(message.status));
message.message !== undefined && (obj.message = message.message);
message.robotCommandId !== undefined &&
(obj.robotCommandId = Math.round(message.robotCommandId));
return obj;
},
fromPartial(object) {
const message = createBaseRobotCommandResponse();
message.header =
object.header !== undefined && object.header !== null
? header_1.ResponseHeader.fromPartial(object.header)
: undefined;
message.leaseUseResult =
object.leaseUseResult !== undefined && object.leaseUseResult !== null
? lease_1.LeaseUseResult.fromPartial(object.leaseUseResult)
: undefined;
message.status = object.status ?? 0;
message.message = object.message ?? "";
message.robotCommandId = object.robotCommandId ?? 0;
return message;
},
};
function createBaseRobotCommandFeedbackRequest() {
return { header: undefined, robotCommandId: 0 };
}
exports.RobotCommandFeedbackRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.RequestHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.robotCommandId !== 0) {
writer.uint32(16).uint32(message.robotCommandId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRobotCommandFeedbackRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.RequestHeader.decode(reader, reader.uint32());
break;
case 2:
message.robotCommandId = reader.uint32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.RequestHeader.fromJSON(object.header)
: undefined,
robotCommandId: isSet(object.robotCommandId)
? Number(object.robotCommandId)
: 0,
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.RequestHeader.toJSON(message.header)
: undefined);
message.robotCommandId !== undefined &&
(obj.robotCommandId = Math.round(message.robotCommandId));
return obj;
},
fromPartial(object) {
const message = createBaseRobotCommandFeedbackRequest();
message.header =
object.header !== undefined && object.header !== null
? header_1.RequestHeader.fromPartial(object.header)
: undefined;
message.robotCommandId = object.robotCommandId ?? 0;
return message;
},
};
function createBaseRobotCommandFeedbackResponse() {
return {
header: undefined,
leaseUseResult: undefined,
status: 0,
message: "",
feedback: undefined,
};
}
exports.RobotCommandFeedbackResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.ResponseHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.leaseUseResult !== undefined) {
lease_1.LeaseUseResult.encode(message.leaseUseResult, writer.uint32(42).fork()).ldelim();
}
if (message.status !== 0) {
writer.uint32(16).int32(message.status);
}
if (message.message !== "") {
writer.uint32(26).string(message.message);
}
if (message.feedback !== undefined) {
exports.RobotCommandFeedback.encode(message.feedback, writer.uint32(34).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRobotCommandFeedbackResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.ResponseHeader.decode(reader, reader.uint32());
break;
case 5:
message.leaseUseResult = lease_1.LeaseUseResult.decode(reader, reader.uint32());
break;
case 2:
message.status = reader.int32();
break;
case 3:
message.message = reader.string();
break;
case 4:
message.feedback = exports.RobotCommandFeedback.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.ResponseHeader.fromJSON(object.header)
: undefined,
leaseUseResult: isSet(object.leaseUseResult)
? lease_1.LeaseUseResult.fromJSON(object.leaseUseResult)
: undefined,
status: isSet(object.status)
? robotCommandFeedbackResponse_StatusFromJSON(object.status)
: 0,
message: isSet(object.message) ? String(object.message) : "",
feedback: isSet(object.feedback)
? exports.RobotCommandFeedback.fromJSON(object.feedback)
: undefined,
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.ResponseHeader.toJSON(message.header)
: undefined);
message.leaseUseResult !== undefined &&
(obj.leaseUseResult = message.leaseUseResult
? lease_1.LeaseUseResult.toJSON(message.leaseUseResult)
: undefined);
message.status !== undefined &&
(obj.status = robotCommandFeedbackResponse_StatusToJSON(message.status));
message.message !== undefined && (obj.message = message.message);
message.feedback !== undefined &&
(obj.feedback = message.feedback
? exports.RobotCommandFeedback.toJSON(message.feedback)
: undefined);
return obj;
},
fromPartial(object) {
const message = createBaseRobotCommandFeedbackResponse();
message.header =
object.header !== undefined && object.header !== null
? header_1.ResponseHeader.fromPartial(object.header)
: undefined;
message.leaseUseResult =
object.leaseUseResult !== undefined && object.leaseUseResult !== null
? lease_1.LeaseUseResult.fromPartial(object.leaseUseResult)
: undefined;
message.status = object.status ?? 0;
message.message = object.message ?? "";
message.feedback =
object.feedback !== undefined && object.feedback !== null
? exports.RobotCommandFeedback.fromPartial(object.feedback)
: undefined;
return message;
},
};
function createBaseClearBehaviorFaultRequest() {
return { header: undefined, lease: undefined, behaviorFaultId: 0 };
}
exports.ClearBehaviorFaultRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.RequestHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.lease !== undefined) {
lease_1.Lease.encode(message.lease, writer.uint32(18).fork()).ldelim();
}
if (message.behaviorFaultId !== 0) {
writer.uint32(24).uint32(message.behaviorFaultId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseClearBehaviorFaultRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.RequestHeader.decode(reader, reader.uint32());
break;
case 2:
message.lease = lease_1.Lease.decode(reader, reader.uint32());
break;
case 3:
message.behaviorFaultId = reader.uint32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.RequestHeader.fromJSON(object.header)
: undefined,
lease: isSet(object.lease) ? lease_1.Lease.fromJSON(object.lease) : undefined,
behaviorFaultId: isSet(object.behaviorFaultId)
? Number(object.behaviorFaultId)
: 0,
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.RequestHeader.toJSON(message.header)
: undefined);
message.lease !== undefined &&
(obj.lease = message.lease ? lease_1.Lease.toJSON(message.lease) : undefined);
message.behaviorFaultId !== undefined &&
(obj.behaviorFaultId = Math.round(message.behaviorFaultId));
return obj;
},
fromPartial(object) {
const message = createBaseClearBehaviorFaultRequest();
message.header =
object.header !== undefined && object.header !== null
? header_1.RequestHeader.fromPartial(object.header)
: undefined;
message.lease =
object.lease !== undefined && object.lease !== null
? lease_1.Lease.fromPartial(object.lease)
: undefined;
message.behaviorFaultId = object.behaviorFaultId ?? 0;
return message;
},
};
function createBaseClearBehaviorFaultResponse() {
return { header: undefined, leaseUseResult: undefined, status: 0 };
}
exports.ClearBehaviorFaultResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.header !== undefined) {
header_1.ResponseHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
}
if (message.leaseUseResult !== undefined) {
lease_1.LeaseUseResult.encode(message.leaseUseResult, writer.uint32(18).fork()).ldelim();
}
if (message.status !== 0) {
writer.uint32(24).int32(message.status);
}
return writer;
},
decode(input, length) {
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseClearBehaviorFaultResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.header = header_1.ResponseHeader.decode(reader, reader.uint32());
break;
case 2:
message.leaseUseResult = lease_1.LeaseUseResult.decode(reader, reader.uint32());
break;
case 3:
message.status = reader.int32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
header: isSet(object.header)
? header_1.ResponseHeader.fromJSON(object.header)
: undefined,
leaseUseResult: isSet(object.leaseUseResult)
? lease_1.LeaseUseResult.fromJSON(object.leaseUseResult)
: undefined,
status: isSet(object.status)
? clearBehaviorFaultResponse_StatusFromJSON(object.status)
: 0,
};
},
toJSON(message) {
const obj = {};
message.header !== undefined &&
(obj.header = message.header
? header_1.ResponseHeader.toJSON(message.header)
: undefined);
message.leaseUseResult !== undefined &&
(obj.leaseUseResult = message.leaseUseResult
? lease_1.LeaseUseResult.toJSON(message.leaseUseResult)
: undefined);
message.status !== undefined &&
(obj.status = clearBehaviorFaultResponse_StatusToJSON(message.status));
return obj;
},
fromPartial(object) {
const message = createBaseClearBehaviorFaultResponse();
message.header =
object.header !== undefined && object.header !== null
? header_1.ResponseHeader.fromPartial(object.header)
: undefined;
message.leaseUseResult =
object.leaseUseResult !== undefined && object.leaseUseResult !== null
? lease_1.LeaseUseResult.fromPartial(object.leaseUseResult)
: undefined;
message.status = object.status ?? 0;
return message;
},
};
function isSet(value) {
return value !== null && value !== undefined;
}
//# sourceMappingURL=robot_command.js.map