Skip to content

initial WIP changes to support sonic in robosuite still needs review and ton more features, but right now locomotion in the robosuite env works with keyboard#809

Open
Abhiram824 wants to merge 3 commits into
masterfrom
robosuite-sonic
Open

initial WIP changes to support sonic in robosuite still needs review and ton more features, but right now locomotion in the robosuite env works with keyboard#809
Abhiram824 wants to merge 3 commits into
masterfrom
robosuite-sonic

Conversation

@Abhiram824

Copy link
Copy Markdown
Member

WIP

Abhiram824 and others added 3 commits June 8, 2026 16:42
…and ton more features, but right now locomotion in the robosuite env works with keyboard
Replace the full-qpos freeze/fall-recovery startup hold in
SonicWholeBodyController with an elastic band: a spring-damper force on the
PELVIS body only (mj_data.xfrc_applied), never a qpos write, so free task
objects (e.g. a manipulation env's cube/pot) evolve under normal physics
instead of being teleported back to a snapshot every step. Reuses gear_sonic's
ElasticBand (the same law base_sim uses), anchored at the spawn pose; released
manually via band_enabled / release_band()/toggle_band() (the collector binds
'9' in the viewer, mirroring base_sim). No fall recovery (a collapse stays
down, by design).

Also this session:
- Remove the _SOURCE_FACTORY hook: the controller always builds
  DDSCommandSource; tests/collector override by monkeypatching the module's
  DDSCommandSource symbol (_patch_source).
- Resolve the WBC config path from the installed gear_sonic package
  (_wbc_config_path); keep the guarded WBC_CONFIG export for tests/scripts.
- Rename the opaque 1-2 letter locals in _prepare/run_controller.
- collect_sonic_g1_demos.py: migrate off the removed factory hook, wire the
  band-release key, refresh docstrings, drop dead imports.
- Add test_sonic_startup_band_is_object_safe (perturb TwoArmLift's pot, step,
  assert it is not snapped back + the pelvis band force is set/cleared).

Tests: robosuite SonicG1 suite 8/8.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Builds on the band commit (80dc64c):

- SonicG1 base placement: zero _base_offset (robosuite derives it from the root
  body's authored pos, and our pelvis is authored at z=0.793, so set_base_xpos
  buried the pelvis at -0.793) and put the stand height in base_xpos_offset.z
  (GR1 convention). The env now stands the floating robot at
  [front-of-table, 0.793], feet on the floor, in Lift/Stack/TwoArmLift.

- collect_sonic_g1_demos.py: --environment loads ANY registered robosuite env
  via robosuite.make (not just the table-free SonicArena) -- safe now that the
  band no longer pins qpos; --robot selects SonicG1[/Fixed]; make_env() helper;
  set_init_pose sets JOINTS only (the env owns base placement).

- Bundles external asset updates (build_sonic_g1_assets.py / robot.xml).

SonicG1 suite 8/8; replay records a demo.hdf5 in Lift with the cube freejoint
in the recorded state.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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