UNPKG

spot-sdk-ts

Version:

TypeScript bindings based on protobufs (proto3) provided by Boston Dynamics

1,481 lines (1,395 loc) 77.6 kB
/* eslint-disable */ import { Timestamp } from "../../../google/protobuf/timestamp"; import { SE3Pose, SE3Covariance, SE2VelocityLimit } from "../geometry"; import { ImageResponse } from "../image"; import { PointCloud } from "../point_cloud"; import { WorldObject } from "../world_object"; import { RobotState, FootState } from "../robot_state"; import { LocalGrid } from "../local_grid"; import { Payload } from "../payload"; import { MobilityParams } from "../spot/robot_command"; import { StraightStaircase } from "../stairs"; import _m0 from "protobufjs/minimal"; import { BoolValue, DoubleValue } from "../../../google/protobuf/wrappers"; import { FieldMask } from "../../../google/protobuf/field_mask"; export const protobufPackage = "bosdyn.api.graph_nav"; /** Indicator of whether or not the waypoint and edge annotations are complete and filled out. */ export enum AnnotationState { /** ANNOTATION_STATE_UNKNOWN - No assertions made about this annotation. */ ANNOTATION_STATE_UNKNOWN = 0, /** ANNOTATION_STATE_SET - This annotation and all of its fields have been deliberately set. */ ANNOTATION_STATE_SET = 1, /** ANNOTATION_STATE_NONE - This annotation has been deliberately set to "no annotation" -- any subfields are unset. */ ANNOTATION_STATE_NONE = 2, UNRECOGNIZED = -1, } export function annotationStateFromJSON(object: any): AnnotationState { 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; } } export function annotationStateToJSON(object: AnnotationState): string { 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"; } } /** * A base element of the graph nav map. A waypoint consists of a reference frame, a name, * a unique ID, annotations, and sensor data. */ export interface Waypoint { /** * Identifier of the waypoint. Unique across all maps. * This identifier does not have to be updated when its fields change. */ id: string; /** Identifier of this waypoint's Snapshot data. */ snapshotId: string; /** Transform from the KO frame (at time of recording) to the waypoint. */ waypointTformKo: SE3Pose | undefined; /** Annotations specific to the current waypoint. */ annotations: Waypoint_Annotations | undefined; } export enum Waypoint_WaypointSource { WAYPOINT_SOURCE_UNKNOWN = 0, /** WAYPOINT_SOURCE_ROBOT_PATH - Waypoints from the robot's location during recording. */ WAYPOINT_SOURCE_ROBOT_PATH = 1, /** WAYPOINT_SOURCE_USER_REQUEST - Waypoints with user-requested placement. */ WAYPOINT_SOURCE_USER_REQUEST = 2, /** WAYPOINT_SOURCE_ALTERNATE_ROUTE_FINDING - Waypoints that may help find alternate routes. */ WAYPOINT_SOURCE_ALTERNATE_ROUTE_FINDING = 3, UNRECOGNIZED = -1, } export function waypoint_WaypointSourceFromJSON( object: any ): Waypoint_WaypointSource { 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; } } export function waypoint_WaypointSourceToJSON( object: Waypoint_WaypointSource ): string { 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"; } } /** Annotations understood by BostonDynamics systems. */ export interface Waypoint_Annotations { /** Human-friendly name of the waypoint. For example, "Kitchen Fridge" */ name: string; /** The time that the waypoint was created while recording a map. */ creationTime: Date | undefined; /** Estimate of the variance of ICP when performed at this waypoint, collected at record time. */ icpVariance: SE3Covariance | undefined; /** Options for how to localize to a waypoint (if at all). */ scanMatchRegion: Waypoint_Annotations_LocalizeRegion | undefined; /** How this waypoint was made. */ waypointSource: Waypoint_WaypointSource; } export interface Waypoint_Annotations_LocalizeRegion { /** Check this before reading other fields. */ state: AnnotationState; /** Oneof field that describes the waypoint's location as a default region (no special features/traits). */ defaultRegion: Waypoint_Annotations_LocalizeRegion_Default | undefined; /** Oneof field that describes the waypoint's location as a empty/featureless region. */ empty: Waypoint_Annotations_LocalizeRegion_Empty | undefined; /** Oneof field that describes the waypoint's location as a circular region. */ circle: Waypoint_Annotations_LocalizeRegion_Circle2D | undefined; } /** Use the default region to localize in. */ export interface Waypoint_Annotations_LocalizeRegion_Default {} /** Do not localize to this waypoint. */ export interface Waypoint_Annotations_LocalizeRegion_Empty {} /** * Indicates the number of meters away we can be from this waypoint we can be before scan * matching. * - If zero, the default value is used. * - If less than zero, no scan matching will be performed at this waypoint. * - If greater than zero, scan matching will only be performed if the robot is at most this * far away from the waypoint. * Distance calculation is done in the 2d plane with respect to the waypoint. */ export interface Waypoint_Annotations_LocalizeRegion_Circle2D { /** meters. */ dist2d: number; } /** * Relevant data collected at the waypoint. * May be used for localization or automatically generating annotations, for example. * Should be indexed by a waypoint's "snapshot_id" field. */ export interface WaypointSnapshot { /** * Identifier of this snapshot. * Snapshots are immutable -- if any of the other fields change, this ID must also change. */ id: string; /** Any images captured at the waypoint. */ images: ImageResponse[]; /** Aggregated point cloud data. */ pointCloud: PointCloud | undefined; /** Perception objects seen at snapshot time. */ objects: WorldObject[]; /** Full robot state during snapshot. */ robotState: RobotState | undefined; /** Robot grid data. */ robotLocalGrids: LocalGrid[]; /** If true, the point cloud of this snapshot has been processed. */ isPointCloudProcessed: boolean; /** * If this snapshot is a modified version of the raw snapshot with the given ID (for example, it has been processed), * a new unique ID will we assigned to this field. If the field is empty, this is the raw version of the snapshot. */ versionId: string; /** * If true, the point cloud contains data from a remote point cloud service, * such as LIDAR. */ hasRemotePointCloudSensor: boolean; /** * Transform from the robot body to the remote point cloud sensor's * reference frame. */ bodyTformRemotePointCloudSensor: SE3Pose | undefined; /** Defines the payloads attached to the robot at this waypoint. */ payloads: Payload[]; } /** * A base element of the graph nav map. Edges consist of a directed edge from one * waypoint to another and a transform that estimates the relationship in 3D space * between the two waypoints. */ export interface Edge { /** * Identifier of this Edge. * Edges are mutable -- the identifier does not have to be updated when other fields change. */ id: Edge_Id | undefined; /** Identifier of this edge's Snapshot data. */ snapshotId: string; /** Describes the transform between the "from" waypoint and the "to" waypoint. */ fromTformTo: SE3Pose | undefined; /** Annotations specific to the current edge. */ annotations: Edge_Annotations | undefined; } export enum Edge_EdgeSource { EDGE_SOURCE_UNKNOWN = 0, /** EDGE_SOURCE_ODOMETRY - Edges with transforms from odometry. */ EDGE_SOURCE_ODOMETRY = 1, /** EDGE_SOURCE_SMALL_LOOP_CLOSURE - Edges with transforms from a short chain of other edges. */ EDGE_SOURCE_SMALL_LOOP_CLOSURE = 2, /** EDGE_SOURCE_FIDUCIAL_LOOP_CLOSURE - Edges with transforms from multiple fiducial observations. */ EDGE_SOURCE_FIDUCIAL_LOOP_CLOSURE = 3, /** EDGE_SOURCE_ALTERNATE_ROUTE_FINDING - Edges that may help find alternate routes. */ EDGE_SOURCE_ALTERNATE_ROUTE_FINDING = 4, /** EDGE_SOURCE_USER_REQUEST - Created via a CreateEdge RPC. */ EDGE_SOURCE_USER_REQUEST = 5, UNRECOGNIZED = -1, } export function edge_EdgeSourceFromJSON(object: any): Edge_EdgeSource { 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; } } export function edge_EdgeSourceToJSON(object: Edge_EdgeSource): string { 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"; } } /** * An edge is uniquely identified by the waypoints it connects. * Two waypoints will only ever be connected by a single edge. * That edge is traversable in either direction. */ export interface Edge_Id { /** Identifier of the "from" waypoint. */ fromWaypoint: string; /** Identifier of the "to" waypoint. */ toWaypoint: string; } /** Annotations understood by BostonDynamics systems. */ export interface Edge_Annotations { /** * Velocity limits to use while traversing the edge. * These are maxima and minima, NOT target speeds. * NOTE: as of 2.4 this is deprecated. Please use mobility_params.vel_limit. * * @deprecated */ velLimit: SE2VelocityLimit | undefined; /** Stairs information/parameters specific to the edge. */ stairs: Edge_Annotations_StairData | undefined; /** * Direction constraints for how the robot must move and the directions it can face * when traversing the edge. */ directionConstraint: Edge_Annotations_DirectionConstraint; /** If true, the robot must be aligned with the edge in yaw before traversing it. */ requireAlignment: boolean | undefined; /** If true, the edge crosses flat ground and the robot shouldn't try to climb over obstacles. */ flatGround: boolean | undefined; /** * Terrain coefficient of friction user hint. This value must be postive and will clamped if * necessary on the robot side. Best suggested values lie in the range between 0.4 and 0.8 * (which is the robot's default.) * WARNING: deprecated as of 2.1. Use mobility_params instead, which includes ground_mu_hint * as part of the terrain_params. * * @deprecated */ groundMuHint: number | undefined; /** * If true, the edge crosses over grated metal. This changes some parameters of the robot's * perception system to allow it to see grated floors bettter. * WARNING: deprecated as of 2.1. Use mobility_params instead, which includes grated_floor * as part of the terrain_params. * * @deprecated */ gratedFloor: boolean | undefined; /** * Overrides the following fields of the mobility parameters to whatever is * stored in the map. For example, if this FieldMask contains "stair_hint" and * "terrain_params.enable_grated_floor", then the map will be * annotated with "stair_hint" and "enable_grated_floor" settings. An empty FieldMask means all fields are active * annotations. Note that the more conservative of the velocity limit stored in the mobility parameters and the * TravelParams of the entire route will be used for this edge (regardless of what override_mobility_params says). */ overrideMobilityParams: string[] | undefined; /** * Contains terrain parameters, swing height, obstacle avoidance parameters, etc. * When the robot crosses this edge, it will use the mobility parameters here. */ mobilityParams: MobilityParams | undefined; /** Assign edges a cost; used when finding the "shortest" (lowest cost) path. */ cost: number | undefined; /** How this edge was made. */ edgeSource: Edge_EdgeSource; /** If true, disables alternate-route-finding for this edge. */ disableAlternateRouteFinding: boolean; } export enum Edge_Annotations_DirectionConstraint { /** DIRECTION_CONSTRAINT_UNKNOWN - We don't know if there are direction constraints. */ DIRECTION_CONSTRAINT_UNKNOWN = 0, /** DIRECTION_CONSTRAINT_NO_TURN - The robot must not turn while walking the edge, but can face either waypoint. */ DIRECTION_CONSTRAINT_NO_TURN = 1, /** DIRECTION_CONSTRAINT_FORWARD - Robot should walk the edge face-first. */ DIRECTION_CONSTRAINT_FORWARD = 2, /** DIRECTION_CONSTRAINT_REVERSE - Robot should walk the edge rear-first. */ DIRECTION_CONSTRAINT_REVERSE = 3, /** DIRECTION_CONSTRAINT_NONE - No constraints on which way the robot faces. */ DIRECTION_CONSTRAINT_NONE = 4, UNRECOGNIZED = -1, } export function edge_Annotations_DirectionConstraintFromJSON( object: any ): Edge_Annotations_DirectionConstraint { 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; } } export function edge_Annotations_DirectionConstraintToJSON( object: Edge_Annotations_DirectionConstraint ): string { 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"; } } /** Defines any parameters of the stairs */ export interface Edge_Annotations_StairData { /** Check this before reading other fields. */ state: AnnotationState; /** Parameters describing a straight staircase. */ straightStaircase: StraightStaircase | undefined; } /** * Relevant data collected along the edge. * May be used for automatically generating annotations, for example. */ export interface EdgeSnapshot { /** * Identifier of this snapshot. * Snapshots are immutable -- if any of the other fields change, this ID must also change. */ id: string; /** Sampling of stances as robot traversed this edge. */ stances: EdgeSnapshot_Stance[]; } export interface EdgeSnapshot_Stance { /** Timestamp of the stance. */ timestamp: Date | undefined; /** List of all the foot positions for a single stance. */ footStates: FootState[]; /** KO Body position corresponding to this stance. */ koTformBody: SE3Pose | undefined; /** Vision Body position corresponding to this stance. */ visionTformBody: SE3Pose | undefined; /** Does this stance correspond to a planar ground region. */ planarGround: boolean | undefined; } /** This associates a waypoint with a common reference frame, which is not necessarily metric. */ export interface Anchor { /** Identifier of the waypoint. */ id: string; /** Pose of the waypoint in the seed frame. */ seedTformWaypoint: SE3Pose | undefined; } /** This associates a world object with a common reference frame, which is not necessarily metric. */ export interface AnchoredWorldObject { /** Identifier of the world object. */ id: string; /** Pose of the object in the seed frame. */ seedTformObject: SE3Pose | undefined; } export interface Anchoring { /** * The waypoint ids for the graph, expressed in a common reference frame, which is not * necessarily metric. If there is no anchoring, this is empty. */ anchors: Anchor[]; /** World objects, located in the common reference frame. */ objects: AnchoredWorldObject[]; } /** * This is an arbitrary collection of waypoints and edges. The edges and waypoints are not required * to be connected. A waypoint may belong to multiple graphs. This message is used to pass around * information about a graph's topology, and is used to serialize map topology to and from files. * Note that the graph does not contain any of the waypoint/edge data (which is found in snapshots). * Snapshots are stored separately. */ export interface Graph { /** The waypoints for the graph (containing frames, annotations, and sensor data). */ waypoints: Waypoint[]; /** The edges connecting the graph's waypoints. */ edges: Edge[]; /** The anchoring (mapping from waypoints to their pose in a shared reference frame). */ anchoring: Anchoring | undefined; } function createBaseWaypoint(): Waypoint { return { id: "", snapshotId: "", waypointTformKo: undefined, annotations: undefined, }; } export const Waypoint = { encode( message: Waypoint, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.id !== "") { writer.uint32(10).string(message.id); } if (message.snapshotId !== "") { writer.uint32(18).string(message.snapshotId); } if (message.waypointTformKo !== undefined) { SE3Pose.encode( message.waypointTformKo, writer.uint32(26).fork() ).ldelim(); } if (message.annotations !== undefined) { Waypoint_Annotations.encode( message.annotations, writer.uint32(34).fork() ).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Waypoint { const reader = input instanceof _m0.Reader ? input : new _m0.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 = SE3Pose.decode(reader, reader.uint32()); break; case 4: message.annotations = Waypoint_Annotations.decode( reader, reader.uint32() ); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): Waypoint { return { id: isSet(object.id) ? String(object.id) : "", snapshotId: isSet(object.snapshotId) ? String(object.snapshotId) : "", waypointTformKo: isSet(object.waypointTformKo) ? SE3Pose.fromJSON(object.waypointTformKo) : undefined, annotations: isSet(object.annotations) ? Waypoint_Annotations.fromJSON(object.annotations) : undefined, }; }, toJSON(message: Waypoint): unknown { const obj: any = {}; message.id !== undefined && (obj.id = message.id); message.snapshotId !== undefined && (obj.snapshotId = message.snapshotId); message.waypointTformKo !== undefined && (obj.waypointTformKo = message.waypointTformKo ? SE3Pose.toJSON(message.waypointTformKo) : undefined); message.annotations !== undefined && (obj.annotations = message.annotations ? Waypoint_Annotations.toJSON(message.annotations) : undefined); return obj; }, fromPartial<I extends Exact<DeepPartial<Waypoint>, I>>(object: I): Waypoint { const message = createBaseWaypoint(); message.id = object.id ?? ""; message.snapshotId = object.snapshotId ?? ""; message.waypointTformKo = object.waypointTformKo !== undefined && object.waypointTformKo !== null ? SE3Pose.fromPartial(object.waypointTformKo) : undefined; message.annotations = object.annotations !== undefined && object.annotations !== null ? Waypoint_Annotations.fromPartial(object.annotations) : undefined; return message; }, }; function createBaseWaypoint_Annotations(): Waypoint_Annotations { return { name: "", creationTime: undefined, icpVariance: undefined, scanMatchRegion: undefined, waypointSource: 0, }; } export const Waypoint_Annotations = { encode( message: Waypoint_Annotations, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.name !== "") { writer.uint32(10).string(message.name); } if (message.creationTime !== undefined) { Timestamp.encode( toTimestamp(message.creationTime), writer.uint32(34).fork() ).ldelim(); } if (message.icpVariance !== undefined) { SE3Covariance.encode( message.icpVariance, writer.uint32(18).fork() ).ldelim(); } if (message.scanMatchRegion !== undefined) { 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: _m0.Reader | Uint8Array, length?: number ): Waypoint_Annotations { const reader = input instanceof _m0.Reader ? input : new _m0.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.decode(reader, reader.uint32()) ); break; case 2: message.icpVariance = SE3Covariance.decode(reader, reader.uint32()); break; case 3: message.scanMatchRegion = Waypoint_Annotations_LocalizeRegion.decode( reader, reader.uint32() ); break; case 5: message.waypointSource = reader.int32() as any; break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): Waypoint_Annotations { return { name: isSet(object.name) ? String(object.name) : "", creationTime: isSet(object.creationTime) ? fromJsonTimestamp(object.creationTime) : undefined, icpVariance: isSet(object.icpVariance) ? SE3Covariance.fromJSON(object.icpVariance) : undefined, scanMatchRegion: isSet(object.scanMatchRegion) ? Waypoint_Annotations_LocalizeRegion.fromJSON(object.scanMatchRegion) : undefined, waypointSource: isSet(object.waypointSource) ? waypoint_WaypointSourceFromJSON(object.waypointSource) : 0, }; }, toJSON(message: Waypoint_Annotations): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); message.creationTime !== undefined && (obj.creationTime = message.creationTime.toISOString()); message.icpVariance !== undefined && (obj.icpVariance = message.icpVariance ? SE3Covariance.toJSON(message.icpVariance) : undefined); message.scanMatchRegion !== undefined && (obj.scanMatchRegion = message.scanMatchRegion ? Waypoint_Annotations_LocalizeRegion.toJSON(message.scanMatchRegion) : undefined); message.waypointSource !== undefined && (obj.waypointSource = waypoint_WaypointSourceToJSON( message.waypointSource )); return obj; }, fromPartial<I extends Exact<DeepPartial<Waypoint_Annotations>, I>>( object: I ): Waypoint_Annotations { const message = createBaseWaypoint_Annotations(); message.name = object.name ?? ""; message.creationTime = object.creationTime ?? undefined; message.icpVariance = object.icpVariance !== undefined && object.icpVariance !== null ? SE3Covariance.fromPartial(object.icpVariance) : undefined; message.scanMatchRegion = object.scanMatchRegion !== undefined && object.scanMatchRegion !== null ? Waypoint_Annotations_LocalizeRegion.fromPartial( object.scanMatchRegion ) : undefined; message.waypointSource = object.waypointSource ?? 0; return message; }, }; function createBaseWaypoint_Annotations_LocalizeRegion(): Waypoint_Annotations_LocalizeRegion { return { state: 0, defaultRegion: undefined, empty: undefined, circle: undefined, }; } export const Waypoint_Annotations_LocalizeRegion = { encode( message: Waypoint_Annotations_LocalizeRegion, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.state !== 0) { writer.uint32(8).int32(message.state); } if (message.defaultRegion !== undefined) { Waypoint_Annotations_LocalizeRegion_Default.encode( message.defaultRegion, writer.uint32(18).fork() ).ldelim(); } if (message.empty !== undefined) { Waypoint_Annotations_LocalizeRegion_Empty.encode( message.empty, writer.uint32(26).fork() ).ldelim(); } if (message.circle !== undefined) { Waypoint_Annotations_LocalizeRegion_Circle2D.encode( message.circle, writer.uint32(34).fork() ).ldelim(); } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number ): Waypoint_Annotations_LocalizeRegion { const reader = input instanceof _m0.Reader ? input : new _m0.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() as any; break; case 2: message.defaultRegion = Waypoint_Annotations_LocalizeRegion_Default.decode( reader, reader.uint32() ); break; case 3: message.empty = Waypoint_Annotations_LocalizeRegion_Empty.decode( reader, reader.uint32() ); break; case 4: message.circle = Waypoint_Annotations_LocalizeRegion_Circle2D.decode( reader, reader.uint32() ); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): Waypoint_Annotations_LocalizeRegion { return { state: isSet(object.state) ? annotationStateFromJSON(object.state) : 0, defaultRegion: isSet(object.defaultRegion) ? Waypoint_Annotations_LocalizeRegion_Default.fromJSON( object.defaultRegion ) : undefined, empty: isSet(object.empty) ? Waypoint_Annotations_LocalizeRegion_Empty.fromJSON(object.empty) : undefined, circle: isSet(object.circle) ? Waypoint_Annotations_LocalizeRegion_Circle2D.fromJSON(object.circle) : undefined, }; }, toJSON(message: Waypoint_Annotations_LocalizeRegion): unknown { const obj: any = {}; message.state !== undefined && (obj.state = annotationStateToJSON(message.state)); message.defaultRegion !== undefined && (obj.defaultRegion = message.defaultRegion ? Waypoint_Annotations_LocalizeRegion_Default.toJSON( message.defaultRegion ) : undefined); message.empty !== undefined && (obj.empty = message.empty ? Waypoint_Annotations_LocalizeRegion_Empty.toJSON(message.empty) : undefined); message.circle !== undefined && (obj.circle = message.circle ? Waypoint_Annotations_LocalizeRegion_Circle2D.toJSON(message.circle) : undefined); return obj; }, fromPartial< I extends Exact<DeepPartial<Waypoint_Annotations_LocalizeRegion>, I> >(object: I): Waypoint_Annotations_LocalizeRegion { const message = createBaseWaypoint_Annotations_LocalizeRegion(); message.state = object.state ?? 0; message.defaultRegion = object.defaultRegion !== undefined && object.defaultRegion !== null ? Waypoint_Annotations_LocalizeRegion_Default.fromPartial( object.defaultRegion ) : undefined; message.empty = object.empty !== undefined && object.empty !== null ? Waypoint_Annotations_LocalizeRegion_Empty.fromPartial(object.empty) : undefined; message.circle = object.circle !== undefined && object.circle !== null ? Waypoint_Annotations_LocalizeRegion_Circle2D.fromPartial( object.circle ) : undefined; return message; }, }; function createBaseWaypoint_Annotations_LocalizeRegion_Default(): Waypoint_Annotations_LocalizeRegion_Default { return {}; } export const Waypoint_Annotations_LocalizeRegion_Default = { encode( _: Waypoint_Annotations_LocalizeRegion_Default, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number ): Waypoint_Annotations_LocalizeRegion_Default { const reader = input instanceof _m0.Reader ? input : new _m0.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(_: any): Waypoint_Annotations_LocalizeRegion_Default { return {}; }, toJSON(_: Waypoint_Annotations_LocalizeRegion_Default): unknown { const obj: any = {}; return obj; }, fromPartial< I extends Exact<DeepPartial<Waypoint_Annotations_LocalizeRegion_Default>, I> >(_: I): Waypoint_Annotations_LocalizeRegion_Default { const message = createBaseWaypoint_Annotations_LocalizeRegion_Default(); return message; }, }; function createBaseWaypoint_Annotations_LocalizeRegion_Empty(): Waypoint_Annotations_LocalizeRegion_Empty { return {}; } export const Waypoint_Annotations_LocalizeRegion_Empty = { encode( _: Waypoint_Annotations_LocalizeRegion_Empty, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number ): Waypoint_Annotations_LocalizeRegion_Empty { const reader = input instanceof _m0.Reader ? input : new _m0.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(_: any): Waypoint_Annotations_LocalizeRegion_Empty { return {}; }, toJSON(_: Waypoint_Annotations_LocalizeRegion_Empty): unknown { const obj: any = {}; return obj; }, fromPartial< I extends Exact<DeepPartial<Waypoint_Annotations_LocalizeRegion_Empty>, I> >(_: I): Waypoint_Annotations_LocalizeRegion_Empty { const message = createBaseWaypoint_Annotations_LocalizeRegion_Empty(); return message; }, }; function createBaseWaypoint_Annotations_LocalizeRegion_Circle2D(): Waypoint_Annotations_LocalizeRegion_Circle2D { return { dist2d: 0 }; } export const Waypoint_Annotations_LocalizeRegion_Circle2D = { encode( message: Waypoint_Annotations_LocalizeRegion_Circle2D, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.dist2d !== 0) { writer.uint32(9).double(message.dist2d); } return writer; }, decode( input: _m0.Reader | Uint8Array, length?: number ): Waypoint_Annotations_LocalizeRegion_Circle2D { const reader = input instanceof _m0.Reader ? input : new _m0.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: any): Waypoint_Annotations_LocalizeRegion_Circle2D { return { dist2d: isSet(object.dist2d) ? Number(object.dist2d) : 0, }; }, toJSON(message: Waypoint_Annotations_LocalizeRegion_Circle2D): unknown { const obj: any = {}; message.dist2d !== undefined && (obj.dist2d = message.dist2d); return obj; }, fromPartial< I extends Exact< DeepPartial<Waypoint_Annotations_LocalizeRegion_Circle2D>, I > >(object: I): Waypoint_Annotations_LocalizeRegion_Circle2D { const message = createBaseWaypoint_Annotations_LocalizeRegion_Circle2D(); message.dist2d = object.dist2d ?? 0; return message; }, }; function createBaseWaypointSnapshot(): WaypointSnapshot { return { id: "", images: [], pointCloud: undefined, objects: [], robotState: undefined, robotLocalGrids: [], isPointCloudProcessed: false, versionId: "", hasRemotePointCloudSensor: false, bodyTformRemotePointCloudSensor: undefined, payloads: [], }; } export const WaypointSnapshot = { encode( message: WaypointSnapshot, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.id !== "") { writer.uint32(10).string(message.id); } for (const v of message.images) { ImageResponse.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.pointCloud !== undefined) { PointCloud.encode(message.pointCloud, writer.uint32(26).fork()).ldelim(); } for (const v of message.objects) { WorldObject.encode(v!, writer.uint32(34).fork()).ldelim(); } if (message.robotState !== undefined) { RobotState.encode(message.robotState, writer.uint32(42).fork()).ldelim(); } for (const v of message.robotLocalGrids) { 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) { SE3Pose.encode( message.bodyTformRemotePointCloudSensor, writer.uint32(90).fork() ).ldelim(); } for (const v of message.payloads) { Payload.encode(v!, writer.uint32(98).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): WaypointSnapshot { const reader = input instanceof _m0.Reader ? input : new _m0.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(ImageResponse.decode(reader, reader.uint32())); break; case 3: message.pointCloud = PointCloud.decode(reader, reader.uint32()); break; case 4: message.objects.push(WorldObject.decode(reader, reader.uint32())); break; case 5: message.robotState = RobotState.decode(reader, reader.uint32()); break; case 6: message.robotLocalGrids.push( 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 = SE3Pose.decode( reader, reader.uint32() ); break; case 12: message.payloads.push(Payload.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): WaypointSnapshot { return { id: isSet(object.id) ? String(object.id) : "", images: Array.isArray(object?.images) ? object.images.map((e: any) => ImageResponse.fromJSON(e)) : [], pointCloud: isSet(object.pointCloud) ? PointCloud.fromJSON(object.pointCloud) : undefined, objects: Array.isArray(object?.objects) ? object.objects.map((e: any) => WorldObject.fromJSON(e)) : [], robotState: isSet(object.robotState) ? RobotState.fromJSON(object.robotState) : undefined, robotLocalGrids: Array.isArray(object?.robotLocalGrids) ? object.robotLocalGrids.map((e: any) => 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 ) ? SE3Pose.fromJSON(object.bodyTformRemotePointCloudSensor) : undefined, payloads: Array.isArray(object?.payloads) ? object.payloads.map((e: any) => Payload.fromJSON(e)) : [], }; }, toJSON(message: WaypointSnapshot): unknown { const obj: any = {}; message.id !== undefined && (obj.id = message.id); if (message.images) { obj.images = message.images.map((e) => e ? ImageResponse.toJSON(e) : undefined ); } else { obj.images = []; } message.pointCloud !== undefined && (obj.pointCloud = message.pointCloud ? PointCloud.toJSON(message.pointCloud) : undefined); if (message.objects) { obj.objects = message.objects.map((e) => e ? WorldObject.toJSON(e) : undefined ); } else { obj.objects = []; } message.robotState !== undefined && (obj.robotState = message.robotState ? RobotState.toJSON(message.robotState) : undefined); if (message.robotLocalGrids) { obj.robotLocalGrids = message.robotLocalGrids.map((e) => e ? 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 ? SE3Pose.toJSON(message.bodyTformRemotePointCloudSensor) : undefined); if (message.payloads) { obj.payloads = message.payloads.map((e) => e ? Payload.toJSON(e) : undefined ); } else { obj.payloads = []; } return obj; }, fromPartial<I extends Exact<DeepPartial<WaypointSnapshot>, I>>( object: I ): WaypointSnapshot { const message = createBaseWaypointSnapshot(); message.id = object.id ?? ""; message.images = object.images?.map((e) => ImageResponse.fromPartial(e)) || []; message.pointCloud = object.pointCloud !== undefined && object.pointCloud !== null ? PointCloud.fromPartial(object.pointCloud) : undefined; message.objects = object.objects?.map((e) => WorldObject.fromPartial(e)) || []; message.robotState = object.robotState !== undefined && object.robotState !== null ? RobotState.fromPartial(object.robotState) : undefined; message.robotLocalGrids = object.robotLocalGrids?.map((e) => 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 ? SE3Pose.fromPartial(object.bodyTformRemotePointCloudSensor) : undefined; message.payloads = object.payloads?.map((e) => Payload.fromPartial(e)) || []; return message; }, }; function createBaseEdge(): Edge { return { id: undefined, snapshotId: "", fromTformTo: undefined, annotations: undefined, }; } export const Edge = { encode(message: Edge, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.id !== undefined) { Edge_Id.encode(message.id, writer.uint32(10).fork()).ldelim(); } if (message.snapshotId !== "") { writer.uint32(18).string(message.snapshotId); } if (message.fromTformTo !== undefined) { SE3Pose.encode(message.fromTformTo, writer.uint32(26).fork()).ldelim(); } if (message.annotations !== undefined) { Edge_Annotations.encode( message.annotations, writer.uint32(34).fork() ).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Edge { const reader = input instanceof _m0.Reader ? input : new _m0.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 = Edge_Id.decode(reader, reader.uint32()); break; case 2: message.snapshotId = reader.string(); break; case 3: message.fromTformTo = SE3Pose.decode(reader, reader.uint32()); break; case 4: message.annotations = Edge_Annotations.decode( reader, reader.uint32() ); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object: any): Edge { return { id: isSet(object.id) ? Edge_Id.fromJSON(object.id) : undefined, snapshotId: isSet(object.snapshotId) ? String(object.snapshotId) : "", fromTformTo: isSet(object.fromTformTo) ? SE3Pose.fromJSON(object.fromTformTo) : undefined, annotations: isSet(object.annotations) ? Edge_Annotations.fromJSON(object.annotations) : undefined, }; }, toJSON(message: Edge): unknown { const obj: any = {}; message.id !== undefined && (obj.id = message.id ? Edge_Id.toJSON(message.id) : undefined); message.snapshotId !== undefined && (obj.snapshotId = message.snapshotId); message.fromTformTo !== undefined && (obj.fromTformTo = message.fromTformTo ? SE3Pose.toJSON(message.fromTformTo) : undefined); message.annotations !== undefined && (obj.annotations = message.annotations ? Edge_Annotations.toJSON(message.annotations) : undefined); return obj; }, fromPartial<I extends Exact<DeepPartial<Edge>, I>>(object: I): Edge { const message = createBaseEdge(); message.id = object.id !== undefined && object.id !== null ? Edge_Id.fromPartial(object.id) : undefined; message.snapshotId = object.snapshotId ?? ""; message.fromTformTo = object.fromTformTo !== undefined && object.fromTformTo !== null ? SE3Pose.fromPartial(object.fromTformTo) : undefined; message.annotations = object.annotations !== undefined && object.annotations !== null ? Edge_Annotations.fromPartial(object.annotations) : undefined; return message; }, }; function createBaseEdge_Id(): Edge_Id { return { fromWaypoint: "", toWaypoint: "" }; } export const Edge_Id = { encode( message: Edge_Id, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if (message.fromWaypoint !== "") { writer.uint32(10).string(message.fromWaypoint); } if (message.toWaypoint !== "") { writer.uint32(18).string(message.toWaypoint); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): Edge_Id { const reader = input instanceof _m0.Reader ? input : new _m0.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: any): Edge_Id { return { fromWaypoint: isSet(object.fromWaypoint) ? String(object.fromWaypoint) : "", toWaypoint: isSet(object.toWaypoint) ? String(object.toWaypoint) : "", }; }, toJSON(message: Edge_Id): unknown { const obj: any = {}; message.fromWaypoint !== undefined && (obj.fromWaypoint = message.fromWaypoint); message.toWaypoint !== undefined && (obj.toWaypoint = message.toWaypoint); return obj; }, fromPartial<I extends Exact<DeepPartial<Edge_Id>, I>>(object: I): Edge_Id { const message = createBaseEdge_Id(); message.fromWaypoint = object.fromWaypoint ?? ""; message.toWaypoint = object.toWaypoint ?? ""; return message; }, }; function createBaseEdge_Annotations(): Edge_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, }; } export const Edge_Annotations = { encode( message: Edge_Annotations, writer: _m0.Writer = _m0.Writer.create() ): _m0.Writer { if