Repository navigation
Add batched URDF visualization with indexed forward kinematics - #782
Draft
AlanZhu2006 wants to merge 4 commits into
Draft
AlanZhu2006 wants to merge 4 commits into
AlanZhu2006 wants to merge 4 commits into
Conversation
Render fixed-size URDF batches through the existing batched GLB and dense pose properties. Preserve independent indexed joint/base edits, visual subtree ownership, and input validation without changing message schemas or the frontend. Include one toy example, documentation, and focused correctness/lifecycle/dense-wire tests.
This branch has not been deployed
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
Add
viser.extras.BatchedViserUrdffor a fixed-size group of robots that shareone URDF's visual geometry and have independent joint values and base poses.
Each visual mesh is exported once and rendered through the existing batched GLB
API.
ViserUrdfand the frontend/message protocol remain unchanged.Motivation
Addresses #658. This follows
the batched-URDF approach in
Chung Min Kim's Pyroki prototype,
referenced by @brentyi in the issue. FK uses NumPy and the existing optional
yourdfpydependency; there is no JAX or Pyroki runtime dependency.Changes
robot_indices.Indexed joint updates evaluate FK for the selected rows; base edits reuse FK.
Changed visual properties still send complete N-row arrays via public dense
setters. This does not introduce sparse transport.
inside object arrays), visibility, removal, and safe same-root replacement.
python examples/04_demos/06_batched_urdf.py --num-robots 16.--record demo.htmlexports a self-contained three-second animation.Test plan
On macOS arm64 / Python 3.12.13, with runtime sources at
59bd950and thesubmission's documentation-only heading correction in
9a5f5e7:pytest --ignore=tests/e2e— 855 passed, 8 warnings in unchangedcamera/lifecycle/deprecated-API cases. CI-scope Ruff lint/format, full
srcPyright and the new example's Pyright passed. Earlier 155 targeted checks,
including 95 helper cases, are retained separately.
py.typed;installed-wheel indexed API and missing-
urdf-extra smoke passed. The actualnew RST/literalinclude and helper autodoc passed a focused Sphinx
-Wbuild.Examples/assets remain repository files under the existing packaging policy.
scenarios, playback rewind, and a bounded 20-minute update/recreate/reconnect
run, with zero page or console errors. Screenshots and exact commands are
retained in the local review deliverable.
56712d3. The cumulative patch applied cleanly; the subsequentone-character RST heading fix changes no Python/frontend/protocol bytes.
The full E2E suite, multi-Python CI matrix and complete themed/notebook docs
site were not run locally. Browser observations are functional acceptance,
with no FPS/GPU or total-client-memory claim. Initial image-test/type-check
failures in an incomplete local environment also reproduced on upstream; the
corrected isolated environment passed without weakening tests or changing
unrelated source.
Limits
Visual meshes only, fixed instance count, and existing batched GLB limitations.
FK remains a Python/yourdfpy loop. Floating/planar joints and additional global
scaling are unsupported. Dense array traffic can cost more than independent
ViserUrdfupdates when only a few robots change; this is an optional helper,with no universal speedup claim.