Repository navigation
sdf_nav: thread the ext_force_fn hook through SdfNavigator - #70
Merged
Merged
Conversation
#66 added a generic ext_force_fn hook to sdf_rollout / bicycle_rollout, but the navigator that the demos and Squad drive (grl_snam.nav.SdfNavigator) never accepted or passed one — so the force term could not reach the deployed drive. Add `self.ext_force_fn = None` and thread it into both rollout calls in step(). Unlike carrot_bias_fn (which nudges the pure-pursuit carrot), this enters the integrator's force law itself — the seam the DBG comm force uses as a genuine force term. The native C++ drive_step has no ext_force_fn plumbing, so step() falls back to the torch rollout when a hook is set (same pattern as material / friction), rather than silently dropping the force. Byte-identical when unset: default None hits #66's inert guards; tests/ test_nav_ext_force.py pins that a None or zero-force hook leaves both the point and bicycle traces bit-for-bit unchanged, and that a non-zero force bends them. Existing nav suite (test_nav / test_vehicle / test_material_nav / test_ext_force / test_nav_native_drive) stays green.
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.
What
#66 added a generic
ext_force_fnhook tosdf_rollout/bicycle_rollout, butSdfNavigator— the navigator the demos andSquadactually drive — never accepted or passed one, so a force term couldn't reach the deployed drive. This completes the plumbing.grl_snam/nav.py: addself.ext_force_fn = Noneand thread it into both rollout calls instep(). Unlikecarrot_bias_fn(which nudges the pure-pursuit carrot), this enters the integrator's force law — the seam the DBG comm force uses as a genuine force term.drive_stephas noext_force_fnplumbing, sostep()falls back to the torch rollout when a hook is set (same pattern asmaterial/friction) rather than silently dropping the force.Byte-identical when unset
Default
Nonehits #66's inert guards. Newtests/test_nav_ext_force.pypins that aNoneor zero-force hook leaves both the point and bicycle traces bit-for-bit unchanged (torch.equal), and that a non-zero force bends them (northward push raises final y). The existing nav suite (test_nav,test_vehicle,test_material_nav,test_ext_force,test_nav_native_drive) stays green — 45 passed / 1 skipped (pycvc).Why
This is the GRL-SNAM half of the DBG cf.bias → cf.force cutover: the deployed comm force moves from a carrot-bias steering hack to a genuine force term in the integrator. The grl_snam_dbg half (the
live_convoywiring + the world↔normalized adapter) is a companion PR.