PathFollower
Agent-side autonomous-driving subsystem: drives the locomotion channel's intent inputs from AgentStateCourier::targetPosition.
| Inherits | AgentSubsystem |
| Group | agent |
Declared in src/libs/libagent/agent/services/subsystems/PathFollower.hpp.
Detailed description
Reads two sources. The courier of the controlling client (setAgentStateCourier()) gives the mode, the control flags, the target and the autonomous stanza id. The node's one current position (setPosition(), owner ruling 2026-10-18) gives the coordinate, the heading and the time of the update. The follower re-evaluates its activation predicate when a control parameter changes (AgentStateCourier::controlChanged), when the position changes (NodePosition::changed), on each tick while it is active, and on AgentRuntimeService::activePresetChanged.
Active when ALL of: - mode is AUTO_PILOT or COMPLETE_AUTONOMY - ControlFlags::WAYPOINT_MISSION_ACTIVE bit set - targetPosition is valid - the current position is valid AND fresh (timestamp within staleThresholdMs of the clock, the wall clock unless setClock() installed another) - the current heading is known (not NaN) - the autonomous stanza id resolves to a stanza with both intent:ground-drive-2d.forward and .yaw input ports
When active, runs a 10 Hz timer that computes (forward, yaw) commands via equirectangular projection + proportional control on the heading error, clamped to [-1, +1], and writes them through AgentSubsystem::writeInput().
On deactivation (predicate flips false): writes a single (0, 0) command and stops the timer.
Output is observable for tests via the intentWritten signal.