Skip to content

nav: route_follower drives vehicle routes; nav_finale uses them on a plant (P9 R2/R3) - #713

Merged
transfix merged 4 commits into
masterfrom
feat/nav-route-follower-r3
Oct 19, 2026
Merged

transfix merged 4 commits into
masterfrom
feat/nav-route-follower-r3

Conversation

@transfix

Copy link
Copy Markdown
Owner

The rest of vehicle-aware routes (Joe: "start vehicle-aware routes"), after #704's planner and #707's plant envelope (both merged).

R2: following a vehicle route (route_follower)

inc/cvc/nav/route_follower.h drives a sim_world's agents along plan_vehicle_route routes. A route splits into legs at its cusps, and each leg is driven in one gear. Call apply() before each step().

  • The last forward leg goes to the trained drive. The agent is retargeted to a carrot along the route:

    • at least twice the sim's reach_tol ahead (nearer, the drive parks at it);
    • the farthest pose the agent can see on the sim's map (a carrot behind a corner stalls the drive against the building);
    • moved on only once the agent is halfway to it, because a retarget resets the drive's carrot state.

    Where the agent can't see past the drive's reach, that stretch is pure pursuit at pursuit_speed (5 m/s).

  • Manoeuvre legs (backing up, or the forward part of a multi-point turn) are pure pursuit about the rear axle, in the leg's gear, at manoeuvre_speed (1.5 m/s). The agent stops at the cusp, then takes the next leg.

  • sim_world::override_command(i, steer, accel) replaces the drive's command for one step: the kinematic arm integrates it, and a plant takes it as its command.

  • sim_world::set_pose places an agent on the kinematic arm. A plant owns its vehicles' poses, so there it returns false.

R3: vehicle routes in nav_finale

On a plant (--plant humvee), the finale replaces its A* spines with vehicle routes:

  • the routes are planned with the plant's turning circle and body (plant_limits, plant_plan_of);
  • act 2 replans a vehicle when its target moves off its route (8% of the scene) or its route is done;
  • a vehicle that stays still for 4 s short of its goal is replanned from where it is.

The kinematic arm keeps its A* spines.

Measured

A Humvee facing the end of an 8 m dead end, with its goal behind it:

The trained drive alone On a vehicle route
Kinematic arm (nav_route_follower_test) Wedged, 53 m from the goal after 90 s Backs out 42 m to the goal in 29 s, never nearer a wall than 3.1 m
Jolt plant (nav_plant_test) 55 m from the goal after 90 s Reaches the goal in 31 s

Austin finale, 900 frames, 8 vehicles:

Driven Vehicles under 50 m in the last 300 frames
Kinematic arm, A* spines 7949 m 2 of 8
Humvee, A* spines 1903 m 7 of 8, stuck in corners at full lock
Humvee, vehicle routes 5387 m 0 of 8

Planning the 8 routes takes 220-460 ms at the start, and about 4.5 s over the run.

Locally (Windows, MSVC): nav_route_follower_test 4/4, nav_vehicle_route_test 7/7, nav_plant_test 15/15, and 348/348 nav, sim, plant and physics ctest cases.

Next

…and cusps (P9 R2)

sim_world::override_command(i, steer, accel) replaces the drive's command for one step. On the
kinematic arm the bicycle is integrated with it (nsub substeps, within the lock and
[sp_min, vmax]); on a plant it is the plant's command. sim_world::set_pose places an agent on the
kinematic arm (a plant owns its vehicles' poses).

route_follower splits a plan_vehicle_route at its cusps into legs, one gear each. The last
forward leg is the trained drive's: a carrot along the route, and the drive parks at its end.
A leg ending at a cusp is driven geometrically: pure pursuit about the rear axle in its gear at
manoeuvre_speed, slowing to stop at the cusp, then the next leg.

Measured, a Humvee facing the end of an 8 m dead end, goal behind it:
- kinematic arm: the drive alone wedges 53 m from the goal after 90 s; on the route it backs out
  42 m to the goal in 29 s, at least 3.1 m from the walls;
- Jolt plant (nav_plant_test), the plant's footprint and 6.71 m radius: alone 55 m from the goal
  after 90 s; on the route at the goal in 31 s;
- to a goal round the corner: it backs out 22.5 m, stops at the cusp, and drives on to the goal.
The nav, drive, material, physics, plant and route suites pass (373).
A retarget resets the drive's carrot state (nav_finale retargets only when its waypoint changes,
for that reason). The follower now does the same on the trained drive's leg.
…rives vehicle routes (P9 R3)

The drive leg's carrot is at least twice reach_tol ahead and the farthest pose the agent can see
on the sim's map; where it cannot see past the drive's reach, that stretch is pursued
geometrically at pursuit_speed. nav_finale on a plant plans vehicle routes (plan_vehicle_route)
with the plant's turning circle and body, follows them with route_follower, replans when act 2's
target moves off a route or a vehicle stops short for 4 s. Austin, 900 frames, 8 Humvees: 5387 m
driven and none wedged, against 2035 m and 7 of 8 wedged on A* spines.
@transfix
transfix merged commit 975268e into master Oct 19, 2026
31 of 33 checks passed
@transfix
transfix deleted the feat/nav-route-follower-r3 branch October 29, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant