spot-sdk-js
Version:
Develop applications and payloads for Spot using the unofficial Boston Dynamics Spot Node.js SDK.
553 lines (478 loc) • 18.3 kB
JavaScript
// source: bosdyn/api/payload_estimation.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var bosdyn_api_payload_pb = require('../../bosdyn/api/payload_pb.js');
goog.object.extend(proto, bosdyn_api_payload_pb);
goog.exportSymbol('proto.bosdyn.api.PayloadEstimationCommand', null, global);
goog.exportSymbol('proto.bosdyn.api.PayloadEstimationCommand.Feedback', null, global);
goog.exportSymbol('proto.bosdyn.api.PayloadEstimationCommand.Feedback.Error', null, global);
goog.exportSymbol('proto.bosdyn.api.PayloadEstimationCommand.Feedback.Status', null, global);
goog.exportSymbol('proto.bosdyn.api.PayloadEstimationCommand.Request', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.PayloadEstimationCommand = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.PayloadEstimationCommand, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.PayloadEstimationCommand.displayName = 'proto.bosdyn.api.PayloadEstimationCommand';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.PayloadEstimationCommand.Request = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.PayloadEstimationCommand.Request, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.PayloadEstimationCommand.Request.displayName = 'proto.bosdyn.api.PayloadEstimationCommand.Request';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.PayloadEstimationCommand.Feedback, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.displayName = 'proto.bosdyn.api.PayloadEstimationCommand.Feedback';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.PayloadEstimationCommand.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.PayloadEstimationCommand.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.PayloadEstimationCommand} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.PayloadEstimationCommand.toObject = function(includeInstance, msg) {
var f, obj = {
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.PayloadEstimationCommand}
*/
proto.bosdyn.api.PayloadEstimationCommand.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.PayloadEstimationCommand;
return proto.bosdyn.api.PayloadEstimationCommand.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.PayloadEstimationCommand} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.PayloadEstimationCommand}
*/
proto.bosdyn.api.PayloadEstimationCommand.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.PayloadEstimationCommand.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.PayloadEstimationCommand.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.PayloadEstimationCommand} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.PayloadEstimationCommand.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.PayloadEstimationCommand.Request.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.PayloadEstimationCommand.Request.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.PayloadEstimationCommand.Request} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.PayloadEstimationCommand.Request.toObject = function(includeInstance, msg) {
var f, obj = {
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.PayloadEstimationCommand.Request}
*/
proto.bosdyn.api.PayloadEstimationCommand.Request.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.PayloadEstimationCommand.Request;
return proto.bosdyn.api.PayloadEstimationCommand.Request.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.PayloadEstimationCommand.Request} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.PayloadEstimationCommand.Request}
*/
proto.bosdyn.api.PayloadEstimationCommand.Request.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.PayloadEstimationCommand.Request.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.PayloadEstimationCommand.Request.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.PayloadEstimationCommand.Request} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.PayloadEstimationCommand.Request.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.PayloadEstimationCommand.Feedback.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.bosdyn.api.PayloadEstimationCommand.Feedback} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.toObject = function(includeInstance, msg) {
var f, obj = {
status: jspb.Message.getFieldWithDefault(msg, 1, 0),
progress: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0),
error: jspb.Message.getFieldWithDefault(msg, 3, 0),
estimatedPayload: (f = msg.getEstimatedPayload()) && bosdyn_api_payload_pb.Payload.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.PayloadEstimationCommand.Feedback}
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.PayloadEstimationCommand.Feedback;
return proto.bosdyn.api.PayloadEstimationCommand.Feedback.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.PayloadEstimationCommand.Feedback} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.PayloadEstimationCommand.Feedback}
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.bosdyn.api.PayloadEstimationCommand.Feedback.Status} */ (reader.readEnum());
msg.setStatus(value);
break;
case 2:
var value = /** @type {number} */ (reader.readFloat());
msg.setProgress(value);
break;
case 3:
var value = /** @type {!proto.bosdyn.api.PayloadEstimationCommand.Feedback.Error} */ (reader.readEnum());
msg.setError(value);
break;
case 4:
var value = new bosdyn_api_payload_pb.Payload;
reader.readMessage(value,bosdyn_api_payload_pb.Payload.deserializeBinaryFromReader);
msg.setEstimatedPayload(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.PayloadEstimationCommand.Feedback.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.PayloadEstimationCommand.Feedback} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getStatus();
if (f !== 0.0) {
writer.writeEnum(
1,
f
);
}
f = message.getProgress();
if (f !== 0.0) {
writer.writeFloat(
2,
f
);
}
f = message.getError();
if (f !== 0.0) {
writer.writeEnum(
3,
f
);
}
f = message.getEstimatedPayload();
if (f != null) {
writer.writeMessage(
4,
f,
bosdyn_api_payload_pb.Payload.serializeBinaryToWriter
);
}
};
/**
* @enum {number}
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.Status = {
STATUS_UNKNOWN: 0,
STATUS_COMPLETED: 1,
STATUS_SMALL_MASS: 2,
STATUS_IN_PROGRESS: 3,
STATUS_ERROR: 4
};
/**
* @enum {number}
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.Error = {
ERROR_UNKNOWN: 0,
ERROR_NONE: 1,
ERROR_FAILED_STAND: 2,
ERROR_NO_RESULTS: 3
};
/**
* optional Status status = 1;
* @return {!proto.bosdyn.api.PayloadEstimationCommand.Feedback.Status}
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.getStatus = function() {
return /** @type {!proto.bosdyn.api.PayloadEstimationCommand.Feedback.Status} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.bosdyn.api.PayloadEstimationCommand.Feedback.Status} value
* @return {!proto.bosdyn.api.PayloadEstimationCommand.Feedback} returns this
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.setStatus = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional float progress = 2;
* @return {number}
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.getProgress = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.PayloadEstimationCommand.Feedback} returns this
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.setProgress = function(value) {
return jspb.Message.setProto3FloatField(this, 2, value);
};
/**
* optional Error error = 3;
* @return {!proto.bosdyn.api.PayloadEstimationCommand.Feedback.Error}
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.getError = function() {
return /** @type {!proto.bosdyn.api.PayloadEstimationCommand.Feedback.Error} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {!proto.bosdyn.api.PayloadEstimationCommand.Feedback.Error} value
* @return {!proto.bosdyn.api.PayloadEstimationCommand.Feedback} returns this
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.setError = function(value) {
return jspb.Message.setProto3EnumField(this, 3, value);
};
/**
* optional Payload estimated_payload = 4;
* @return {?proto.bosdyn.api.Payload}
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.getEstimatedPayload = function() {
return /** @type{?proto.bosdyn.api.Payload} */ (
jspb.Message.getWrapperField(this, bosdyn_api_payload_pb.Payload, 4));
};
/**
* @param {?proto.bosdyn.api.Payload|undefined} value
* @return {!proto.bosdyn.api.PayloadEstimationCommand.Feedback} returns this
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.setEstimatedPayload = function(value) {
return jspb.Message.setWrapperField(this, 4, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.PayloadEstimationCommand.Feedback} returns this
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.clearEstimatedPayload = function() {
return this.setEstimatedPayload(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.PayloadEstimationCommand.Feedback.prototype.hasEstimatedPayload = function() {
return jspb.Message.getField(this, 4) != null;
};
goog.object.extend(exports, proto.bosdyn.api);