Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
OLO Documentation v2.0.0
OLO Robotics OLO Robotics
v2.0.0 alpha 2

Start here

  • Getting Started
  • OLO Platform
  • OLO Appliance
  • ROS 2 Concepts for OLO

SDK v2

  • Quickstart
  • Robot Namespaces
  • API Reference
    • Client
    • Core
    • Spatial
    • Kinematics
    • Locomotion
    • Navigation
    • Vision
    • AI
    • Local archive
    • Platform
    • Errors
    • TypeScript API
      • olo
      • olo/core
      • olo/spatial
      • olo/kinematics
      • olo/locomotion
      • olo/navigation
      • olo/vision
      • olo/ai
      • olo/archive
      • olo/platform
      • olo
      • Class: Client
      • Class: OloAmbiguousNamespace
      • Class: OloAmbiguousPlanningGroup
      • Class: OloError
      • Class: OloFailedPrecondition
      • Class: OloInternalError
      • Class: OloInvalidArgument
      • Class: OloNotFound
      • Class: OloPermissionDenied
      • Class: OloPlatformNotConfigured
      • Class: OloTimeoutError
      • Class: OloUnauthenticated
      • Class: OloUnavailable
      • Class: Robot
      • Interface: BagSummary
      • Interface: BagTopicInfo
      • Interface: CaptureImageResult
      • Interface: ClientOptions
      • Interface: ImageSummary
      • Interface: StopBagPlaybackResult
      • Interface: StopBagRecordingResult
      • Interface: StopVideoCaptureResult
      • Interface: VideoSummary
      • Variable: DEFAULT_MAX_MESSAGE_BYTES
      • Variable: DEFAULT_TARGET
      • Variable: ENV_MAX_MESSAGE_BYTES
      • Variable: ENV_TARGET
      • Class: Core
      • Class: CoreHandle
      • Class: Publisher
      • Class: RobotNamespaces
      • Class: Subscription
      • Function: compressedImageToMessage()
      • Function: compressedMessageToFrame()
      • Function: imageMessageToFrame()
      • Function: imageToMessage()
      • Function: normalizeRobotNamespace()
      • Interface: CallOptions
      • Interface: Image
      • Interface: ServiceInfo
      • Interface: TopicInfo
      • Type Alias: RosMessage
      • Type Alias: RosServiceMessage
      • Class: FrameTree
      • Class: FrameTreeNode
      • Class: Point
      • Class: Pose
      • Class: Quaternion
      • Class: RobotFrames
      • Class: Spatial
      • Class: Transform
      • Class: TransformSubscription
      • Class: TreeSubscription
      • Class: Twist
      • Class: Vector
      • Function: wrapError()
      • Interface: FrameInfo
      • Interface: LookupTransformOptions
      • Interface: PublishStaticTransformOptions
      • Interface: SubscribeTransformOptions
      • Interface: TransformInit
      • Interface: TreeDelta
      • Interface: TreeOptions
      • Type Alias: Matrix
      • Class: EndEffector
      • Class: Gripper
      • Class: JointStates
      • Class: JointTarget
      • Class: Kinematics
      • Class: KinematicsHandle
      • Class: KinematicsState
      • Class: PlanResult
      • Class: RobotModel
      • Class: Trajectory
      • Class: TrajectoryPoint
      • Enumeration: Activity
      • Enumeration: EndEffectorType
      • Enumeration: JointType
      • Function: groupState()
      • Interface: CommandEndEffectorOptions
      • Interface: EndEffectorInit
      • Interface: ExecuteTrajectoryOptions
      • Interface: GetPoseOptions
      • Interface: GripperCommandOptions
      • Interface: GripperInfo
      • Interface: GripperResult
      • Interface: GroupState
      • Interface: JointInfo
      • Interface: JointStatesInit
      • Interface: MoveJointsOptions
      • Interface: MoveLinearOptions
      • Interface: MovePoseOptions
      • Interface: MoveSequenceOptions
      • Interface: PlanJointsOptions
      • Interface: PlanLinearOptions
      • Interface: PlanOptionsBase
      • Interface: PlanPoseOptions
      • Interface: PlanSequenceOptions
      • Interface: PlanningGroup
      • Interface: RobotModelInit
      • Interface: TrajectoryInit
      • Interface: TrajectoryPointInit
      • Type Alias: MoveResult
      • Class: Locomotion
      • Class: LocomotionHandle
      • Enumeration: LocomotionOutcome
      • Interface: AppliedVelocity
      • Interface: LocomotionFeedback
      • Interface: LocomotionResult
      • Interface: MoveOptions
      • Interface: PlanarMotion
      • Interface: SendVelocityOptions
      • Interface: StopOptions
      • Type Alias: LocomotionEvent
      • Class: Navigation
      • Class: NavigationGoal
      • Class: NavigationHandle
      • Class: NavigationState
      • Class: OccupancyGrid
      • Enumeration: Activity
      • Enumeration: Availability
      • Enumeration: Nav2ErrorCode
      • Enumeration: NavigationOutcome
      • Function: nav2ErrorCodeName()
      • Interface: CheckReachabilityOptions
      • Interface: GetMapOptions
      • Interface: NavigateToOptions
      • Interface: NavigationFeedback
      • Interface: NavigationResult
      • Interface: ReachabilityResult
      • Interface: SendNavigationGoalOptions
      • Type Alias: NavigationEvent
      • Class: BoundingBox
      • Function: cameraInfoToIntrinsics()
      • Function: deproject()
      • Function: deprojectPixel()
      • Function: deprojectPoint()
      • Function: deprojectRegion()
      • Function: deprojectToFrame()
      • Function: pixelAlignmentError()
      • Function: positionError()
      • Function: project()
      • Function: projectPoint()
      • Function: sampleDepth()
      • Function: sampleDepthPoint()
      • Function: sampleDepthRegion()
      • Interface: AlignmentError
      • Interface: CameraIntrinsics
      • Interface: Pixel
      • Interface: PointObservation
      • Interface: PositionError
      • Interface: SampleDepthOptions
      • Interface: SampleDepthRegionOptions
      • Class: Ai
      • Class: Model
      • Class: YoloDetector
      • Function: decodeYolox()
      • Function: imageToTensor()
      • Function: letterbox()
      • Function: nms()
      • Function: resizeBilinear()
      • Function: softmax()
      • Function: tensor()
      • Function: tensorFromProto()
      • Function: tensorToProto()
      • Interface: DetectOptions
      • Interface: Detection
      • Interface: ImageToTensorOptions
      • Interface: InferOptions
      • Interface: LetterboxResult
      • Interface: ModelInfo
      • Interface: RawPixels
      • Interface: Tensor
      • Interface: TensorInfo
      • Interface: YoloDetectorOptions
      • Type Alias: DataType
      • Type Alias: TensorData
      • Variable: COCO_LABELS
      • Variable: DataType
      • Class: Archive
      • Class: ArchiveHandle
      • Class: BagSession
      • Class: PlaybackSession
      • Class: VideoSession
      • Interface: BagInfo
      • Interface: CaptureImageOptions
      • Interface: CaptureVideoOptions
      • Interface: PlayBagOptions
      • Interface: RecordBagOptions
      • Type Alias: BagSessionTerminalEvent
      • Class: Platform
      • Class: PlatformArchive
      • Class: PlatformNavigation
      • Interface: BagInfo
      • Interface: ImageCatalogInfo
      • Interface: MapInfo
      • Interface: NavConfigInfo
      • Interface: NavigationDeploymentInfo
      • Interface: NavigationDesiredSpec
      • Interface: NavigationObservedStatus
      • Interface: PlatformOptions
      • Interface: Pose2D
      • Interface: SaveMapOptions
      • Interface: StartNavigationDeploymentOptions
      • Interface: VideoCatalogInfo
      • Function: resolveRobotId()
      • Type Alias: CatalogLocation
      • Type Alias: NamespaceResolver
      • Type Alias: NavConfigSource
      • Type Alias: NavigationDesiredState
      • Type Alias: NavigationMode
      • Type Alias: NavigationObservedState
      • Variable: ENV_PLATFORM_TOKEN
      • Variable: ENV_PLATFORM_URL
      • Variable: ENV_ROBOT_ID

Examples

  • Core
    • Topic listing and robot namespaces
    • Publishing messages
    • Subscribing to messages
    • Service discovery and invocation
  • Spatial
    • Individual transform lookup
    • Transform tree inspection
    • Spatial Type Construction
    • Composition and Inverses
  • Kinematics
    • Robot model, joints, and pose
    • Move to joint targets
    • Move to end-effector poses
    • Move along linear paths
    • Trajectory speed scaling
    • Plan with multiple groups
    • Gripper operations
  • Locomotion
    • Local locomotion
    • Velocity streaming
  • Navigation
    • Simple navigation
    • Localization with a saved map
    • Inspect the map and navigate to a reachable goal
  • Vision
    • Depth camera helpers
    • Point tracking pick loop
  • AI
    • Object detection
    • Streaming RGB detection
    • Streaming RGB-D detection
  • Archive
    • Local image and video archive
    • Local rosbag recording
    • Cloud archive catalog

Previous SDK

  • Migrate from SDK v1
  • SDK v1 Archive
Back to top
View this page

Navigation¶

Autonomous navigation and mapping.

Note

robot.navigation does not launch or tear down Nav2 — it only sends goals and queries the live stack. Start and stop the engine with client.platform.navigation.start / stop (see Simple navigation and Platform). Call robot.navigation.state() to probe NavigateToPose readiness after the deployment reports ready. Operations report typed errors when their runtime dependencies are unavailable.

"""SLAM navigation example — saves example-map for navigation-localization."""

import math
import time

from olo import Client
from olo.locomotion import PlanarMotion
from olo.navigation import Nav2ErrorCode, NavigationFeedback
from olo.platform import NavigationMode, NavigationObservedState
from olo.spatial import Pose

EXAMPLE_MAP_NAME = "example-map"


def on_feedback(feedback: NavigationFeedback) -> None:
    # Do something with the feedback
    pass


with Client() as client:
    configs = client.platform.navigation.get_configs(NavigationMode.SLAM)
    if not configs:
        raise RuntimeError("No navigation configs support SLAM mode")
    config = configs[0]
    print(f"Using navigation config: {config.name = }, {config.id = }")

    # Start navigation engine (namespace resolves like client.robot())
    client.platform.navigation.start(mode=NavigationMode.SLAM, config_id=config.id)
    last_state = None
    deadline = time.time() + 60
    while time.time() < deadline:
        info = client.platform.navigation.deployment()
        state = info.observed.state if info.observed else None
        if state != last_state:
            print(f"Navigation engine: {state}")
            last_state = state
        if state == NavigationObservedState.READY:
            break
        if state == NavigationObservedState.FAILED:
            raise RuntimeError(f"Navigation failed to launch: {info.observed.error_message}")
        time.sleep(2)
    else:
        raise TimeoutError(f"Navigation engine did not become ready within 60s (last state: {last_state})")

    # Move the robot to build a map
    robot = client.robot()
    robot.locomotion.move(PlanarMotion(x=1.0, yaw=2 * math.pi))

    # Once the map has some substance, send the robot a pose goal
    target = Pose.from_xy_yaw(1.5, 0.5, 1.5708)
    result = robot.navigation.navigate_to(target, on_feedback=on_feedback)
    print(f"Navigation outcome: {result.outcome.value} ({result.reason})")
    if result.nav2_error_code:
        print(f"Error: {Nav2ErrorCode.name_for(result.nav2_error_code)}")

    # Persist the SLAM map for reuse
    saved = client.platform.navigation.save_map(EXAMPLE_MAP_NAME)
    print(f"Saved map: {saved.name} [{saved.id}]")
/** SLAM navigation example — saves `example-map` for navigation-localization.ts. */

import { connect } from "olo/web";
import { nav2ErrorCodeName, type NavigationFeedback } from "olo/navigation";
import { Pose } from "olo/spatial";

const EXAMPLE_MAP_NAME = "example-map";

function onFeedback(_feedback: NavigationFeedback): void {
  // Do something with the feedback
}

const client = connect();

const configs = await client.platform.navigation.getConfigs("slam");
if (configs.length === 0) {
  throw new Error("No navigation configs support SLAM mode");
}
const config = configs[0];
console.log(`Using navigation config: name=${config.name}, id=${config.id}`);

// Start navigation engine (namespace resolves like client.robot())
await client.platform.navigation.start({
  mode: "slam",
  configId: config.id,
});
let lastState: string | undefined;
const deadline = Date.now() + 60_000;
while (Date.now() < deadline) {
  const info = await client.platform.navigation.deployment();
  const state = info.observed?.state;
  if (state !== lastState) {
    console.log(`Navigation engine: ${state}`);
    lastState = state;
  }
  if (state === "ready") break;
  if (state === "failed") {
    throw new Error(`Navigation failed to launch: ${info.observed?.errorMessage}`);
  }
  await new Promise((r) => setTimeout(r, 2000));
}
if (lastState !== "ready") {
  throw new Error(`Navigation engine did not become ready within 60s (last state: ${lastState})`);
}

// Move the robot to build a map
const robot = await client.robot();
await robot.locomotion.move({ x: 1.0, y: 0, yaw: 2 * Math.PI });

// Once the map has some substance, send the robot a pose goal
const target = Pose.fromXyYaw(1.5, 0.5, 1.5708);
const result = await robot.navigation.navigateTo(target, { onFeedback });
console.log(`Navigation outcome: ${result.outcome} (${result.reason})`);
if (result.nav2ErrorCode) {
  console.log(`Error: ${nav2ErrorCodeName(result.nav2ErrorCode)}`);
}

// Persist the SLAM map for reuse
const saved = await client.platform.navigation.saveMap(EXAMPLE_MAP_NAME);
console.log(`Saved map: ${saved.name} [${saved.id}]`);

Navigation wrapper over olo.navigation.v1.Navigation.

Client interfaces

class olo.navigation.Navigation[source]¶

Bases: object

Sync wrapper for the navigation gRPC service.

__init__(session)[source]¶

Bind to a channel session.

Return type:

None

cancel_all(robot_namespace='', *, timeout=10.0)[source]¶

Cancel all owned navigation goals for a namespace.

Return type:

tuple[str, ...]

Parameters:
  • robot_namespace (str)

  • timeout (float)

cancel_navigation(goal_id, *, timeout=10.0)[source]¶

Cancel one owned navigation goal.

Return type:

None

Parameters:
  • goal_id (str)

  • timeout (float)

check_reachability(goal, *, robot_namespace='', frame='map', start=None, use_start=False, planner_id='', timeout=10.0)[source]¶

Ask Nav2 whether a goal pose is planner-reachable.

Return type:

ReachabilityResult

Parameters:
  • goal (Pose)

  • robot_namespace (str)

  • frame (str)

  • start (Pose | None)

  • use_start (bool)

  • planner_id (str)

  • timeout (float)

get_map(robot_namespace='', *, topic='map', timeout=10.0)[source]¶

Fetch one occupancy-grid snapshot from the robot map topic.

Return type:

OccupancyGrid

Parameters:
  • robot_namespace (str)

  • topic (str)

  • timeout (float)

handle(namespace=None)[source]¶

Return a namespace-scoped navigation handle.

Return type:

NavigationHandle

Parameters:

namespace (str | None)

navigate_to(target, *, robot_namespace='', frame='map', navigation_timeout=120.0, on_feedback=None, timeout=10.0)[source]¶

Start navigation and wait for the terminal outcome.

Return type:

NavigationResult

Parameters:
  • target (Pose)

  • robot_namespace (str)

  • frame (str)

  • navigation_timeout (float)

  • on_feedback (Callable[[NavigationFeedback], None] | None)

  • timeout (float)

send_navigation_goal(target, *, robot_namespace='', frame='map', navigation_timeout=120.0, timeout=10.0)[source]¶

Send a NavigateToPose goal and return a goal handle.

Return type:

NavigationGoal

Parameters:
  • target (Pose)

  • robot_namespace (str)

  • frame (str)

  • navigation_timeout (float)

  • timeout (float)

state(robot_namespace='', *, timeout=10.0)[source]¶

Fetch a live navigation capability snapshot.

Return type:

NavigationState

Parameters:
  • robot_namespace (str)

  • timeout (float)

class olo.navigation.NavigationHandle[source]¶

Bases: object

Namespace-scoped handle for navigation behavior scripting.

__init__(client, namespace, session)[source]¶

Bind to a client, resolved namespace, and spatial frames.

Parameters:
  • client (Navigation)

  • namespace (str)

Return type:

None

cancel_all(*, timeout=10.0)[source]¶

Cancel all owned goals for this robot.

Return type:

tuple[str, ...]

Parameters:

timeout (float)

check_reachability(goal, *, frame='map', start=None, use_start=False, planner_id='', timeout=10.0)[source]¶

Ask Nav2 whether a goal pose is planner-reachable for this robot.

Return type:

ReachabilityResult

Parameters:
  • goal (Pose)

  • frame (str)

  • start (Pose | None)

  • use_start (bool)

  • planner_id (str)

  • timeout (float)

current_pose(*, timeout=10.0)[source]¶

Return the stamped map-to-base transform via spatial TF lookup.

Return type:

Transform

Parameters:

timeout (float)

get_map(*, topic='map', timeout=10.0)[source]¶

Fetch one occupancy-grid snapshot for this robot.

Return type:

OccupancyGrid

Parameters:
  • topic (str)

  • timeout (float)

navigate_to(target, *, frame='map', navigation_timeout=120.0, on_feedback=None, timeout=10.0)[source]¶

Start navigation and wait for completion.

Return type:

NavigationResult

Parameters:
  • target (Pose)

  • frame (str)

  • navigation_timeout (float)

  • on_feedback (Callable[[NavigationFeedback], None] | None)

  • timeout (float)

send_navigation_goal(target, *, frame='map', navigation_timeout=120.0, timeout=10.0)[source]¶

Send a NavigateToPose goal without waiting for completion.

Return type:

NavigationGoal

Parameters:
  • target (Pose)

  • frame (str)

  • navigation_timeout (float)

  • timeout (float)

state(*, timeout=10.0)[source]¶

Fetch a live capability snapshot for this robot.

Return type:

NavigationState

Parameters:

timeout (float)

class olo.navigation.NavigationGoal[source]¶

Bases: object

Handle for an accepted long-running navigation goal.

__init__(client, goal_id)[source]¶

Bind to a navigation client and server-generated goal id.

Parameters:
  • client (Navigation)

  • goal_id (str)

Return type:

None

cancel(*, timeout=10.0)[source]¶

Cancel this goal.

Return type:

None

Parameters:

timeout (float)

wait(*, on_feedback=None, timeout=None)[source]¶

Block until the goal reaches a terminal outcome.

Return type:

NavigationResult

Parameters:
  • on_feedback (Callable[[NavigationFeedback], None] | None)

  • timeout (float | None)

Types

class olo.navigation.NavigationState[source]¶

Bases: object

Capability snapshot for a robot namespace.

__init__(availability=Availability.UNSPECIFIED, activity=Activity.UNSPECIFIED, owned_goal_ids=(), reason='')¶
Parameters:
  • availability (Availability)

  • activity (Activity)

  • owned_goal_ids (tuple[str, ...])

  • reason (str)

Return type:

None

property ready: bool¶

Return whether NavigateToPose is ready.

class olo.navigation.NavigationFeedback[source]¶

Bases: object

Progress update for an active navigation goal.

__init__(distance_remaining=0.0, navigation_time=0.0, number_of_recoveries=0, current_pose=<factory>)¶
Parameters:
  • distance_remaining (float)

  • navigation_time (float)

  • number_of_recoveries (int)

  • current_pose (Pose)

Return type:

None

class olo.navigation.NavigationResult[source]¶

Bases: object

Terminal result for a navigation goal.

__init__(outcome=NavigationOutcome.UNSPECIFIED, reason='', nav2_error_code=0)¶
Parameters:
  • outcome (NavigationOutcome)

  • reason (str)

  • nav2_error_code (int)

Return type:

None

property nav2_error: Nav2ErrorCode | None¶

Return the Nav2 error code when present.

class olo.navigation.OccupancyGrid[source]¶

Bases: object

Decoded occupancy grid with map-frame metadata.

__init__(frame_id, resolution, width, height, origin, data, stamp=None)¶
Parameters:
  • frame_id (str)

  • resolution (float)

  • width (int)

  • height (int)

  • origin (Pose)

  • data (ndarray)

  • stamp (float | None)

Return type:

None

cell_to_world(cell_x, cell_y)[source]¶

Return the map-frame centre of a grid cell.

Return type:

tuple[float, float]

Parameters:
  • cell_x (int)

  • cell_y (int)

in_bounds(cell_x, cell_y)[source]¶

Return whether a grid cell lies inside the map.

Return type:

bool

Parameters:
  • cell_x (int)

  • cell_y (int)

is_free(cell_x, cell_y)[source]¶

Return whether a cell is known free space.

Return type:

bool

Parameters:
  • cell_x (int)

  • cell_y (int)

is_occupied(cell_x, cell_y)[source]¶

Return whether a cell is known occupied space.

Return type:

bool

Parameters:
  • cell_x (int)

  • cell_y (int)

is_unknown(cell_x, cell_y)[source]¶

Return whether a cell is unexplored.

Return type:

bool

Parameters:
  • cell_x (int)

  • cell_y (int)

pose_at(cell_x, cell_y, *, yaw=0.0)[source]¶

Return a map-frame pose at the centre of a grid cell.

Return type:

Pose

Parameters:
  • cell_x (int)

  • cell_y (int)

  • yaw (float)

value_at(cell_x, cell_y)[source]¶

Return the occupancy value for a grid cell.

Return type:

int

Parameters:
  • cell_x (int)

  • cell_y (int)

world_to_cell(x, y)[source]¶

Convert a map-frame world point to grid indices.

Return type:

tuple[int, int]

Parameters:
  • x (float)

  • y (float)

class olo.navigation.ReachabilityResult[source]¶

Bases: object

Planner-backed reachability for a map-frame goal.

__init__(reachable=False, planner_error_code=0, reason='', path_length=0.0)¶
Parameters:
  • reachable (bool)

  • planner_error_code (int)

  • reason (str)

  • path_length (float)

Return type:

None

Enums

class olo.navigation.Availability[source]¶

Bases: Enum

Whether NavigateToPose is available for a namespace.

class olo.navigation.Activity[source]¶

Bases: Enum

Whether this executor currently owns an active navigation goal.

class olo.navigation.NavigationOutcome[source]¶

Bases: Enum

Terminal outcome for a navigation goal.

Import from olo/navigation:

Client interfaces

  • Navigation — service wrapper with state, start, navigate, cancel, and handle().

  • NavigationHandle — namespace-scoped scripting surface, including currentPose() via spatial TF.

  • NavigationGoal — accepted goal with async result(), async iteration, and cancel().

Types

  • NavigationState

  • Availability

  • Activity

  • NavigationOutcome

  • OccupancyGrid

  • ReachabilityResult

Next
Vision
Previous
Locomotion
Copyright ©
Made with Sphinx and @pradyunsg's Furo