Repository navigation
sim_world::set_risk_governor, and pycvc's nav_sim_world_set_risk_governor - #1012
Merged
Merged
Conversation
…rnor The material's forces slow an agent only by what they take from its goal pull's surplus over its speed cap. On a plant whose top speed is under nav's cruise the surplus swallows them: GRL-SNAM's dynamic RoboRacer meets a water strip square across its path at its top speed of 10 m/s, the water's push (half the surplus at most) leaves its command as it is, and its run matches the material-off one to the millimetre. Head on, the push does not steer either. The drive's answer is the risk governor (veh_params::risk_governor), but a sim_world took it only from cfg.veh at construction (or the state tree's pull), and pycvc's create never set it. sim_world::set_risk_governor(on, vmin, onset, lookahead, probes) switches it from the next step, with argument checks; risk_governor() reads it back. pycvc binds nav_sim_world_set_risk_governor and nav_sim_world_risk_governor. NavMaterialSimWorld.RiskGovernorSlowsAnAgentTheMaterialForcesDoNot: water 17 m wide across an agent's path; it crosses at its 18 m/s top speed with the forces alone and at 2.4 m/s on average with the governor, and switched off before the water the run is the ungoverned one, bit for bit. test_pycvc_nav_governor.py checks the same from Python (8.0 vs 0.4 m/s).
transfix
added a commit
to CVC-Lab/GRL-SNAM
that referenced
this pull request
Nov 3, 2026
…r material (#154) JoltPlant names its ground to pycvc's nav_plant (ground_bodies, transfix/libcvc#1011), so a chassis scraping it is no building contact in nav_stats; it falls back on a pycvc without the argument. material-demo --plant runs libcvc's risk governor on the dynamic and Jolt plants where pycvc has it (sim_world::set_risk_governor, transfix/libcvc#1012; NativeSimWorld.set_risk_governor, PlantNavigator(risk_governor=...)). --no-governor shows the forces alone, --governor puts it on the kinematic bicycle too. The forces slow a vehicle only by what they take from its goal pull's surplus over its top speed, which on a physics plant is all of it: the dynamic RoboRacer crossed the scenario story's water at its top speed, its run the same to the millimetre as without material. Under the governor it stops short of the water (0 hazard steps, 14 before). docs/PLANTS.md explains both, with the material demo's table for every plant with and without the governor.
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.
Why
In GRL-SNAM's material demo, the scenario story sends one vehicle square at a water strip. On the dynamic plant, turning the material on leaves the run exactly as it is without material, to the millimetre. The witness gate is active for 49 ticks, yet nothing changes.
The reason is the drive, not the plant. The material force joins the force sum, and the sum is then held to the speed cap. So the force slows an agent only by what it takes from the goal pull's surplus over that cap.
On a plant whose top speed is under nav's cruise, that surplus swallows it:
The kinematic arm, with nav's own vmax, moves by 0.1 m; Jolt's run diverges.
The drive already has the mechanism for slowing on risky ground: the risk governor (
veh_params::risk_governor). But asim_worldtook it only fromcfg.vehat construction or from the state tree'spull, and pycvc'snav_sim_world_createnever sets it.What
sim_world::set_risk_governor(on, vmin, onset, lookahead, probes)switches it from the next step and checks its arguments.risk_governor()reads it back.nav_sim_world_set_risk_governorandnav_sim_world_risk_governor.docs/PHYSICS_API.md's governor paragraph explains why a plant needs it.The governor slows a vehicle on risky ground; it does not wall it off. With the goal beyond the water, a kinematic agent still crosses, at the speed the risk allows.
Tests
NavMaterialSimWorld.RiskGovernorSlowsAnAgentTheMaterialForcesDoNot: water 17 m wide lies across an agent's path. With the forces alone it crosses at its 18 m/s top speed; with the governor, at 2.4 m/s on average. Switched off before the water, the run is the ungoverned one, bit for bit. It also covers the argument checks.test_pycvc_nav_governor.py: the same from Python (8.0 m/s against 0.4 m/s) and the switch. Registered aspycvc_nav_governor.Local run: Windows, MSVC 14.44 Release. Passing:
test_pycvc_nav_governor.py(11 checks).clang-format 18 is clean on the changed lines.
GRL-SNAM's
material-demo --plantturns the governor on for the dynamic and Jolt plants when the running pycvc has it (CVC-Lab/GRL-SNAM, follow-up PR). On the dynamic plant the scenario story then goes from 14 hazard steps (the material-off run) to none.