spot-sdk-ts
Version:
TypeScript bindings based on protobufs (proto3) provided by Boston Dynamics
1,120 lines (1,119 loc) • 74.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.Graph = exports.Anchoring = exports.AnchoredWorldObject = exports.Anchor = exports.EdgeSnapshot_Stance = exports.EdgeSnapshot = exports.Edge_Annotations_StairData = exports.Edge_Annotations = exports.Edge_Id = exports.Edge = exports.WaypointSnapshot = exports.Waypoint_Annotations_LocalizeRegion_Circle2D = exports.Waypoint_Annotations_LocalizeRegion_Empty = exports.Waypoint_Annotations_LocalizeRegion_Default = exports.Waypoint_Annotations_LocalizeRegion = exports.Waypoint_Annotations = exports.Waypoint = exports.edge_Annotations_DirectionConstraintToJSON = exports.edge_Annotations_DirectionConstraintFromJSON = exports.Edge_Annotations_DirectionConstraint = exports.edge_EdgeSourceToJSON = exports.edge_EdgeSourceFromJSON = exports.Edge_EdgeSource = exports.waypoint_WaypointSourceToJSON = exports.waypoint_WaypointSourceFromJSON = exports.Waypoint_WaypointSource = exports.annotationStateToJSON = exports.annotationStateFromJSON = exports.AnnotationState = exports.protobufPackage = void 0;
/* eslint-disable */
const timestamp_1 = require("../../../google/protobuf/timestamp");
const geometry_1 = require("../geometry");
const image_1 = require("../image");
const point_cloud_1 = require("../point_cloud");
const world_object_1 = require("../world_object");
const robot_state_1 = require("../robot_state");
const local_grid_1 = require("../local_grid");
const payload_1 = require("../payload");
const robot_command_1 = require("../spot/robot_command");
const stairs_1 = require("../stairs");
const minimal_1 = __importDefault(require("protobufjs/minimal"));
const wrappers_1 = require("../../../google/protobuf/wrappers");
const field_mask_1 = require("../../../google/protobuf/field_mask");
exports.protobufPackage = "bosdyn.api.graph_nav";
/** Indicator of whether or not the waypoint and edge annotations are complete and filled out. */
var AnnotationState;
(function (AnnotationState) {
/** ANNOTATION_STATE_UNKNOWN - No assertions made about this annotation. */
AnnotationState[AnnotationState["ANNOTATION_STATE_UNKNOWN"] = 0] = "ANNOTATION_STATE_UNKNOWN";
/** ANNOTATION_STATE_SET - This annotation and all of its fields have been deliberately set. */
AnnotationState[AnnotationState["ANNOTATION_STATE_SET"] = 1] = "ANNOTATION_STATE_SET";
/** ANNOTATION_STATE_NONE - This annotation has been deliberately set to "no annotation" -- any subfields are unset. */
AnnotationState[AnnotationState["ANNOTATION_STATE_NONE"] = 2] = "ANNOTATION_STATE_NONE";
AnnotationState[AnnotationState["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(AnnotationState = exports.AnnotationState || (exports.AnnotationState = {}));
function annotationStateFromJSON(object) {
switch (object) {
case 0:
case "ANNOTATION_STATE_UNKNOWN":
return AnnotationState.ANNOTATION_STATE_UNKNOWN;
case 1:
case "ANNOTATION_STATE_SET":
return AnnotationState.ANNOTATION_STATE_SET;
case 2:
case "ANNOTATION_STATE_NONE":
return AnnotationState.ANNOTATION_STATE_NONE;
case -1:
case "UNRECOGNIZED":
default:
return AnnotationState.UNRECOGNIZED;
}
}
exports.annotationStateFromJSON = annotationStateFromJSON;
function annotationStateToJSON(object) {
switch (object) {
case AnnotationState.ANNOTATION_STATE_UNKNOWN:
return "ANNOTATION_STATE_UNKNOWN";
case AnnotationState.ANNOTATION_STATE_SET:
return "ANNOTATION_STATE_SET";
case AnnotationState.ANNOTATION_STATE_NONE:
return "ANNOTATION_STATE_NONE";
case AnnotationState.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.annotationStateToJSON = annotationStateToJSON;
var Waypoint_WaypointSource;
(function (Waypoint_WaypointSource) {
Waypoint_WaypointSource[Waypoint_WaypointSource["WAYPOINT_SOURCE_UNKNOWN"] = 0] = "WAYPOINT_SOURCE_UNKNOWN";
/** WAYPOINT_SOURCE_ROBOT_PATH - Waypoints from the robot's location during recording. */
Waypoint_WaypointSource[Waypoint_WaypointSource["WAYPOINT_SOURCE_ROBOT_PATH"] = 1] = "WAYPOINT_SOURCE_ROBOT_PATH";
/** WAYPOINT_SOURCE_USER_REQUEST - Waypoints with user-requested placement. */
Waypoint_WaypointSource[Waypoint_WaypointSource["WAYPOINT_SOURCE_USER_REQUEST"] = 2] = "WAYPOINT_SOURCE_USER_REQUEST";
/** WAYPOINT_SOURCE_ALTERNATE_ROUTE_FINDING - Waypoints that may help find alternate routes. */
Waypoint_WaypointSource[Waypoint_WaypointSource["WAYPOINT_SOURCE_ALTERNATE_ROUTE_FINDING"] = 3] = "WAYPOINT_SOURCE_ALTERNATE_ROUTE_FINDING";
Waypoint_WaypointSource[Waypoint_WaypointSource["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(Waypoint_WaypointSource = exports.Waypoint_WaypointSource || (exports.Waypoint_WaypointSource = {}));
function waypoint_WaypointSourceFromJSON(object) {
switch (object) {
case 0:
case "WAYPOINT_SOURCE_UNKNOWN":
return Waypoint_WaypointSource.WAYPOINT_SOURCE_UNKNOWN;
case 1:
case "WAYPOINT_SOURCE_ROBOT_PATH":
return Waypoint_WaypointSource.WAYPOINT_SOURCE_ROBOT_PATH;
case 2:
case "WAYPOINT_SOURCE_USER_REQUEST":
return Waypoint_WaypointSource.WAYPOINT_SOURCE_USER_REQUEST;
case 3:
case "WAYPOINT_SOURCE_ALTERNATE_ROUTE_FINDING":
return Waypoint_WaypointSource.WAYPOINT_SOURCE_ALTERNATE_ROUTE_FINDING;
case -1:
case "UNRECOGNIZED":
default:
return Waypoint_WaypointSource.UNRECOGNIZED;
}
}
exports.waypoint_WaypointSourceFromJSON = waypoint_WaypointSourceFromJSON;
function waypoint_WaypointSourceToJSON(object) {
switch (object) {
case Waypoint_WaypointSource.WAYPOINT_SOURCE_UNKNOWN:
return "WAYPOINT_SOURCE_UNKNOWN";
case Waypoint_WaypointSource.WAYPOINT_SOURCE_ROBOT_PATH:
return "WAYPOINT_SOURCE_ROBOT_PATH";
case Waypoint_WaypointSource.WAYPOINT_SOURCE_USER_REQUEST:
return "WAYPOINT_SOURCE_USER_REQUEST";
case Waypoint_WaypointSource.WAYPOINT_SOURCE_ALTERNATE_ROUTE_FINDING:
return "WAYPOINT_SOURCE_ALTERNATE_ROUTE_FINDING";
case Waypoint_WaypointSource.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.waypoint_WaypointSourceToJSON = waypoint_WaypointSourceToJSON;
var Edge_EdgeSource;
(function (Edge_EdgeSource) {
Edge_EdgeSource[Edge_EdgeSource["EDGE_SOURCE_UNKNOWN"] = 0] = "EDGE_SOURCE_UNKNOWN";
/** EDGE_SOURCE_ODOMETRY - Edges with transforms from odometry. */
Edge_EdgeSource[Edge_EdgeSource["EDGE_SOURCE_ODOMETRY"] = 1] = "EDGE_SOURCE_ODOMETRY";
/** EDGE_SOURCE_SMALL_LOOP_CLOSURE - Edges with transforms from a short chain of other edges. */
Edge_EdgeSource[Edge_EdgeSource["EDGE_SOURCE_SMALL_LOOP_CLOSURE"] = 2] = "EDGE_SOURCE_SMALL_LOOP_CLOSURE";
/** EDGE_SOURCE_FIDUCIAL_LOOP_CLOSURE - Edges with transforms from multiple fiducial observations. */
Edge_EdgeSource[Edge_EdgeSource["EDGE_SOURCE_FIDUCIAL_LOOP_CLOSURE"] = 3] = "EDGE_SOURCE_FIDUCIAL_LOOP_CLOSURE";
/** EDGE_SOURCE_ALTERNATE_ROUTE_FINDING - Edges that may help find alternate routes. */
Edge_EdgeSource[Edge_EdgeSource["EDGE_SOURCE_ALTERNATE_ROUTE_FINDING"] = 4] = "EDGE_SOURCE_ALTERNATE_ROUTE_FINDING";
/** EDGE_SOURCE_USER_REQUEST - Created via a CreateEdge RPC. */
Edge_EdgeSource[Edge_EdgeSource["EDGE_SOURCE_USER_REQUEST"] = 5] = "EDGE_SOURCE_USER_REQUEST";
Edge_EdgeSource[Edge_EdgeSource["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(Edge_EdgeSource = exports.Edge_EdgeSource || (exports.Edge_EdgeSource = {}));
function edge_EdgeSourceFromJSON(object) {
switch (object) {
case 0:
case "EDGE_SOURCE_UNKNOWN":
return Edge_EdgeSource.EDGE_SOURCE_UNKNOWN;
case 1:
case "EDGE_SOURCE_ODOMETRY":
return Edge_EdgeSource.EDGE_SOURCE_ODOMETRY;
case 2:
case "EDGE_SOURCE_SMALL_LOOP_CLOSURE":
return Edge_EdgeSource.EDGE_SOURCE_SMALL_LOOP_CLOSURE;
case 3:
case "EDGE_SOURCE_FIDUCIAL_LOOP_CLOSURE":
return Edge_EdgeSource.EDGE_SOURCE_FIDUCIAL_LOOP_CLOSURE;
case 4:
case "EDGE_SOURCE_ALTERNATE_ROUTE_FINDING":
return Edge_EdgeSource.EDGE_SOURCE_ALTERNATE_ROUTE_FINDING;
case 5:
case "EDGE_SOURCE_USER_REQUEST":
return Edge_EdgeSource.EDGE_SOURCE_USER_REQUEST;
case -1:
case "UNRECOGNIZED":
default:
return Edge_EdgeSource.UNRECOGNIZED;
}
}
exports.edge_EdgeSourceFromJSON = edge_EdgeSourceFromJSON;
function edge_EdgeSourceToJSON(object) {
switch (object) {
case Edge_EdgeSource.EDGE_SOURCE_UNKNOWN:
return "EDGE_SOURCE_UNKNOWN";
case Edge_EdgeSource.EDGE_SOURCE_ODOMETRY:
return "EDGE_SOURCE_ODOMETRY";
case Edge_EdgeSource.EDGE_SOURCE_SMALL_LOOP_CLOSURE:
return "EDGE_SOURCE_SMALL_LOOP_CLOSURE";
case Edge_EdgeSource.EDGE_SOURCE_FIDUCIAL_LOOP_CLOSURE:
return "EDGE_SOURCE_FIDUCIAL_LOOP_CLOSURE";
case Edge_EdgeSource.EDGE_SOURCE_ALTERNATE_ROUTE_FINDING:
return "EDGE_SOURCE_ALTERNATE_ROUTE_FINDING";
case Edge_EdgeSource.EDGE_SOURCE_USER_REQUEST:
return "EDGE_SOURCE_USER_REQUEST";
case Edge_EdgeSource.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.edge_EdgeSourceToJSON = edge_EdgeSourceToJSON;
var Edge_Annotations_DirectionConstraint;
(function (Edge_Annotations_DirectionConstraint) {
/** DIRECTION_CONSTRAINT_UNKNOWN - We don't know if there are direction constraints. */
Edge_Annotations_DirectionConstraint[Edge_Annotations_DirectionConstraint["DIRECTION_CONSTRAINT_UNKNOWN"] = 0] = "DIRECTION_CONSTRAINT_UNKNOWN";
/** DIRECTION_CONSTRAINT_NO_TURN - The robot must not turn while walking the edge, but can face either waypoint. */
Edge_Annotations_DirectionConstraint[Edge_Annotations_DirectionConstraint["DIRECTION_CONSTRAINT_NO_TURN"] = 1] = "DIRECTION_CONSTRAINT_NO_TURN";
/** DIRECTION_CONSTRAINT_FORWARD - Robot should walk the edge face-first. */
Edge_Annotations_DirectionConstraint[Edge_Annotations_DirectionConstraint["DIRECTION_CONSTRAINT_FORWARD"] = 2] = "DIRECTION_CONSTRAINT_FORWARD";
/** DIRECTION_CONSTRAINT_REVERSE - Robot should walk the edge rear-first. */
Edge_Annotations_DirectionConstraint[Edge_Annotations_DirectionConstraint["DIRECTION_CONSTRAINT_REVERSE"] = 3] = "DIRECTION_CONSTRAINT_REVERSE";
/** DIRECTION_CONSTRAINT_NONE - No constraints on which way the robot faces. */
Edge_Annotations_DirectionConstraint[Edge_Annotations_DirectionConstraint["DIRECTION_CONSTRAINT_NONE"] = 4] = "DIRECTION_CONSTRAINT_NONE";
Edge_Annotations_DirectionConstraint[Edge_Annotations_DirectionConstraint["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(Edge_Annotations_DirectionConstraint = exports.Edge_Annotations_DirectionConstraint || (exports.Edge_Annotations_DirectionConstraint = {}));
function edge_Annotations_DirectionConstraintFromJSON(object) {
switch (object) {
case 0:
case "DIRECTION_CONSTRAINT_UNKNOWN":
return Edge_Annotations_DirectionConstraint.DIRECTION_CONSTRAINT_UNKNOWN;
case 1:
case "DIRECTION_CONSTRAINT_NO_TURN":
return Edge_Annotations_DirectionConstraint.DIRECTION_CONSTRAINT_NO_TURN;
case 2:
case "DIRECTION_CONSTRAINT_FORWARD":
return Edge_Annotations_DirectionConstraint.DIRECTION_CONSTRAINT_FORWARD;
case 3:
case "DIRECTION_CONSTRAINT_REVERSE":
return Edge_Annotations_DirectionConstraint.DIRECTION_CONSTRAINT_REVERSE;
case 4:
case "DIRECTION_CONSTRAINT_NONE":
return Edge_Annotations_DirectionConstraint.DIRECTION_CONSTRAINT_NONE;
case -1:
case "UNRECOGNIZED":
default:
return Edge_Annotations_DirectionConstraint.UNRECOGNIZED;
}
}
exports.edge_Annotations_DirectionConstraintFromJSON = edge_Annotations_DirectionConstraintFromJSON;
function edge_Annotations_DirectionConstraintToJSON(object) {
switch (object) {
case Edge_Annotations_DirectionConstraint.DIRECTION_CONSTRAINT_UNKNOWN:
return "DIRECTION_CONSTRAINT_UNKNOWN";
case Edge_Annotations_DirectionConstraint.DIRECTION_CONSTRAINT_NO_TURN:
return "DIRECTION_CONSTRAINT_NO_TURN";
case Edge_Annotations_DirectionConstraint.DIRECTION_CONSTRAINT_FORWARD:
return "DIRECTION_CONSTRAINT_FORWARD";
case Edge_Annotations_DirectionConstraint.DIRECTION_CONSTRAINT_REVERSE:
return "DIRECTION_CONSTRAINT_REVERSE";
case Edge_Annotations_DirectionConstraint.DIRECTION_CONSTRAINT_NONE:
return "DIRECTION_CONSTRAINT_NONE";
case Edge_Annotations_DirectionConstraint.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
exports.edge_Annotations_DirectionConstraintToJSON = edge_Annotations_DirectionConstraintToJSON;
function createBaseWaypoint() {
return {
id: "",
snapshotId: "",
waypointTformKo: undefined,
annotations: undefined,
};
}
exports.Waypoint = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
if (message.snapshotId !== "") {
writer.uint32(18).string(message.snapshotId);
}
if (message.waypointTformKo !== undefined) {
geometry_1.SE3Pose.encode(message.waypointTformKo, writer.uint32(26).fork()).ldelim();
}
if (message.annotations !== undefined) {
exports.Waypoint_Annotations.encode(message.annotations, 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 = createBaseWaypoint();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.id = reader.string();
break;
case 2:
message.snapshotId = reader.string();
break;
case 3:
message.waypointTformKo = geometry_1.SE3Pose.decode(reader, reader.uint32());
break;
case 4:
message.annotations = exports.Waypoint_Annotations.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
id: isSet(object.id) ? String(object.id) : "",
snapshotId: isSet(object.snapshotId) ? String(object.snapshotId) : "",
waypointTformKo: isSet(object.waypointTformKo)
? geometry_1.SE3Pose.fromJSON(object.waypointTformKo)
: undefined,
annotations: isSet(object.annotations)
? exports.Waypoint_Annotations.fromJSON(object.annotations)
: undefined,
};
},
toJSON(message) {
const obj = {};
message.id !== undefined && (obj.id = message.id);
message.snapshotId !== undefined && (obj.snapshotId = message.snapshotId);
message.waypointTformKo !== undefined &&
(obj.waypointTformKo = message.waypointTformKo
? geometry_1.SE3Pose.toJSON(message.waypointTformKo)
: undefined);
message.annotations !== undefined &&
(obj.annotations = message.annotations
? exports.Waypoint_Annotations.toJSON(message.annotations)
: undefined);
return obj;
},
fromPartial(object) {
const message = createBaseWaypoint();
message.id = object.id ?? "";
message.snapshotId = object.snapshotId ?? "";
message.waypointTformKo =
object.waypointTformKo !== undefined && object.waypointTformKo !== null
? geometry_1.SE3Pose.fromPartial(object.waypointTformKo)
: undefined;
message.annotations =
object.annotations !== undefined && object.annotations !== null
? exports.Waypoint_Annotations.fromPartial(object.annotations)
: undefined;
return message;
},
};
function createBaseWaypoint_Annotations() {
return {
name: "",
creationTime: undefined,
icpVariance: undefined,
scanMatchRegion: undefined,
waypointSource: 0,
};
}
exports.Waypoint_Annotations = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
if (message.creationTime !== undefined) {
timestamp_1.Timestamp.encode(toTimestamp(message.creationTime), writer.uint32(34).fork()).ldelim();
}
if (message.icpVariance !== undefined) {
geometry_1.SE3Covariance.encode(message.icpVariance, writer.uint32(18).fork()).ldelim();
}
if (message.scanMatchRegion !== undefined) {
exports.Waypoint_Annotations_LocalizeRegion.encode(message.scanMatchRegion, writer.uint32(26).fork()).ldelim();
}
if (message.waypointSource !== 0) {
writer.uint32(40).int32(message.waypointSource);
}
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 = createBaseWaypoint_Annotations();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.name = reader.string();
break;
case 4:
message.creationTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
break;
case 2:
message.icpVariance = geometry_1.SE3Covariance.decode(reader, reader.uint32());
break;
case 3:
message.scanMatchRegion = exports.Waypoint_Annotations_LocalizeRegion.decode(reader, reader.uint32());
break;
case 5:
message.waypointSource = reader.int32();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
name: isSet(object.name) ? String(object.name) : "",
creationTime: isSet(object.creationTime)
? fromJsonTimestamp(object.creationTime)
: undefined,
icpVariance: isSet(object.icpVariance)
? geometry_1.SE3Covariance.fromJSON(object.icpVariance)
: undefined,
scanMatchRegion: isSet(object.scanMatchRegion)
? exports.Waypoint_Annotations_LocalizeRegion.fromJSON(object.scanMatchRegion)
: undefined,
waypointSource: isSet(object.waypointSource)
? waypoint_WaypointSourceFromJSON(object.waypointSource)
: 0,
};
},
toJSON(message) {
const obj = {};
message.name !== undefined && (obj.name = message.name);
message.creationTime !== undefined &&
(obj.creationTime = message.creationTime.toISOString());
message.icpVariance !== undefined &&
(obj.icpVariance = message.icpVariance
? geometry_1.SE3Covariance.toJSON(message.icpVariance)
: undefined);
message.scanMatchRegion !== undefined &&
(obj.scanMatchRegion = message.scanMatchRegion
? exports.Waypoint_Annotations_LocalizeRegion.toJSON(message.scanMatchRegion)
: undefined);
message.waypointSource !== undefined &&
(obj.waypointSource = waypoint_WaypointSourceToJSON(message.waypointSource));
return obj;
},
fromPartial(object) {
const message = createBaseWaypoint_Annotations();
message.name = object.name ?? "";
message.creationTime = object.creationTime ?? undefined;
message.icpVariance =
object.icpVariance !== undefined && object.icpVariance !== null
? geometry_1.SE3Covariance.fromPartial(object.icpVariance)
: undefined;
message.scanMatchRegion =
object.scanMatchRegion !== undefined && object.scanMatchRegion !== null
? exports.Waypoint_Annotations_LocalizeRegion.fromPartial(object.scanMatchRegion)
: undefined;
message.waypointSource = object.waypointSource ?? 0;
return message;
},
};
function createBaseWaypoint_Annotations_LocalizeRegion() {
return {
state: 0,
defaultRegion: undefined,
empty: undefined,
circle: undefined,
};
}
exports.Waypoint_Annotations_LocalizeRegion = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.state !== 0) {
writer.uint32(8).int32(message.state);
}
if (message.defaultRegion !== undefined) {
exports.Waypoint_Annotations_LocalizeRegion_Default.encode(message.defaultRegion, writer.uint32(18).fork()).ldelim();
}
if (message.empty !== undefined) {
exports.Waypoint_Annotations_LocalizeRegion_Empty.encode(message.empty, writer.uint32(26).fork()).ldelim();
}
if (message.circle !== undefined) {
exports.Waypoint_Annotations_LocalizeRegion_Circle2D.encode(message.circle, 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 = createBaseWaypoint_Annotations_LocalizeRegion();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.state = reader.int32();
break;
case 2:
message.defaultRegion =
exports.Waypoint_Annotations_LocalizeRegion_Default.decode(reader, reader.uint32());
break;
case 3:
message.empty = exports.Waypoint_Annotations_LocalizeRegion_Empty.decode(reader, reader.uint32());
break;
case 4:
message.circle = exports.Waypoint_Annotations_LocalizeRegion_Circle2D.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
state: isSet(object.state) ? annotationStateFromJSON(object.state) : 0,
defaultRegion: isSet(object.defaultRegion)
? exports.Waypoint_Annotations_LocalizeRegion_Default.fromJSON(object.defaultRegion)
: undefined,
empty: isSet(object.empty)
? exports.Waypoint_Annotations_LocalizeRegion_Empty.fromJSON(object.empty)
: undefined,
circle: isSet(object.circle)
? exports.Waypoint_Annotations_LocalizeRegion_Circle2D.fromJSON(object.circle)
: undefined,
};
},
toJSON(message) {
const obj = {};
message.state !== undefined &&
(obj.state = annotationStateToJSON(message.state));
message.defaultRegion !== undefined &&
(obj.defaultRegion = message.defaultRegion
? exports.Waypoint_Annotations_LocalizeRegion_Default.toJSON(message.defaultRegion)
: undefined);
message.empty !== undefined &&
(obj.empty = message.empty
? exports.Waypoint_Annotations_LocalizeRegion_Empty.toJSON(message.empty)
: undefined);
message.circle !== undefined &&
(obj.circle = message.circle
? exports.Waypoint_Annotations_LocalizeRegion_Circle2D.toJSON(message.circle)
: undefined);
return obj;
},
fromPartial(object) {
const message = createBaseWaypoint_Annotations_LocalizeRegion();
message.state = object.state ?? 0;
message.defaultRegion =
object.defaultRegion !== undefined && object.defaultRegion !== null
? exports.Waypoint_Annotations_LocalizeRegion_Default.fromPartial(object.defaultRegion)
: undefined;
message.empty =
object.empty !== undefined && object.empty !== null
? exports.Waypoint_Annotations_LocalizeRegion_Empty.fromPartial(object.empty)
: undefined;
message.circle =
object.circle !== undefined && object.circle !== null
? exports.Waypoint_Annotations_LocalizeRegion_Circle2D.fromPartial(object.circle)
: undefined;
return message;
},
};
function createBaseWaypoint_Annotations_LocalizeRegion_Default() {
return {};
}
exports.Waypoint_Annotations_LocalizeRegion_Default = {
encode(_, writer = minimal_1.default.Writer.create()) {
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 = createBaseWaypoint_Annotations_LocalizeRegion_Default();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(_) {
return {};
},
toJSON(_) {
const obj = {};
return obj;
},
fromPartial(_) {
const message = createBaseWaypoint_Annotations_LocalizeRegion_Default();
return message;
},
};
function createBaseWaypoint_Annotations_LocalizeRegion_Empty() {
return {};
}
exports.Waypoint_Annotations_LocalizeRegion_Empty = {
encode(_, writer = minimal_1.default.Writer.create()) {
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 = createBaseWaypoint_Annotations_LocalizeRegion_Empty();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(_) {
return {};
},
toJSON(_) {
const obj = {};
return obj;
},
fromPartial(_) {
const message = createBaseWaypoint_Annotations_LocalizeRegion_Empty();
return message;
},
};
function createBaseWaypoint_Annotations_LocalizeRegion_Circle2D() {
return { dist2d: 0 };
}
exports.Waypoint_Annotations_LocalizeRegion_Circle2D = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.dist2d !== 0) {
writer.uint32(9).double(message.dist2d);
}
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 = createBaseWaypoint_Annotations_LocalizeRegion_Circle2D();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.dist2d = reader.double();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
dist2d: isSet(object.dist2d) ? Number(object.dist2d) : 0,
};
},
toJSON(message) {
const obj = {};
message.dist2d !== undefined && (obj.dist2d = message.dist2d);
return obj;
},
fromPartial(object) {
const message = createBaseWaypoint_Annotations_LocalizeRegion_Circle2D();
message.dist2d = object.dist2d ?? 0;
return message;
},
};
function createBaseWaypointSnapshot() {
return {
id: "",
images: [],
pointCloud: undefined,
objects: [],
robotState: undefined,
robotLocalGrids: [],
isPointCloudProcessed: false,
versionId: "",
hasRemotePointCloudSensor: false,
bodyTformRemotePointCloudSensor: undefined,
payloads: [],
};
}
exports.WaypointSnapshot = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.id !== "") {
writer.uint32(10).string(message.id);
}
for (const v of message.images) {
image_1.ImageResponse.encode(v, writer.uint32(18).fork()).ldelim();
}
if (message.pointCloud !== undefined) {
point_cloud_1.PointCloud.encode(message.pointCloud, writer.uint32(26).fork()).ldelim();
}
for (const v of message.objects) {
world_object_1.WorldObject.encode(v, writer.uint32(34).fork()).ldelim();
}
if (message.robotState !== undefined) {
robot_state_1.RobotState.encode(message.robotState, writer.uint32(42).fork()).ldelim();
}
for (const v of message.robotLocalGrids) {
local_grid_1.LocalGrid.encode(v, writer.uint32(50).fork()).ldelim();
}
if (message.isPointCloudProcessed === true) {
writer.uint32(64).bool(message.isPointCloudProcessed);
}
if (message.versionId !== "") {
writer.uint32(74).string(message.versionId);
}
if (message.hasRemotePointCloudSensor === true) {
writer.uint32(80).bool(message.hasRemotePointCloudSensor);
}
if (message.bodyTformRemotePointCloudSensor !== undefined) {
geometry_1.SE3Pose.encode(message.bodyTformRemotePointCloudSensor, writer.uint32(90).fork()).ldelim();
}
for (const v of message.payloads) {
payload_1.Payload.encode(v, writer.uint32(98).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 = createBaseWaypointSnapshot();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.id = reader.string();
break;
case 2:
message.images.push(image_1.ImageResponse.decode(reader, reader.uint32()));
break;
case 3:
message.pointCloud = point_cloud_1.PointCloud.decode(reader, reader.uint32());
break;
case 4:
message.objects.push(world_object_1.WorldObject.decode(reader, reader.uint32()));
break;
case 5:
message.robotState = robot_state_1.RobotState.decode(reader, reader.uint32());
break;
case 6:
message.robotLocalGrids.push(local_grid_1.LocalGrid.decode(reader, reader.uint32()));
break;
case 8:
message.isPointCloudProcessed = reader.bool();
break;
case 9:
message.versionId = reader.string();
break;
case 10:
message.hasRemotePointCloudSensor = reader.bool();
break;
case 11:
message.bodyTformRemotePointCloudSensor = geometry_1.SE3Pose.decode(reader, reader.uint32());
break;
case 12:
message.payloads.push(payload_1.Payload.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
id: isSet(object.id) ? String(object.id) : "",
images: Array.isArray(object?.images)
? object.images.map((e) => image_1.ImageResponse.fromJSON(e))
: [],
pointCloud: isSet(object.pointCloud)
? point_cloud_1.PointCloud.fromJSON(object.pointCloud)
: undefined,
objects: Array.isArray(object?.objects)
? object.objects.map((e) => world_object_1.WorldObject.fromJSON(e))
: [],
robotState: isSet(object.robotState)
? robot_state_1.RobotState.fromJSON(object.robotState)
: undefined,
robotLocalGrids: Array.isArray(object?.robotLocalGrids)
? object.robotLocalGrids.map((e) => local_grid_1.LocalGrid.fromJSON(e))
: [],
isPointCloudProcessed: isSet(object.isPointCloudProcessed)
? Boolean(object.isPointCloudProcessed)
: false,
versionId: isSet(object.versionId) ? String(object.versionId) : "",
hasRemotePointCloudSensor: isSet(object.hasRemotePointCloudSensor)
? Boolean(object.hasRemotePointCloudSensor)
: false,
bodyTformRemotePointCloudSensor: isSet(object.bodyTformRemotePointCloudSensor)
? geometry_1.SE3Pose.fromJSON(object.bodyTformRemotePointCloudSensor)
: undefined,
payloads: Array.isArray(object?.payloads)
? object.payloads.map((e) => payload_1.Payload.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
message.id !== undefined && (obj.id = message.id);
if (message.images) {
obj.images = message.images.map((e) => e ? image_1.ImageResponse.toJSON(e) : undefined);
}
else {
obj.images = [];
}
message.pointCloud !== undefined &&
(obj.pointCloud = message.pointCloud
? point_cloud_1.PointCloud.toJSON(message.pointCloud)
: undefined);
if (message.objects) {
obj.objects = message.objects.map((e) => e ? world_object_1.WorldObject.toJSON(e) : undefined);
}
else {
obj.objects = [];
}
message.robotState !== undefined &&
(obj.robotState = message.robotState
? robot_state_1.RobotState.toJSON(message.robotState)
: undefined);
if (message.robotLocalGrids) {
obj.robotLocalGrids = message.robotLocalGrids.map((e) => e ? local_grid_1.LocalGrid.toJSON(e) : undefined);
}
else {
obj.robotLocalGrids = [];
}
message.isPointCloudProcessed !== undefined &&
(obj.isPointCloudProcessed = message.isPointCloudProcessed);
message.versionId !== undefined && (obj.versionId = message.versionId);
message.hasRemotePointCloudSensor !== undefined &&
(obj.hasRemotePointCloudSensor = message.hasRemotePointCloudSensor);
message.bodyTformRemotePointCloudSensor !== undefined &&
(obj.bodyTformRemotePointCloudSensor =
message.bodyTformRemotePointCloudSensor
? geometry_1.SE3Pose.toJSON(message.bodyTformRemotePointCloudSensor)
: undefined);
if (message.payloads) {
obj.payloads = message.payloads.map((e) => e ? payload_1.Payload.toJSON(e) : undefined);
}
else {
obj.payloads = [];
}
return obj;
},
fromPartial(object) {
const message = createBaseWaypointSnapshot();
message.id = object.id ?? "";
message.images =
object.images?.map((e) => image_1.ImageResponse.fromPartial(e)) || [];
message.pointCloud =
object.pointCloud !== undefined && object.pointCloud !== null
? point_cloud_1.PointCloud.fromPartial(object.pointCloud)
: undefined;
message.objects =
object.objects?.map((e) => world_object_1.WorldObject.fromPartial(e)) || [];
message.robotState =
object.robotState !== undefined && object.robotState !== null
? robot_state_1.RobotState.fromPartial(object.robotState)
: undefined;
message.robotLocalGrids =
object.robotLocalGrids?.map((e) => local_grid_1.LocalGrid.fromPartial(e)) || [];
message.isPointCloudProcessed = object.isPointCloudProcessed ?? false;
message.versionId = object.versionId ?? "";
message.hasRemotePointCloudSensor =
object.hasRemotePointCloudSensor ?? false;
message.bodyTformRemotePointCloudSensor =
object.bodyTformRemotePointCloudSensor !== undefined &&
object.bodyTformRemotePointCloudSensor !== null
? geometry_1.SE3Pose.fromPartial(object.bodyTformRemotePointCloudSensor)
: undefined;
message.payloads =
object.payloads?.map((e) => payload_1.Payload.fromPartial(e)) || [];
return message;
},
};
function createBaseEdge() {
return {
id: undefined,
snapshotId: "",
fromTformTo: undefined,
annotations: undefined,
};
}
exports.Edge = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.id !== undefined) {
exports.Edge_Id.encode(message.id, writer.uint32(10).fork()).ldelim();
}
if (message.snapshotId !== "") {
writer.uint32(18).string(message.snapshotId);
}
if (message.fromTformTo !== undefined) {
geometry_1.SE3Pose.encode(message.fromTformTo, writer.uint32(26).fork()).ldelim();
}
if (message.annotations !== undefined) {
exports.Edge_Annotations.encode(message.annotations, 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 = createBaseEdge();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.id = exports.Edge_Id.decode(reader, reader.uint32());
break;
case 2:
message.snapshotId = reader.string();
break;
case 3:
message.fromTformTo = geometry_1.SE3Pose.decode(reader, reader.uint32());
break;
case 4:
message.annotations = exports.Edge_Annotations.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
id: isSet(object.id) ? exports.Edge_Id.fromJSON(object.id) : undefined,
snapshotId: isSet(object.snapshotId) ? String(object.snapshotId) : "",
fromTformTo: isSet(object.fromTformTo)
? geometry_1.SE3Pose.fromJSON(object.fromTformTo)
: undefined,
annotations: isSet(object.annotations)
? exports.Edge_Annotations.fromJSON(object.annotations)
: undefined,
};
},
toJSON(message) {
const obj = {};
message.id !== undefined &&
(obj.id = message.id ? exports.Edge_Id.toJSON(message.id) : undefined);
message.snapshotId !== undefined && (obj.snapshotId = message.snapshotId);
message.fromTformTo !== undefined &&
(obj.fromTformTo = message.fromTformTo
? geometry_1.SE3Pose.toJSON(message.fromTformTo)
: undefined);
message.annotations !== undefined &&
(obj.annotations = message.annotations
? exports.Edge_Annotations.toJSON(message.annotations)
: undefined);
return obj;
},
fromPartial(object) {
const message = createBaseEdge();
message.id =
object.id !== undefined && object.id !== null
? exports.Edge_Id.fromPartial(object.id)
: undefined;
message.snapshotId = object.snapshotId ?? "";
message.fromTformTo =
object.fromTformTo !== undefined && object.fromTformTo !== null
? geometry_1.SE3Pose.fromPartial(object.fromTformTo)
: undefined;
message.annotations =
object.annotations !== undefined && object.annotations !== null
? exports.Edge_Annotations.fromPartial(object.annotations)
: undefined;
return message;
},
};
function createBaseEdge_Id() {
return { fromWaypoint: "", toWaypoint: "" };
}
exports.Edge_Id = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.fromWaypoint !== "") {
writer.uint32(10).string(message.fromWaypoint);
}
if (message.toWaypoint !== "") {
writer.uint32(18).string(message.toWaypoint);
}
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 = createBaseEdge_Id();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.fromWaypoint = reader.string();
break;
case 2:
message.toWaypoint = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
fromWaypoint: isSet(object.fromWaypoint)
? String(object.fromWaypoint)
: "",
toWaypoint: isSet(object.toWaypoint) ? String(object.toWaypoint) : "",
};
},
toJSON(message) {
const obj = {};
message.fromWaypoint !== undefined &&
(obj.fromWaypoint = message.fromWaypoint);
message.toWaypoint !== undefined && (obj.toWaypoint = message.toWaypoint);
return obj;
},
fromPartial(object) {
const message = createBaseEdge_Id();
message.fromWaypoint = object.fromWaypoint ?? "";
message.toWaypoint = object.toWaypoint ?? "";
return message;
},
};
function createBaseEdge_Annotations() {
return {
velLimit: undefined,
stairs: undefined,
directionConstraint: 0,
requireAlignment: undefined,
flatGround: undefined,
groundMuHint: undefined,
gratedFloor: undefined,
overrideMobilityParams: undefined,
mobilityParams: undefined,
cost: undefined,
edgeSource: 0,
disableAlternateRouteFinding: false,
};
}
exports.Edge_Annotations = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.velLimit !== undefined) {
geometry_1.SE2VelocityLimit.encode(message.velLimit, writer.uint32(10).fork()).ldelim();
}
if (message.stairs !== undefined) {
exports.Edge_Annotations_StairData.encode(message.stairs, writer.uint32(18).fork()).ldelim();
}
if (message.directionConstraint !== 0) {
writer.uint32(32).int32(message.directionConstraint);
}
if (message.requireAlignment !== undefined) {
wrappers_1.BoolValue.encode({ value: message.requireAlignment }, writer.uint32(42).fork()).ldelim();
}
if (message.flatGround !== undefined) {
wrappers_1.BoolValue.encode({ value: message.flatGround }, writer.uint32(50).fork()).ldelim();
}
if (message.groundMuHint !== undefined) {
wrappers_1.DoubleValue.encode({ value: message.groundMuHint }, writer.uint32(58).fork()).ldelim();
}
if (message.gratedFloor !== undefined) {
wrappers_1.BoolValue.encode({ value: message.gratedFloor }, writer.uint32(66).fork()).ldelim();
}
if (message.overrideMobilityParams !== undefined) {
field_mask_1.FieldMask.encode(field_mask_1.FieldMask.wrap(message.overrideMobilityParams), writer.uint32(74).fork()).ldelim();
}
if (message.mobilityParams !== undefined) {
robot_command_1.MobilityParams.encode(message.mobilityParams, writer.uint32(82).fork()).ldelim();
}
if (message.cost !== undefined) {
wrappers_1.DoubleValue.encode({ value: message.cost }, writer.uint32(90).fork()).ldelim();
}
if (message.edgeSource !== 0) {
writer.uint32(96).int32(message.edgeSource);
}
if (message.disableAlternateRouteFinding === true) {
writer.uint32(104).bool(message.disableAlternateRouteFinding);
}
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 = createBaseEdge_Annotations();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.velLimit = geometry_1.SE2VelocityLimit.decode(reader, reader.uint32());
break;
case 2:
message.stairs = exports.Edge_Annotations_StairData.decode(reader, reader.uint32());
break;
case 4:
message.directionConstraint = reader.int32();
break;
case 5:
message.requireAlignment = wrappers_1.BoolValue.decode(reader, reader.uint32()).value;
break;
case 6:
message.flatGround = wrappers_1.BoolValue.decode(reader, reader.uint32()).value;
break;
case 7:
message.groundMuHint = wrappers_1.DoubleValue.decode(reader, reader.uint32()).value;
break;
case 8:
message.gratedFloor = wrappers_1.BoolValue.decode(reader, reader.uint32()).value;
break;
case 9:
message.overrideMobilityParams = field_mask_1.FieldMask.unwrap(field_mask_1.FieldMask.decode(reader, reader.uint32()));
break;
case 10:
message.mobilityParams = robot_command_1.MobilityParams.decode(reader, reader.uint32());
break;
case 11:
message.cost = wrappers_1.DoubleValue.decode(reader, reader.uint32()).value;
break;
case 12:
message.edgeSource = reader.int32();
break;
case 13:
message.disableAlternateRouteFinding = reader.bool();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
velLimit: isSet(object.velLimit)
? geometry_1.SE2VelocityLimit.fromJSON(object.velLimit)
: undefined,
stairs: isSet(object.stairs)
? exports.Edge_Annotations_StairData.fromJSON(object.stairs)
: undefined,
directionConstraint: isSet(object.directionConstraint)
? edge_Annotations_DirectionConstraintFromJSON(object.directionConstraint)
: 0,
requireAlignment: isSet(object.requireAlignment)
? Boolean(object.requireAlignment)
: undefined,
flatGround: isSet(object.flatGround)