Repository navigation
nav: an external-force port on the four-wheel plant (dyn4_bike_step, dyn4_rollout_ext) - #780
Merged
Merged
Conversation
…dyn4_rollout_ext) P8d's open item. The four-wheel vehicle (diff::dyn4_plant) takes the external force as the bicycle and P8a's dyn_bike_step do since #728: - dyn4_bike_step / dyn4_bike_step_bwd take an optional ext_in (the force joined to the controller's, steering or not) and return dL/dF_ext, adding J^T dL/dF_ext to the position's gradient; null is the step as it was. - ext_rollout.h: dyn4_rollout_ext<G> / dyn4_rollout_ext_bwd<G>, the trajectory on a ground sampler, with a force sampled every `hold` steps and held between (dyn4_tape). nav_dyn_4w_test: a zero force is the step bit for bit; one step's dL/dF (8.6e-5) and the position's gradient through J (3.6e-4) against central differences; the trajectory is its steps, a null sampler the plain rollout, and its reverse against central differences for hold 1 and 3, cases on a controller switch skipped and counted (fd_acc); none of CVC_EXT_CASE_SEED 1..100 fails. Dyn4ExtRollout.Golden writes tests/data/dyn4_ext_rollout_golden.json for GRL-SNAM's torch twin.
…s it (not reformatted)
transfix
enabled auto-merge (squash)
October 24, 2026 00:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is P8d's open item: the four-wheel plant (
diff::dyn4_plant, #731) now takes the external force, the same port #728 gave the bicycle and P8a'sdyn_bike_step.What changes
dyn4_bike_step/dyn4_bike_step_bwd(detail/dyn_4w.h):ext_in: the force is joined to the controller's, steering or not, exactly whererollout_impladdsext_force.ext_inis the step as it was.ext_rollout.h:dyn4_rollout_ext<G>/dyn4_rollout_ext_bwd<G>are the trajectory on a ground sampler. The force is sampled everyholdsteps and held between, and the tape (dyn4_tape) holdsdyn4_state. This mirrorsdyn_rollout_ext.NAV_TRAINING.md): the force section covers the four-wheel plant, and its "not yet" list loses the port.Tests (
nav_dyn_4w_test, RoboRacer on a friction split with a bump)fd_acc: the one-sided differences disagree, or the central ones at eps and eps/2 do), asnav_dyn_bike_test'sfd_sumdoes.CVC_EXT_CASE_SEED1..100, none fails. The worst were 1.4e-2 for one step's dL/dF, 3.4e-2 for the trajectory's dL/dF, and 6.6e-2 for its initial-state gradient. That last one runs through every step's plant and clamps, so it's held to 1e-1.Dyn4ExtRollout.Goldenwritestests/data/dyn4_ext_rollout_golden.json. It has four agents, 10 steps, all 14 state components and their reverse gradients, with the field, the plant's parameters and the ground. The twin's four-wheel path isn't written yet. Rewrite the fixture withCVC_DYN4_EXT_GOLDEN_WRITE=1.nav_dyn_4w_test16/16 andnav_dyn_bike_test20/20 pass.