Skip to content

pycvc: sim_world's drive telemetry, with the tick's books against U_nav - #857

Merged
transfix merged 1 commit into
masterfrom
feat/pycvc-drive-telemetry
Oct 28, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/pycvc-drive-telemetry

Conversation

@transfix

Copy link
Copy Markdown
Owner

This lets Python read the navigator's tick books from a live sim_world: potential_end, projection_work and context_work (#832). Before this, pycvc could not capture a world's drive telemetry at all. Its only telemetry dict was nav_drive_step_material_cuda's, and the bare drive step never fills these three.

Changes

  • nav_sim_world_set_capture_drive_telemetry(handle, on) turns capture on or off. It is off by default, and the world steps bit for bit the same either way.
  • nav_sim_world_drive_telemetry(handle) returns the last captured tick as a dict of (N,) arrays named as drive_telemetry's fields. The arrays are f32, except binding, which is uint8. U_nav's terms are u_goal … u_terrain. The three books are included.
    • It returns None while capture is off.
    • From turning capture on until the first captured step, it holds drive_telemetry's defaults.
  • One helper, pycvc_telemetry::to_dict, builds the dict for both readers. nav_drive_step_material_cuda's telemetry therefore gains the three keys, and they are zero there.
    • test_pycvc_nav_cuda.py's key set now includes them, and it checks they are zero.
    • Neither local nor PR CI builds the CUDA pycvc path, so that path is checked by inspection only.
  • sim_world.h: drive_telemetry_data() returns those defaults, not null, before the first captured step. The comment now says so; the code is unchanged.

Test

test_pycvc_nav_telemetry.py (ctest pycvc_nav_telemetry, run by pycvc-linux / cp312) is NavPotential.SimWorldBooksTheContextWorkOfAGoalChange through Python. Four agents tick three times, two of them are retargeted one unit ahead, and the world ticks once more. It checks:

  • capture changes no pose;
  • every field is present, with the right dtype and shape;
  • context_work is zero on the first captured tick;
  • projection_work is zero without an override or min_gap;
  • context_work equals potential minus last tick's potential_end, bit for bit;
  • the retargeted agents book -3.353 of context work, against +0.007 without the change;
  • the other agents book the same with and without it.

Run locally on Windows (MSVC 14.44, Python 3.11, SWIG 4.4.1): 23 checks pass. test_pycvc_nav_routes.py (26 checks) and test_pycvc_nav_belief.py pass unchanged.

With this, GRL-SNAM can read live context work once a pycvc release carries it.

nav_sim_world_set_capture_drive_telemetry and nav_sim_world_drive_telemetry
read sim_world::drive_telemetry_data from Python. The second returns the last
captured tick as a dict of (N,) arrays named as drive_telemetry's fields, with
the books only a world fills (#832): potential_end, projection_work and
context_work. It returns None while capture is off.

The dict is built by one helper (pycvc_telemetry::to_dict), which
nav_drive_step_material_cuda's telemetry now uses too. That dict gains the
three keys, which the bare drive step leaves zero; test_pycvc_nav_cuda checks
both.

test_pycvc_nav_telemetry.py (ctest pycvc_nav_telemetry) is
NavPotential.SimWorldBooksTheContextWorkOfAGoalChange through Python. It
checks:
- capture changes no pose;
- context_work is zero on the first captured tick, and projection_work is
  zero without an override or min_gap;
- context_work equals potential minus last tick's potential_end, bit for bit;
- the two retargeted agents book -3.353 of context work, against +0.007
  without the goal change.
Locally (MSVC, Python 3.11) it passes 23 checks, and the nav routes and
belief scripts pass unchanged.

sim_world.h: drive_telemetry_data() returns the defaults, not null, from
turning capture on until the first captured step; its comment now says so.
@transfix
transfix enabled auto-merge (squash) October 28, 2026 03:18
@transfix
transfix merged commit 713a14a into master Oct 28, 2026
17 of 24 checks passed
transfix added a commit that referenced this pull request Oct 28, 2026
The project version and the cvcpkg recipe family move to 3.7.2. Every recipe is at cvc_revision 1
already, so none restarts.

3.7.2 carries the dynamic plants on the terrain and in a Jolt world, and the four-wheel plant
(#869): --plant dynamic and dynamic4w drive the ground, collide with the
buildings and each other, and book the collisions. It also carries dyn_4w's port-Hamiltonian form
(#850), dyn_bike's wheel-frame front slip (#852), the books goldens for GRL-SNAM's twins (#848,
#849), pycvc's drive telemetry (#857) and keep-alives (#864), the macOS SDK's openssl (#846), and
the state_exec scheduler and evaluator work (#842, #843, #844, #861, #863).
@transfix
transfix deleted the feat/pycvc-drive-telemetry branch October 29, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant