Repository navigation
pycvc: the water physics' knobs (the wake, wading, the wind, boats) - #1548
Merged
Merged
Conversation
Binds what the ocean-and-weather roadmap listed as "pycvc does not bind": - the wake: field_wake (with a shore_grid_mask coast) on add_field / set_field, field_wake_info, field_wake_height, field_wake_of, water_at; add_box / add_sphere / add_hull take hull=; - wading: vehicle_desc.wading (wading_desc), the wading readouts in vehicle_state, physics_world.set_vehicle; world_binding gets vehicles.<name>.tuning.wading.* knobs and the wading telemetry, with key metadata; WorldEntities.list() gives each vehicle's wading; - the wind: wind_flow, scene_wind_flow (Ariadne's wind.* keys), physics_world.set_wind / add_wind, add_field(None, kind="flow", wind=...), mujoco_robot.set_wind; - boats: hull_mesh, box_hull, loft_hull, boat_desc, dyn_boat_desc presets, add_boat / set_boat_controls / boat_state, dyn_boat_plant (a sim_world plant), plant_host.boat_state / boat_books. test_pycvc_physics_water.py (107 checks) reproduces the wake's pinned golden hash and the wind's pinned digest and samples, floods a Humvee past its fording depth (and fords with the kit set from the tree), blows a light ball downwind, floats the tactical boat at its draft and has nav drive it to a goal.
…t brings pycvc_gl %imports pycvc.i, so its wrapper carries the type table's derived-to-base casts for shore_grid_mask -> wake_shore and wind_flow -> flow_velocity, and needs their headers. GCC (pycvc-linux) failed on shore_grid_mask; clang-cl /Zs on the generated wrapper reproduces the error without this include and passes with it.
transfix
added a commit
that referenced
this pull request
Nov 26, 2026
The roadmap's F4 "Not done" list conflicted with #1548's pycvc line: kept this branch's struck-through items and took master's pycvc wording.
transfix
added a commit
that referenced
this pull request
Nov 26, 2026
…edAndSleep (#1557) The packed-crates wake test took 747 s of physics_field_test's 1200 s ctest budget on #1548's package-linux libcvc-debug run, and timed out at 1200 s on #1551's first run of that lane, on a runner about 2.9x slower (the sibling wake test took 784 s there against 271 s on #1548). With the lane's --repeat until-pass:3 that one timeout cost the job an hour. A small file, appended to the directory's TEST_INCLUDE_FILES after the discovered tests' own include, sets that one test's TIMEOUT to 3600 (the cap ci.yml gives the heavy Debug lanes). The other physics_field tests keep 1200. ctest skips the line if the test is filtered out or renamed. Checked with ctest 3.31: --show-only=json-v1 over the real discovered physics_field_test file lists the test at 3600 and its 51 neighbours at 1200; a name with no test behind it raises no error.
transfix
added a commit
that referenced
this pull request
Nov 26, 2026
…lant.wading) (#1558) #1542 merged before #1548, so the bindings take its fields: - wading_desc.flood_area (and as_dict); vehicle_state water_inside and water_inside_mass; dyn_bike_plant.wading(i) / waded(i); WorldEntities' wading dict; - world_binding: a tuning.wading.flood_area knob (whether it is 0 stays fixed: set_vehicle refuses the change, so it is ignored) and the water_inside / water_inside_mass telemetry, with key metadata. test_pycvc_physics_water: a hard-doored Humvee (flood_area 0.1) in 0.7 m fills over seconds to the level outside (0.787 m^3 at 60 s), published by the binding; a dyn_bike_plant Humvee in 0.5 m wades (3738 N lifted).
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.
pycvc now binds the water physics that it did not: the physics wake, wading, the wind and boats. The ocean-and-weather roadmap listed each of these as an open note ("pycvc does not bind ..."). Each one is checked against C++ in a new test,
test_pycvc_physics_water.py(ctestpycvc_physics_water).What Python gets
The wake (C5, C6)
pycvc.field_wake(cells, cell, depth, period, ..., shore)holds the wake's parameters.add_field(..., inertial=True, wake=...)turns it on for a fluid.field_wake_info(field)(the window, sources, outside),field_wake_height(field, x, y),field_wake_of(field).water_at(p, body=None)gives the water at a point with the waves in it, withoutbody's own waves when one is given.pycvc.shore_grid_mask(depth, shore_m, min_x, min_y, cell, slope)builds a coast from numpy planes.add_box,add_sphereandadd_hulltakehull=(ahull_mesh).Wading
vehicle_desc.wadingis apycvc.wading_desc, with every field read and written in place.vehicle_stateaddswater_forceandengine_flooded, and each wheel addswater_depthandwater_drag.physics_world.set_vehicle(id, desc)changes a running vehicle's settings (it was not bound before).world_binding, C++) gets these knobs, with key metadata:vehicles.<name>.tuning.wading.{wheel_displacement, wheel_drag, underbody_depth, underbody_drag, tire_pressure, fording_depth}. It also publishesengine_flooded,water_force.*and each wheel'swater_depthandwater_drag.WorldEntities.list()gives each world vehicle's wading.The wind
pycvc.wind_flow(speed_mps, dir_rad, gustiness, base_z)is the physics wind.pycvc.scene_wind_flow(speed, dir, gustiness, base_z)is the wind that Ariadne'swind.speed/wind.dir(degrees) /wind.gustinesskeys make.physics_world.set_wind(speed, dir, gustiness, base_z)keeps air everywhere, asSceneWorlddoes (1.225 kg/m^3, C_d 1). A second call changes it in place, andNoneremoves it.wind()andwind_field()read it back.add_field(None, kind="flow", wind=...)adds a wind field directly.field_wind(id)reads a field's wind.mujoco_robot.set_wind(...),wind_force()andwind_torque()put a MuJoCo robot in the wind.Boats (O11, O12)
hull_mesh,box_hullandloft_hull.boat_desc: the hull body viahull()/set_hull(...), its mesh copied in and out, and the propeller and rudder as dicts.dyn_boat_desc:launch,jonboat,tacticalandpreset(name).physics_world:add_boat,set_boat_controls,boat_state,remove_boatandboat_desc_of.dyn_boat_plant: state, boat_state, books,hold_controls, andfloat_height/draft.nav_sim_world_set_plantaccepts it.plant_hostgetsboat_state(i)andboat_books(i)while the agents drive boats.vehicle_desc.wadinganddyn_boat_desc.boatnow keep their owner alive. Without that,humvee().wadingortactical().boatpointed into a temporary that Python had already freed. The test caught this through a failing read.Verified (Windows, MSVC Release, Jolt, pycvc core; cvcGL off)
pycvc_physics_water, 107 checks:PhysicsFieldWake.CrossPlatformGoldenHashc72e26b4ef0f764abit for bit. A dropped crate's ring rocks a neighbour 5 m away (0.036 m heave, 0.29 m drift); without a wake it moves 0.tuning.wading.fording_depthset to 1.52 from the state tree, it drives on to 100 m.wind_flowdigest and its 200 samples match C++'s pinned values (c7ec24178041550e,3ec1c28ca0601404). 12 m/s pushes a 0.5 m ball with 69.1 N (½ρAu² = 69.3 N).set_windand a hand-added flow field give the same hash.pycvc_volume_grid_contours(this deps prefix has nocvc::planar: "libcvc was built without cvc::planar") andpycvc_net("a taken port raises": Windows lets a second socket bind the port). Rerun alone, they fail the same way.physics_vehicle_test(with a new check of the wading knobs and telemetry;EveryPublishedKeySaysWhatItIscovers the new keys' metadata),physics_world_test,physics_energy_testandmulti_app_integration_testall pass./Zson the generated wrapper and the two binding sources: no errors.Not run locally: Linux, macOS, wasm, cvcGL/pycvc_gl. The MuJoCo wind check in
test_pycvc_mujoco.pyruns only where MuJoCo is built; the test exits early on Windows. CI'spycvc-linuxlane is the authoritative run.Fields that need a follow-up (other open work)
wading_desc::flood_area,vehicle_state::water_inside/water_inside_mass,dyn_wadingreadbacks, andengine_floodedindyn_*_saved. Whichever PR merges second binds them: add the field to thewading_descdeclaration andas_dict, tovehicle_state_dict, tokWadingKnobs(flood_area, if it should be a knob) and toWorldEntities.list().set_windbuilds the plain scene wind.StormWindFlowand any new gust-front parameters are not bound.hull_mesh.lift_coefficientis bound.field_wake.shoreis bound throughshore_grid_mask. Ashore_layeris not taken.