Repository navigation
pycvc: vehicle routes (plan_vehicle_route, route_follower), the route vehicle, a belief raster - #745
Merged
Merged
Conversation
…ef plane's raster A vehicle with a turning radius drives a planned route rather than nav's carrot: the carrot FSM's wall-follow target can sit inside the turning circle, where the vehicle hunts between gears. pycvc_nav.i now wraps: - nav_plan_vehicle_route(occ, bounds, start pose, goal, vehicle, options) -> reached, poses (M,4) [x, y, heading, reverse], cusps, length, reverse_length, expansions (GIL released while it searches); - nav_route_clearance; - nav_route_follower_create(sim, options) / _set / _clear / _apply / _status, a capsule holding a reference to its sim_world, as sim_thread's does; - nav_sim_world_belief_occ(sim, m), a copy of plane m's planning raster, to plan on what an agent knows. The option dicts take exactly the C++ structs' fields; an unknown key or a non-number is an error. test_pycvc_nav_routes (19 checks): open ground, a corridor reached backing up, the validation, clearance, a follower driving an agent along its route to the end, the world kept alive by the follower, and the index and shape errors.
nav_sim_world_route_vehicle(sim, i): None on nav's bicycle; on a plant, agent i's min_radius (wheelbase / tan(max steer)), body discs (plant_plan_of), wheelbase, max_steer and the sim's reach, in world units: the derivation a C++ host makes (cvcdbg's vehicle routes), so a Python host plans with the same vehicle. test_pycvc_nav_routes now drives a Humvee along its route to the end on the Jolt plant (26 checks).
transfix
added a commit
to CVC-Lab/GRL-SNAM
that referenced
this pull request
Oct 20, 2026
On a plant, nav's carrot FSM can put its wall-follow target inside the vehicle's turning circle, where the vehicle hunts between gears for good: on libcvc 3.7.0 the Jolt crossing's RoboRacers both arrived from only 4 of 10 starts a few cm apart. nav_native.VehicleRoutes drives a native world's agents on libcvc's vehicle routes (plan_vehicle_route on each agent's own belief plane, route_follower; pycvc from transfix/libcvc#745), planning an agent again when it stands still short of its goal, as libcvc's finale and cvcdbg's convoy do. Squad(plant=...) uses them for agents with a fixed goal whenever pycvc has them (vehicle_routes=None; True requires them, False keeps the carrot); a moving-goal agent keeps the carrot. A route agent arrives when it finishes its route. With routes: 10 of 10 starts arrive, no penetration, 858-912 ticks. The arrival test now xfails only without the bindings; new tests: nearby starts, the choice and the plant requirement, a moving goal keeping the carrot.
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.
Summary
A vehicle with a turning radius should drive a planned route, not nav's carrot. The carrot FSM's wall-follow target (1.6 normalized units off the wall) can sit inside the turning circle, and the vehicle then hunts between gears forever. That is the stall behind CVC-Lab/GRL-SNAM's Jolt squad test: on libcvc 3.7.0, with 5–10 cm start offsets, both RoboRacers arrive in only 4 of 10 runs. libcvc's own finale and cvcdbg already drive vehicle routes on a plant; Python could not.
pycvc_nav.inow wraps:nav_plan_vehicle_route(occ, bounds, start pose, goal, vehicle, options)→reached,poses(M,4)[x, y, heading, reverse],cusps,length,reverse_length,expansions. The GIL is released while it searches.nav_route_clearance(occ, bounds, pose, vehicle).nav_route_follower_create(sim, options)/_set/_clear/_apply/_status. The follower's capsule holds a reference to itssim_worldcapsule, assim_thread's does.nav_sim_world_route_vehicle(sim, i): agent i's route vehicle from the plant (Noneon nav's bicycle):min_radius = wheelbase / tan(max_steer), the body discs fromplant_plan_of, and the sim's reach, in world units. It is the same derivation cvcdbg's C++ makes, so a Python host plans with the same vehicle.nav_sim_world_belief_occ(sim, m): a copy of plane m's planning raster, so a route can be planned on what the agent knows.The option dicts take exactly the C++ structs' fields; an unknown key or a non-number is an error.
bindings/pycvc/README.mddocuments them.Test plan
test_pycvc_nav_routes.py(26 checks): open ground; a corridor too narrow to turn in, reached backing up, every pose clear; option validation; clearance; a follower driving an agent along its route to the end; the follower keeping its world alive; index and shape errors; the route vehicle (none on the bicycle; on a Jolt plantmin_radius = wheelbase / tan(max_steer)); a Humvee driving its route to the end on the planttest_pycvc_physics.py(43) andtest_pycvc_nav_belief.pyunchanged against the same build (Linux, Python 3.12, Jolt)The GRL-SNAM squad change that uses these follows as a separate PR. It needs a pycvc release with these bindings for its CI.