spot-sdk-js
Version:
Develop applications and payloads for Spot using the unofficial Boston Dynamics Spot Node.js SDK.
1,056 lines (910 loc) • 30.9 kB
JavaScript
// source: bosdyn/api/sparse_features.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_geometry_pb = require('../../bosdyn/api/geometry_pb.js');
goog.object.extend(proto, bosdyn_api_geometry_pb);
goog.exportSymbol('proto.bosdyn.api.Keypoint', null, global);
goog.exportSymbol('proto.bosdyn.api.KeypointMatches', null, global);
goog.exportSymbol('proto.bosdyn.api.KeypointSet', null, global);
goog.exportSymbol('proto.bosdyn.api.KeypointSet.KeypointType', null, global);
goog.exportSymbol('proto.bosdyn.api.Match', 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.Keypoint = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.Keypoint, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.Keypoint.displayName = 'proto.bosdyn.api.Keypoint';
}
/**
* 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.KeypointSet = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.bosdyn.api.KeypointSet.repeatedFields_, null);
};
goog.inherits(proto.bosdyn.api.KeypointSet, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.KeypointSet.displayName = 'proto.bosdyn.api.KeypointSet';
}
/**
* 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.Match = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.bosdyn.api.Match, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.Match.displayName = 'proto.bosdyn.api.Match';
}
/**
* 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.KeypointMatches = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.bosdyn.api.KeypointMatches.repeatedFields_, null);
};
goog.inherits(proto.bosdyn.api.KeypointMatches, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.KeypointMatches.displayName = 'proto.bosdyn.api.KeypointMatches';
}
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.Keypoint.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.Keypoint.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.Keypoint} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.Keypoint.toObject = function(includeInstance, msg) {
var f, obj = {
coordinates: (f = msg.getCoordinates()) && bosdyn_api_geometry_pb.Vec2.toObject(includeInstance, f),
binaryDescriptor: msg.getBinaryDescriptor_asB64(),
score: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0),
size: jspb.Message.getFloatingPointFieldWithDefault(msg, 5, 0.0),
angle: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0)
};
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.Keypoint}
*/
proto.bosdyn.api.Keypoint.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.Keypoint;
return proto.bosdyn.api.Keypoint.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.Keypoint} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.Keypoint}
*/
proto.bosdyn.api.Keypoint.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 2:
var value = new bosdyn_api_geometry_pb.Vec2;
reader.readMessage(value,bosdyn_api_geometry_pb.Vec2.deserializeBinaryFromReader);
msg.setCoordinates(value);
break;
case 3:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setBinaryDescriptor(value);
break;
case 4:
var value = /** @type {number} */ (reader.readFloat());
msg.setScore(value);
break;
case 5:
var value = /** @type {number} */ (reader.readFloat());
msg.setSize(value);
break;
case 6:
var value = /** @type {number} */ (reader.readFloat());
msg.setAngle(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.Keypoint.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.Keypoint.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.Keypoint} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.Keypoint.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getCoordinates();
if (f != null) {
writer.writeMessage(
2,
f,
bosdyn_api_geometry_pb.Vec2.serializeBinaryToWriter
);
}
f = message.getBinaryDescriptor_asU8();
if (f.length > 0) {
writer.writeBytes(
3,
f
);
}
f = message.getScore();
if (f !== 0.0) {
writer.writeFloat(
4,
f
);
}
f = message.getSize();
if (f !== 0.0) {
writer.writeFloat(
5,
f
);
}
f = message.getAngle();
if (f !== 0.0) {
writer.writeFloat(
6,
f
);
}
};
/**
* optional Vec2 coordinates = 2;
* @return {?proto.bosdyn.api.Vec2}
*/
proto.bosdyn.api.Keypoint.prototype.getCoordinates = function() {
return /** @type{?proto.bosdyn.api.Vec2} */ (
jspb.Message.getWrapperField(this, bosdyn_api_geometry_pb.Vec2, 2));
};
/**
* @param {?proto.bosdyn.api.Vec2|undefined} value
* @return {!proto.bosdyn.api.Keypoint} returns this
*/
proto.bosdyn.api.Keypoint.prototype.setCoordinates = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.Keypoint} returns this
*/
proto.bosdyn.api.Keypoint.prototype.clearCoordinates = function() {
return this.setCoordinates(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.Keypoint.prototype.hasCoordinates = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional bytes binary_descriptor = 3;
* @return {!(string|Uint8Array)}
*/
proto.bosdyn.api.Keypoint.prototype.getBinaryDescriptor = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* optional bytes binary_descriptor = 3;
* This is a type-conversion wrapper around `getBinaryDescriptor()`
* @return {string}
*/
proto.bosdyn.api.Keypoint.prototype.getBinaryDescriptor_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getBinaryDescriptor()));
};
/**
* optional bytes binary_descriptor = 3;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getBinaryDescriptor()`
* @return {!Uint8Array}
*/
proto.bosdyn.api.Keypoint.prototype.getBinaryDescriptor_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getBinaryDescriptor()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.bosdyn.api.Keypoint} returns this
*/
proto.bosdyn.api.Keypoint.prototype.setBinaryDescriptor = function(value) {
return jspb.Message.setProto3BytesField(this, 3, value);
};
/**
* optional float score = 4;
* @return {number}
*/
proto.bosdyn.api.Keypoint.prototype.getScore = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Keypoint} returns this
*/
proto.bosdyn.api.Keypoint.prototype.setScore = function(value) {
return jspb.Message.setProto3FloatField(this, 4, value);
};
/**
* optional float size = 5;
* @return {number}
*/
proto.bosdyn.api.Keypoint.prototype.getSize = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 5, 0.0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Keypoint} returns this
*/
proto.bosdyn.api.Keypoint.prototype.setSize = function(value) {
return jspb.Message.setProto3FloatField(this, 5, value);
};
/**
* optional float angle = 6;
* @return {number}
*/
proto.bosdyn.api.Keypoint.prototype.getAngle = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Keypoint} returns this
*/
proto.bosdyn.api.Keypoint.prototype.setAngle = function(value) {
return jspb.Message.setProto3FloatField(this, 6, value);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.bosdyn.api.KeypointSet.repeatedFields_ = [2];
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.KeypointSet.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.KeypointSet.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.KeypointSet} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.KeypointSet.toObject = function(includeInstance, msg) {
var f, obj = {
keypointsList: jspb.Message.toObjectList(msg.getKeypointsList(),
proto.bosdyn.api.Keypoint.toObject, includeInstance),
type: jspb.Message.getFieldWithDefault(msg, 3, 0)
};
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.KeypointSet}
*/
proto.bosdyn.api.KeypointSet.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.KeypointSet;
return proto.bosdyn.api.KeypointSet.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.KeypointSet} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.KeypointSet}
*/
proto.bosdyn.api.KeypointSet.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 2:
var value = new proto.bosdyn.api.Keypoint;
reader.readMessage(value,proto.bosdyn.api.Keypoint.deserializeBinaryFromReader);
msg.addKeypoints(value);
break;
case 3:
var value = /** @type {!proto.bosdyn.api.KeypointSet.KeypointType} */ (reader.readEnum());
msg.setType(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.KeypointSet.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.KeypointSet.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.KeypointSet} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.KeypointSet.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getKeypointsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
proto.bosdyn.api.Keypoint.serializeBinaryToWriter
);
}
f = message.getType();
if (f !== 0.0) {
writer.writeEnum(
3,
f
);
}
};
/**
* @enum {number}
*/
proto.bosdyn.api.KeypointSet.KeypointType = {
KEYPOINT_UNKNOWN: 0,
KEYPOINT_SIMPLE: 1,
KEYPOINT_ORB: 2
};
/**
* repeated Keypoint keypoints = 2;
* @return {!Array<!proto.bosdyn.api.Keypoint>}
*/
proto.bosdyn.api.KeypointSet.prototype.getKeypointsList = function() {
return /** @type{!Array<!proto.bosdyn.api.Keypoint>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.bosdyn.api.Keypoint, 2));
};
/**
* @param {!Array<!proto.bosdyn.api.Keypoint>} value
* @return {!proto.bosdyn.api.KeypointSet} returns this
*/
proto.bosdyn.api.KeypointSet.prototype.setKeypointsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.bosdyn.api.Keypoint=} opt_value
* @param {number=} opt_index
* @return {!proto.bosdyn.api.Keypoint}
*/
proto.bosdyn.api.KeypointSet.prototype.addKeypoints = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.bosdyn.api.Keypoint, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.bosdyn.api.KeypointSet} returns this
*/
proto.bosdyn.api.KeypointSet.prototype.clearKeypointsList = function() {
return this.setKeypointsList([]);
};
/**
* optional KeypointType type = 3;
* @return {!proto.bosdyn.api.KeypointSet.KeypointType}
*/
proto.bosdyn.api.KeypointSet.prototype.getType = function() {
return /** @type {!proto.bosdyn.api.KeypointSet.KeypointType} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {!proto.bosdyn.api.KeypointSet.KeypointType} value
* @return {!proto.bosdyn.api.KeypointSet} returns this
*/
proto.bosdyn.api.KeypointSet.prototype.setType = function(value) {
return jspb.Message.setProto3EnumField(this, 3, value);
};
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.Match.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.Match.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.Match} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.Match.toObject = function(includeInstance, msg) {
var f, obj = {
referenceIndex: jspb.Message.getFieldWithDefault(msg, 2, 0),
liveIndex: jspb.Message.getFieldWithDefault(msg, 3, 0),
distance: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0)
};
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.Match}
*/
proto.bosdyn.api.Match.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.Match;
return proto.bosdyn.api.Match.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.Match} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.Match}
*/
proto.bosdyn.api.Match.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 2:
var value = /** @type {number} */ (reader.readInt32());
msg.setReferenceIndex(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt32());
msg.setLiveIndex(value);
break;
case 4:
var value = /** @type {number} */ (reader.readFloat());
msg.setDistance(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.Match.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.Match.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.Match} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.Match.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getReferenceIndex();
if (f !== 0) {
writer.writeInt32(
2,
f
);
}
f = message.getLiveIndex();
if (f !== 0) {
writer.writeInt32(
3,
f
);
}
f = message.getDistance();
if (f !== 0.0) {
writer.writeFloat(
4,
f
);
}
};
/**
* optional int32 reference_index = 2;
* @return {number}
*/
proto.bosdyn.api.Match.prototype.getReferenceIndex = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Match} returns this
*/
proto.bosdyn.api.Match.prototype.setReferenceIndex = function(value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
/**
* optional int32 live_index = 3;
* @return {number}
*/
proto.bosdyn.api.Match.prototype.getLiveIndex = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Match} returns this
*/
proto.bosdyn.api.Match.prototype.setLiveIndex = function(value) {
return jspb.Message.setProto3IntField(this, 3, value);
};
/**
* optional float distance = 4;
* @return {number}
*/
proto.bosdyn.api.Match.prototype.getDistance = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Match} returns this
*/
proto.bosdyn.api.Match.prototype.setDistance = function(value) {
return jspb.Message.setProto3FloatField(this, 4, value);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.bosdyn.api.KeypointMatches.repeatedFields_ = [4];
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.KeypointMatches.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.KeypointMatches.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.KeypointMatches} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.KeypointMatches.toObject = function(includeInstance, msg) {
var f, obj = {
referenceKeypoints: (f = msg.getReferenceKeypoints()) && proto.bosdyn.api.KeypointSet.toObject(includeInstance, f),
liveKeypoints: (f = msg.getLiveKeypoints()) && proto.bosdyn.api.KeypointSet.toObject(includeInstance, f),
matchesList: jspb.Message.toObjectList(msg.getMatchesList(),
proto.bosdyn.api.Match.toObject, includeInstance)
};
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.KeypointMatches}
*/
proto.bosdyn.api.KeypointMatches.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.KeypointMatches;
return proto.bosdyn.api.KeypointMatches.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.KeypointMatches} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.KeypointMatches}
*/
proto.bosdyn.api.KeypointMatches.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 2:
var value = new proto.bosdyn.api.KeypointSet;
reader.readMessage(value,proto.bosdyn.api.KeypointSet.deserializeBinaryFromReader);
msg.setReferenceKeypoints(value);
break;
case 3:
var value = new proto.bosdyn.api.KeypointSet;
reader.readMessage(value,proto.bosdyn.api.KeypointSet.deserializeBinaryFromReader);
msg.setLiveKeypoints(value);
break;
case 4:
var value = new proto.bosdyn.api.Match;
reader.readMessage(value,proto.bosdyn.api.Match.deserializeBinaryFromReader);
msg.addMatches(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.KeypointMatches.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.KeypointMatches.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.KeypointMatches} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.KeypointMatches.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getReferenceKeypoints();
if (f != null) {
writer.writeMessage(
2,
f,
proto.bosdyn.api.KeypointSet.serializeBinaryToWriter
);
}
f = message.getLiveKeypoints();
if (f != null) {
writer.writeMessage(
3,
f,
proto.bosdyn.api.KeypointSet.serializeBinaryToWriter
);
}
f = message.getMatchesList();
if (f.length > 0) {
writer.writeRepeatedMessage(
4,
f,
proto.bosdyn.api.Match.serializeBinaryToWriter
);
}
};
/**
* optional KeypointSet reference_keypoints = 2;
* @return {?proto.bosdyn.api.KeypointSet}
*/
proto.bosdyn.api.KeypointMatches.prototype.getReferenceKeypoints = function() {
return /** @type{?proto.bosdyn.api.KeypointSet} */ (
jspb.Message.getWrapperField(this, proto.bosdyn.api.KeypointSet, 2));
};
/**
* @param {?proto.bosdyn.api.KeypointSet|undefined} value
* @return {!proto.bosdyn.api.KeypointMatches} returns this
*/
proto.bosdyn.api.KeypointMatches.prototype.setReferenceKeypoints = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.KeypointMatches} returns this
*/
proto.bosdyn.api.KeypointMatches.prototype.clearReferenceKeypoints = function() {
return this.setReferenceKeypoints(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.KeypointMatches.prototype.hasReferenceKeypoints = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional KeypointSet live_keypoints = 3;
* @return {?proto.bosdyn.api.KeypointSet}
*/
proto.bosdyn.api.KeypointMatches.prototype.getLiveKeypoints = function() {
return /** @type{?proto.bosdyn.api.KeypointSet} */ (
jspb.Message.getWrapperField(this, proto.bosdyn.api.KeypointSet, 3));
};
/**
* @param {?proto.bosdyn.api.KeypointSet|undefined} value
* @return {!proto.bosdyn.api.KeypointMatches} returns this
*/
proto.bosdyn.api.KeypointMatches.prototype.setLiveKeypoints = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.KeypointMatches} returns this
*/
proto.bosdyn.api.KeypointMatches.prototype.clearLiveKeypoints = function() {
return this.setLiveKeypoints(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.KeypointMatches.prototype.hasLiveKeypoints = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* repeated Match matches = 4;
* @return {!Array<!proto.bosdyn.api.Match>}
*/
proto.bosdyn.api.KeypointMatches.prototype.getMatchesList = function() {
return /** @type{!Array<!proto.bosdyn.api.Match>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.bosdyn.api.Match, 4));
};
/**
* @param {!Array<!proto.bosdyn.api.Match>} value
* @return {!proto.bosdyn.api.KeypointMatches} returns this
*/
proto.bosdyn.api.KeypointMatches.prototype.setMatchesList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 4, value);
};
/**
* @param {!proto.bosdyn.api.Match=} opt_value
* @param {number=} opt_index
* @return {!proto.bosdyn.api.Match}
*/
proto.bosdyn.api.KeypointMatches.prototype.addMatches = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.bosdyn.api.Match, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.bosdyn.api.KeypointMatches} returns this
*/
proto.bosdyn.api.KeypointMatches.prototype.clearMatchesList = function() {
return this.setMatchesList([]);
};
goog.object.extend(exports, proto.bosdyn.api);