Generated reference › Pure Pursuit Steering — Robotics/Trajectory Generation
kind: generated#block#robotics-trajectory-generation

Pure Pursuit Steering — Robotics/Trajectory Generation

Robotics/Trajectory_Generation/Pure_Pursuit_Steering · 1 input / 2 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Description#

The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.

Pure Pursuit Steering

Robotics / Trajectory Generation

The classic path-tracking law: aim the vehicle at a point on the path a fixed lookahead distance ahead of it, and steer along the circular arc that reaches it.

  1. Project the pose onto every segment of the waypoint path and keep the nearest.
  2. Walk Ld forward along the path from there – that is the goal point.
  3. κ = 2·ylocal / Ld², where ylocal is the goal's lateral offset in the vehicle frame.
  4. δ = atan(L·κ) for a vehicle of wheelbase L.

The lookahead is the whole tuning: short tracks corners tightly and oscillates, long is smooth and cuts them.

Ports

  • pose – the vehicle pose (x, y, θ) as a [3,1] column, per the family's SE(2) convention. θ is in radians, measured counter-clockwise from +x, and is used raw – wrapping is Angle Wrap's job and sin/cos do not care.
  • kappa – the commanded path curvature (1/m), a scalar. Positive is a left turn, matching the counter-clockwise convention.
  • delta – the commanded steering angle (rad), a scalar, for the configured wheelbase.

Parameters

  • Waypoints – the path as an [N,2] matrix of (x, y) rows, N ≥ 2. Consecutive duplicate points are rejected rather than skipped, since a zero-length segment has no direction. The path is open: it is not closed back to the first point.
  • Lookahead Distance (m)Ld, positive.
  • Wheelbase (m)L, positive; used only for the delta output.
  • Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.

Code export

All ten targets: Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog and PLC Structured Text. The whole path is baked in as constants and the segment search is fully unrolled, so no target performs a data-dependent array index. The waypoints are therefore not retunable on the generated core – re-export to change a route.

No square root is taken at run time in any target. The textbook implementation intersects a circle of radius Ld with the path, which needs one root per segment; this block works in arc length instead, with every segment length and reciprocal computed once at export. The nearest-segment search compares squared distances for the same reason.

The three HDL targets are nonetheless simulation-only: the pose must be rotated into the vehicle frame (a sine and a cosine of the heading every sample) and delta is an arctangent. The kappa path on its own would have been synthesizable.

Simulink bridge

No equivalent (Support::None). Simulink's Pure Pursuit block ships in the Robotics System Toolbox, which is not installed on this machine (measured). Note its interface differs in any case: it takes the waypoints on a port and returns a linear and an angular velocity, where this block takes the path as configuration and returns the geometry – curvature and steering angle – leaving the speed policy to the model.

Notes

  • Algebraic, stateless and memoryless. The goal point is recomputed from scratch every sample, so the block cannot get stuck on a stale segment – and equally, it does not remember progress: a path that crosses itself is tracked by whichever branch is nearer.
  • The end of the path is a clamp, and it is a convention. When the lookahead runs past the final waypoint the goal stays at that waypoint, so the vehicle steers toward the end and the curvature falls away as it arrives. Because Ld in the denominator stays at its configured value while the goal is nearer than that, the command there is conservative – it under-steers slightly rather than over-steering into the last point.
  • There is no "no intersection" case to fall back from, unlike a circle-intersection implementation: the nearest point on the path always exists, so a vehicle far off the route still receives a sensible command that pulls it back toward the path.
  • It is the exact inverse of Ackermann Steering Model: this block produces delta from a curvature, that one consumes it. Chained, they return the curvature unchanged – provided both carry the same wheelbase.
  • Nonlinear, and deliberately carries no state space.

Code facts#

FactValue
registered typeRobotics/Trajectory_Generation/Pure_Pursuit_Steering
familyRobotics/Trajectory_Generation
solver environment classICoreBlock_0_Robotics_1_Trajectory_Generation_2_Pure_Pursuit_Steering
sourcesrc/ICoreSDK/ICoreBlockLibrary/Blocks/Robotics/Trajectory_Generation/Pure_Pursuit_Steering/ICoreBlock_0_Robotics_1_Trajectory_Generation_2_Pure_Pursuit_Steering.cpp
headersrc/ICoreSDK/ICoreBlockLibrary/Blocks/Robotics/Trajectory_Generation/Pure_Pursuit_Steering/ICoreBlock_0_Robotics_1_Trajectory_Generation_2_Pure_Pursuit_Steering.h
default size on canvas152 × 88 px
ports at insert1 in, 2 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoublepose
2outICoreDoublekappa
3outICoreDoubledelta

Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.

Configuration variables#

Config variableDefaultSimulink parameter
Waypoints[0 0; 1 0; 2 0.5]
Lookahead Distance (m)0.8
Wheelbase (m)0.35

Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.

supportSupport::None
Simulink path
port-count rulePortsParam::None
SampleTime parameteryes

Caveat (shown to the user): no Simulink equivalent available: the Pure Pursuit block ships in the Robotics System Toolbox, which is not installed on this machine (measured). Its interface also differs - it takes the waypoints on a PORT and returns a linear and an angular velocity, where this block takes the path as CONFIGURATION and returns the geometry (curvature and steering angle), leaving the speed policy to the model

Catalog contract: src/ICoreSDK/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h

Description vs code#

The checker has a blind spot here — it could not resolve something (a grouped port bullet, a computed config name), which is reported and never counted as a pass. A reader has to settle it:

  • B0 every stimulus in the sample errored — cross-checks skipped

The verdict above is tools/docs/check_block_descriptions.py (P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.

File banner (developer view)#

The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).

Pure Pursuit Steering — aim at a point on the path, a lookahead ahead nearest point on the polyline -> walk Ld forward along it -> goal point kappa = 2 * y_local / Ld^2 delta = atan(L * kappa)

The tracking law every mobile robot ships with, and the one a waypoint follower is written against. See the header for the four things that decide the shape of this file: the exact inverse relationship with Ackermann_Steering_Model, the arc-length reformulation that removes every runtime square root, why the HDL targets are simulation-only anyway, and the VHDL scratch problem.

Sample results#

No stimulus produced a sampled output in this rig — Invalid input size at Pure Pursuit Steering block: ICore Blocks/Home/Pure Pursuit Steering. That is a fact about the single-block rig, not a verdict on the block: an offline batch fit, a block whose output only appears at onSolverFinish, or one that needs a driven environment cannot be exercised alone.

Category unsampled · sample time 0.1 · 60 steps · commit ccf005c8 · produced by docsSample --out <folder> --steps 60

Sample data: docs/generated/samples/Robotics__Trajectory_Generation__Pure_Pursuit_Steering.json