Skip to content

8. Following a route ​

path_follower_node walks the robot along a taught route, stops and dwells at its stop points, and reports its state on navigation/status.

8.1 From a recording to a route ​

Teaching records the localized pose every min_spacing_m (0.2 m). Loading the route then cleans it: duplicate points go, the route is resampled every processing.spacing (0.1 m) and smoothed between anchors that never move (the ends and the stop points). The smoothed points yi are the fixed point of the gradient smoother on the recording xi:

(8.1)α(xi−yi)+β(yi−1−2yi+yi+1)=0,α=wd(1−2ws),β=ws

solved at once as a tridiagonal system, with wd smooth_weight_data (0.05) and ws smooth_weight_smooth (0.4). A larger ws cuts the operator’s wobbles and the corners more. The node warns when a point moves more than max_deviation (0.3 m): the robot would leave the walkway that was taught.

8.2 The speed profile ​

Each point of the route gets a speed limit, computed once when the route loads:

  1. Curves: with κ the curvature, v≤alat/κ, clipped to [min_speed, cruise] (alat: lateral_accel).

  2. Stops: stop points and the end at approach_speed.

  3. Braking into them, backwards along the route: vi≤vi+12+2adecΔsi, and the reaction time of the braking model (Eq. (2.2)) before each stop.

  4. Accelerating out, forwards: vi+1≤vi2+2aaccΔsi.

Curve radius0.5 m1 m2 mstraight
Limit (alat 0.3 m/s2)0.39 m/s0.55 m/s0.77 m/scruise

The X30’s cruise is 0.4 m/s: only curves tighter than about 0.5 m slow it. accel and decel (0.3 m/s2) are comfort values, below the profile’s braking: the robot slows into a stop point gently, not at the field’s limit.

8.3 The path controllers ​

Every controller gets the robot’s pose, the route, its progress s along it, the speed of the profile and the path shift offset, and returns (vx,vy,ω). controller picks one; the X30 uses holonomic.

8.3.1 Holonomic (the X30’s) ​

A carrot is taken lookahead (0.6 m) ahead along the route. The robot walks toward it in its own frame at min(v,dcarrot), and turns toward the route’s direction over the next heading_lookahead:

\omega = k_\psi\, e_\psi,\qquad (v_x, v_y) = \min(v, d)\,\hat{\boldsymbol{u}}_{\text{carrot}}\cdot \max\bigl(\text{\verb|min_alignment_scale|},\ \cos e_\psi\bigr)\tag{8.2}

with kψ kp_yaw (1.5 1/s). The sideways part is capped at max_lateral_speed (above the X30’s Walk gait the envelope caps it again at max_vy), the backward part at max_reverse_speed. A longer lookahead cuts corners and sways less; a shorter one tracks tighter.

8.3.2 The others ​

  • pure_pursuit the arc through the carrot at lookahead L: with the carrot at (x,y) in the robot frame, κ=2y/(x2+y2) and ω=vκ.
  • stanley the route’s curvature as feedforward plus the cross-track error e and the heading error eψ: ω=vκroute−kh(eψ+arctan⁡kev+ks). ks keeps low speeds from over-steering.
  • pid PID on the heading error toward the carrot, the integral clamped at integral_limit and frozen while the output saturates (anti-windup).
  • lqr the path error e=(e,eψ) of a unicycle at speed v, discretized at the control period T: ek+1=(1vT01)ek+(0T)ωk. The gain K solves the discrete Riccati equation for Q=diag(qe,qψ) and rω (cached every 5 cm/s of speed); ω=vκroute−Ke.
  • mppi samples yaw-rate sequences drawn around the previous plan, each rolled out as a unicycle over horizon_steps; the cost is the distance to the route, the distance of the end to the carrot and obstacle_weight times the deepest intrusion into clearance. The sequences are averaged with the weights wj∝exp(−(Jj−Jmin)/λ), λ temperature.
  • neupan NeuPAN plans forward, sideways and yaw motion over a horizon straight from the scan’s points, with a network (DUNE) trained for the X30’s footprint. It avoids by itself; the guard and the field stay. It needs its own Python environment (tools/install_neupan.sh).

8.4 Stops, joining and dwelling ​

  • Joining a robot up to join.max_distance (3 m) from the route first walks onto it, within join.on_route.
  • Approach approach.radius before a stop point the follower leaves the controller and converges onto the exact pose: v=kxyexy, ω=kψeψ, capped at approach.max_speed and approach.max_yaw_rate and never below approach.min_speed (the X30’s slowest step). It arrives within position_tolerance (5 cm) and yaw_tolerance_deg (3°); a stop the robot passed by more than skip_margin counts as skipped.
  • Dwelling at the stop the inspection runs (hooks.inspection); the follower waits for it up to the dwell plus hooks.inspection_timeout_sec (180 s on the X30, above the inspection’s own 150 s per point).
  • Battery below low_battery the lap finishes and no new one starts; below critical_battery the robot pauses.

8.5 Smoothness ​

The command passes a last stage before it leaves: the profile’s envelope, a smoothing of the yaw rate and the sideways speed, ω←wωnew+(1−w)ω with w speed.smoothing (0.5; 1: off), and the acceleration limits. A robot that weaves on a straight needs a lower w or a longer lookahead; one that lags in curves, the opposite.

8.6 The supervisor ​

SettingEffect
tf_timeout_sec, scan_timeout_secan older pose or safety scan stops the robot
off_path_slow, off_path_stopfarther from the route than 0.6 m: the floor speed; than 1.5 m: OFF_PATH, stopped
blocked_timeout_secstanding still (moved less than stall_distance and turned less than stall_yaw_deg) for 10 s: BLOCKED, reported to NETRA
lateral_margin, human_speed, pass_margin, yaw_margin_degthe guard’s model; at least the protective field’s values, checked at start against control_node