Skip to content

Navigation

The navigation module provides high-level movement primitives for the 3we platform. Commands work identically in simulation and on hardware, with the planner automatically handling obstacle avoidance, path smoothing, and mecanum wheel kinematics.

Navigate to a goal pose in the world frame. The planner computes a collision-free path using the latest LiDAR data and executes it.

await robot.move_to(x=2.0, y=1.5, theta=0.0)

Parameters:

ParameterTypeDefaultDescription
xfloatrequiredGoal X position in meters.
yfloatrequiredGoal Y position in meters.
thetafloatNoneGoal heading in radians. If None, final heading is unconstrained.
timeoutfloat30.0Maximum seconds to attempt reaching the goal.
tolerancefloat0.05Position tolerance in meters.

Returns: MoveResult with fields success, final_pose, duration, distance_traveled.

Drive straight ahead relative to the current heading.

await robot.move_forward(0.5) # move 50 cm forward

Rotate in place by the given angle.

import math
await robot.rotate(math.pi / 2) # turn 90 degrees counter-clockwise

Execute a sequence of waypoints without stopping between them.

path = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)]
result = await robot.follow_path(path)

Parameters:

ParameterTypeDefaultDescription
waypointslist[tuple]requiredList of (x, y) or (x, y, theta) tuples.
speedfloat0.3Target speed along the path (m/s).
lookaheadfloat0.2Pure-pursuit lookahead distance (meters).

Autonomously explore the environment using a frontier-based strategy. Useful for map building.

await robot.explore(duration=120.0) # explore for 2 minutes
occupancy_grid = robot.get_map()

Parameters:

ParameterTypeDefaultDescription
durationfloat60.0Maximum exploration time in seconds.
strategystr"frontier"Exploration algorithm: "frontier", "random", "coverage".

For direct velocity control (e.g., teleoperation or custom controllers):

# Holonomic velocity: vx (forward), vy (strafe), omega (rotation)
robot.set_velocity(vx=0.2, vy=0.0, omega=0.1)

Call robot.stop() to halt all motion immediately.

Obstacle avoidance is enabled by default for all high-level commands. Configure it with:

robot.navigation.set_avoidance(
enabled=True,
safety_margin=0.15, # meters from obstacle
reactive=True # enable reactive dodge maneuvers
)

After exploration or during navigation, access the built map:

grid = robot.get_map()
# OccupancyGrid with .data (numpy array), .resolution, .origin