Skip to content

nav: plan with the plant vehicle's own limits and size; choose the plant by name (P9) - #707

Merged
transfix merged 2 commits into
masterfrom
feat/nav-plant-vehicle-limits
Oct 19, 2026
Merged

transfix merged 2 commits into
masterfrom
feat/nav-plant-vehicle-limits

Conversation

@transfix

Copy link
Copy Markdown
Owner

Joe asked: "are we still using the point mass? can't we use the actual jolt vehicle dimensions and physics?" This is steps 1–3 of the answer. It replaces #702, which GitHub closed when #698's branch (its base) was deleted on merge; the branch is the same, rebased onto master.

Why

  • No default path used Jolt.
  • Even on the plant, nav planned every vehicle with its own veh_params, which the trained metric sizes for no vehicle in particular. At Austin's 0.05 per metre that is a 3 m disc, 18 m/s and 30 m/s². A Humvee has 2.5 m/s² and a 1.82 m track.

What changes

  1. The vehicle's own plan (nav_plant_options::plan_with_vehicle, on by default). plant_limits gains a_max, vmax, a_lat and the body (half_width, front, rear):

    • 0.8 × max_accel;
    • the new vehicle_desc::max_speed, which the driver model holds (Humvee 24.6 m/s, RoboRacer 10 m/s);
    • 0.5 g of cornering, at most 0.8 of the static stability factor;
    • the chassis box and wheels.

    sim_world drives with them and covers the body with four footprint discs (inset 0.7, 1.3 half-widths wide). The drive gains per-agent disc offsets (CPU) and a per-agent cornering limit. plant_plan_of reads them back.

  2. Two plant-arm fixes:

    • the drive sends a plant the acceleration its own integration would apply (respects allow_reverse and vmax);
    • nav_plant::command treats under 0.1 m/s as rest, so a Humvee asked to back out of a corner backs up instead of braking against its springs' jitter forever.
  3. cvc::physics::plant_host: the plant by name (kinematic, humvee, roboracer, or a list), in code or via <prefix>.nav_plant.vehicle. It owns the world: a flat ground, or a cvc::world's collide items. It falls back to the bicycle without Jolt, and check(name) validates a name up front.

  4. Demos: --plant on nav_city_drive, nav_city_swarm, nav_finale and nav_fog_ghost, plus a plant control in the restart panel. nav_material_demo runs the bicycle and the Humvee side by side.

Why the demos still default to the bicycle (measured)

  • Austin finale (scene-austin-south-small):

    • on the bicycle, vehicle 0 drives its route at ~12 m/s;
    • the Humvee drives at 10–11 m/s, then wedges in a corner after act 2 replans it: upright, all wheels down, full lock, unable to turn its 6.7 m circle out;
    • with the plan off (master's plant) it wedges earlier, at waypoint 30 against 39.
  • nav_material_demo:

    kinematic off kinematic on humvee off humvee on
    reached 12/12 12/12 12/12 8/12
    lake entries 57 0 61 65

    The material layer was tuned on the bicycle; with the plan off the Humvee still enters the lake 51 times.

  • cvcdbg's harness (CVC-DBG/cvcdbg#203) shows the same: on Humvees the lead gets less far and two followers wedge.

The default flip waits on routes that allow for a vehicle's turning circle, and on P8 (training through the vehicle). The roadmap records it as P9.

Tests (Windows MSVC)

  • nav_plant_test PlansWithTheVehiclesOwnEnvelope: a sim_world sized with nav's defaults, through a hard turn. On the vehicle's plan it commands ≤ 2.0 m/s² and 0.50 g; on nav's numbers, 30 m/s² and 0.98 g. The P4 gates size nav by hand, so they turn the plan off.
  • physics_plant_host_test (5):
    • switching, lists, refusals, the state tree;
    • 32 Humvees cost 5.4 ms a tick single-threaded and 3.2 ms on 3 Jolt workers, with the same state hash.
  • ctest: 4260/4261 (the one is a model test that passes alone). The 361 nav, drive, material, physics and plant tests all pass.
  • Builds: cvcGL demos built and run (MSVC); cvcdbg's harness and demo3 built against this branch.

…ant by name (P9)

The navigator planned every plant's vehicle with its own veh_params, which the trained metric
sizes for no vehicle in particular: at Austin's 0.05 per metre, a 3 m disc, 18 m/s and 30 m/s^2,
against a Humvee's 2.5 m/s^2 and 1.82 m track.

- vehicle_desc::max_speed: the top speed the driver model holds (Humvee 24.6 m/s, 55 mph;
  RoboRacer 10 m/s), in the snapshot JSON, the tuning keys, pycvc and the docs.
- plant_limits gains the vehicle's envelope and size: a_max, vmax, a_lat, half_width, front, rear.
  nav_plant::limits fills them (nav_plant_options::plan_with_vehicle, on by default): 0.8 of
  max_accel, max_speed, 0.5 g of cornering at most 0.8 of the static stability factor, and the
  chassis box and wheels from the rear axle.
- sim_world drives with them in place of cfg.veh's a_max, vmax and a_lat_max, and covers the body
  with kPlantDiscs = 4 footprint discs. The discs are inset 0.7 half-widths and 1.3 half-widths
  wide, at body_gain 1/4. The drive gains per-agent disc offsets (veh_params::body_offsets_col,
  CPU) and a per-agent cornering limit (plant_drive::a_lat). plant_plan_of reads them back.
- The plant arm sends the acceleration its own integration would apply, within [sp_min, vmax]:
  never a reverse nav forbids, never past vmax. nav_plant::command reads under 0.1 m/s as rest.
  Before, a Humvee asked to back out of a corner braked against its springs' jitter forever.
- cvc::physics::plant_host puts a sim_world's agents on a plant by name: "kinematic", a preset,
  or a list cycled over the agents. It can do that in code or from <prefix>.nav_plant.vehicle,
  and builds and owns the world (a flat ground, or a cvc::world's collide items). It falls back
  to the bicycle without Jolt.
- The cvcGL nav demos take --plant and a restart-panel plant control. nav_material_demo runs the
  bicycle and the Humvee side by side. The demos still default to the bicycle: in the Austin
  finale a Humvee drives its route, then wedges in a corner it cannot turn a 6.7 m circle out of
  (with the plan off too), and the material layer keeps the bicycle out of the lake but not the
  Humvee (0 entries against 65). Both wait on vehicle-aware routes and P8.

Tests (Windows MSVC):
- nav_plant_test's new PlansWithTheVehiclesOwnEnvelope drives a sim_world sized with nav's
  defaults through a hard turn. On the vehicle's plan it commands at most 2.0 m/s^2 and 0.50 g;
  on nav's numbers, 30 m/s^2 and 0.98 g.
- The P4 gates, which size nav by hand, turn the plan off.
- physics_plant_host_test (5) covers switching, lists, refusals, the state tree, and Jolt worker
  threads: the same state hash on 0 and 3 workers.
- ctest: 4260/4261; the one failure is a model test that passes alone. The 361 nav, drive,
  material, physics and plant tests all pass.
nav.vehicle.vmax is a speed limit as well as nav's own envelope, and pycvc_physics checks that
the tree's vmax caps an agent on the Jolt plant. plan_with_vehicle now takes the lower of the
vehicle's max_speed and nav's vmax; acceleration and cornering stay the vehicle's.
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