[FEATURE] Add avatar (kinematic) entity and refactor rigid entity.#2459
Closed
Kashu7100 wants to merge 39 commits intoGenesis-Embodied-AI:mainfrom
Closed
[FEATURE] Add avatar (kinematic) entity and refactor rigid entity.#2459Kashu7100 wants to merge 39 commits intoGenesis-Embodied-AI:mainfrom
Kashu7100 wants to merge 39 commits intoGenesis-Embodied-AI:mainfrom
Conversation
…ions Add a lightweight AvatarEntity and AvatarSolver for displaying reference motions (e.g., mimic policy targets) without affecting physics or simulation speed. The avatar solver inherits from RigidSolver to reuse FK, kinematic tree, and render transform infrastructure while disabling all collision, constraint solving, and physics integration. Key design: zero simulation overhead is guaranteed because the avatar solver's substep methods are no-ops, and it doesn't break the _rigid_only fast path. All geoms force contype=0/conaffinity=0 as a safety net. Closes Genesis-Embodied-AI#2062 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AvatarSolver is visualization-only, so physics parameters (gravity, collision, constraints, etc.) should not be exposed. Move all hardcoded physics state into AvatarSolver.__init__ directly, skipping RigidSolver.__init__, and reduce AvatarOptions to only `dt`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use a full RigidOptions internally instead of SimpleNamespace to avoid missing-field crashes. Override set_dofs_position to skip collider/ constraint_solver reset. Add examples/avatar/go2_avatar.py showing a ghost Go2 with sinusoidal reference motion alongside a physics Go2. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Defer FK to update_visual_states and use zerocopy fast path with cached tensor views so set_dofs_position does only two indexed tensor writes per call. Benchmark confirms zero simulation overhead when updating avatar pose every step with CUDA tensors. Results (2000 steps, headless, Go2): Without avatar: ~700 steps/s With avatar (static): ~700 steps/s (+0%) With avatar (updating): ~730 steps/s (+0%) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…on disabling Fix correctness bug where zerocopy cache silently used stale dofs_idx on subsequent calls with different indices. Remove AvatarVisGeom, trim AvatarSolverState to position-only fields, simplify Avatar material API, and add _GeomClass attribute to RigidLink to eliminate duplicated factory methods in AvatarLink. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ions Add a lightweight AvatarEntity and AvatarSolver for displaying reference motions (e.g., mimic policy targets) without affecting physics or simulation speed. The avatar solver inherits from RigidSolver to reuse FK, kinematic tree, and render transform infrastructure while disabling all collision, constraint solving, and physics integration. Key design: zero simulation overhead is guaranteed because the avatar solver's substep methods are no-ops, and it doesn't break the _rigid_only fast path. All geoms force contype=0/conaffinity=0 as a safety net. Closes Genesis-Embodied-AI#2062 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AvatarSolver is visualization-only, so physics parameters (gravity, collision, constraints, etc.) should not be exposed. Move all hardcoded physics state into AvatarSolver.__init__ directly, skipping RigidSolver.__init__, and reduce AvatarOptions to only `dt`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use a full RigidOptions internally instead of SimpleNamespace to avoid missing-field crashes. Override set_dofs_position to skip collider/ constraint_solver reset. Add examples/avatar/go2_avatar.py showing a ghost Go2 with sinusoidal reference motion alongside a physics Go2. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Defer FK to update_visual_states and use zerocopy fast path with cached tensor views so set_dofs_position does only two indexed tensor writes per call. Benchmark confirms zero simulation overhead when updating avatar pose every step with CUDA tensors. Results (2000 steps, headless, Go2): Without avatar: ~700 steps/s With avatar (static): ~700 steps/s (+0%) With avatar (updating): ~730 steps/s (+0%) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…on disabling Fix correctness bug where zerocopy cache silently used stale dofs_idx on subsequent calls with different indices. Remove AvatarVisGeom, trim AvatarSolverState to position-only fields, simplify Avatar material API, and add _GeomClass attribute to RigidLink to eliminate duplicated factory methods in AvatarLink. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AvatarSolver now inherits from Solver (base class) directly, with its own build pipeline and kinematic init sequence. Avatar material inherits from Material directly. Both classes are completely unrelated to their Rigid counterparts, addressing reviewer feedback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
KinematicEntity was carrying ~80 physics methods that only work with RigidSolver. Move them into RigidEntity so KinematicEntity is a minimal kinematic+visualization base (morphology, FK, IK, DOF position get/set) and RigidEntity holds all physics (forces, velocities, contacts, etc.). Add no-op stubs in KinematicEntity for methods called by KinematicSolver: process_input, process_input_grad, save_ckpt, load_ckpt, reset_grad, zero_all_dofs_velocity. Fix bug: _get_idx -> _get_global_idx in set_dofs_velocity_grad. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
duburcqa
reviewed
Feb 24, 2026
duburcqa
reviewed
Feb 24, 2026
YilingQiao
reviewed
Feb 28, 2026
YilingQiao
reviewed
Feb 28, 2026
The KinematicSolver and KinematicEntity classes are the primary implementations. This removes the legacy "avatar" naming layer so the codebase consistently uses "kinematic" throughout: materials, options, solver state, simulator/scene attributes, visualizers, examples, and tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The kinematic solver handles Mesh morphs correctly via the same _load_mesh() path as RigidEntity, so the TODO noting it as buggy was outdated. Add gs.materials.Kinematic() to the tested materials and update the comp_key assertion to account for rigid-like entities that produce tuple segmentation keys at link/geom level. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
duburcqa
reviewed
Feb 28, 2026
|
|
86ca503 to
be293e5
Compare
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
duburcqa
reviewed
Mar 5, 2026
a18e4ff to
e64869d
Compare
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.
Description
Adds a visualization-only KinematicEntity for displaying ghost/reference motions (e.g., mimic policy targets) without affecting physics or simulation speed. Closes #2062.
Continued from #2452
Checklist:
Submitting Code Changessection of CONTRIBUTING document.