Skip to content

Joint-velocity feasibility: enforce flag, retime/clamp converters, demo tooling - #5

Open
helen9975 wants to merge 10 commits into
devfrom
feature/joint-velocity-feasibility
Open

helen9975 wants to merge 10 commits into
devfrom
feature/joint-velocity-feasibility

Conversation

@helen9975

Copy link
Copy Markdown
Collaborator

Summary

Makes demos collected without velocity limits replayable under the joint velocity limit, and adds tooling to produce a velocity-feasible demo set.

Targets dev (not main): this builds on the joint-position control + velocity-clamp infrastructure that only exists on dev (MAX_JOINT_VEL clamp, block_until_reached, DemoConverter.create_demo_in_new_env/decimate). It cannot land on main until dev does.

Changes

  • JointPositionActionMode.enforce_joint_velocity_limits (default True, backward-compatible): gates the per-step limb slew clamp. Set False to replay raw absolute/EE targets open-loop.
  • DemoConverter velocity-feasibility methods:
    • clamp_absolute_joint_velocity — offline per-step slew limiter (same length)
    • max_limb_discrepancy_after_velocity_clamp — infeasibility metric
    • retime_absolute_joint_velocity — time-stretch that inserts intermediate waypoints so each target is reachable under the limit, keeping both arms synchronized
  • DemoStore.cache_path — public accessor for the versioned cache root (was a latent crash in the scripts, which referenced a non-existent attribute).
  • Tooling: clamp_demo_joint_velocity.py gains --retime and --resim (re-simulate feasible targets in an enforcing env for self-consistent observations); process_downloaded_demos_joint_velocity.py gains --retime; plus visualize_cube_handover.py, replay helpers, and the demo_store_tasks registry.

Verification

  • tests/test_demo_converter_velocity_clamp.py — 9 passed (clamp, discrepancy, and retime feasibility/waypoint/gripper behavior).
  • End-to-end: ran --retime --resim on 3 CubeHandover demos; all 3 persisted demos replay to SUCCESS under enforce_joint_velocity_limits=True, block_until_reached=False.

Notes

  • Diagnostic finding: the earlier replay failures were primarily caused by block_until_reached=True over-dwelling (desyncing the bimanual handover), not the velocity enforcement itself.
  • Env runs MuJoCo 3.3.3 while demos were recorded on 3.1.5; results are self-consistent but not pinned to the original demo physics.

helen9975 added 10 commits June 3, 2026 16:16
Gate the per-step limb slew clamp behind a flag (default True, preserving
existing always-on behavior). Set False to replay raw absolute/EE targets
open-loop, e.g. demos collected without velocity limits.
DemoConverter gains:
- clamp_absolute_joint_velocity: offline per-step slew limiter (same length)
- max_limb_discrepancy_after_velocity_clamp: infeasibility metric
- retime_absolute_joint_velocity: time-stretch that inserts intermediate
  waypoints so each target is reachable under the velocity limit while
  keeping both arms synchronized

Covered by tests in tests/test_demo_converter_velocity_clamp.py.
Exposes the versioned cache root so tooling no longer reaches into the
private _cache_path attribute.
- demo_store_tasks: task registry + joint-absolute metadata helper
- clamp_demo_joint_velocity: --retime (time-stretch) and --resim
  (re-simulate feasible targets in an enforcing env for self-consistent
  observations)
- process_downloaded_demos_joint_velocity: batch feasibility processing
  with --retime
- visualize_cube_handover: replay demos to MP4 for inspection
- replay_* scripts: replay/success-check helpers
- ci.yml: installs RoboEval and runs the pytest suite (import smoke, one env
  per task family, demo-converter unit tests) on every push/PR
- test_smoke.py: fast network-free env build/reset/step checks across all 7
  task families
- demo-replay.yml: heavier per-task demo replay + success regression
git submodule sync was restoring the SSH URL from .gitmodules, so the
runner (no SSH key) failed to clone mujoco_menagerie. Use a global
url.insteadOf rewrite before the update instead.
Open-loop replay drifts when the installed mujoco (pyproject: 3.3.3)
differs from the demos' recorded version (3.1.5), causing spurious
regression failures. Pin 3.1.5 for the replay job so it measures real
divergence, not version skew.
Pinning mujoco 3.1.5 broke env creation (dm_control 1.0.31 needs >=3.2's
cam_orthographic), so the supported runtime is 3.3.x where demos recorded
on 3.1.5 drift and ~1/3 of open-loop replays miss success. Add
--min-pass-rate to replay_sample_check_success.py and gate CI at 0.50 to
catch real regressions without red-walling on known version drift.
It's a ~30 min job; the fast pytest gate (ci.yml) covers every push/PR.
Move to a nightly cron + workflow_dispatch. The pass-rate threshold still
applies when it runs.
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