Skip to content

Stop VR control publishing during lerobot-record reset phase - #4

Draft
Ac31415 with Copilot wants to merge 1 commit into
copilot/update-policy-script-vr-controlsfrom
copilot/stop-vr-control-during-reset
Draft

Ac31415 with Copilot wants to merge 1 commit into
copilot/update-policy-script-vr-controlsfrom
copilot/stop-vr-control-during-reset

Conversation

Copilot AI commented Apr 20, 2026

Copy link
Copy Markdown

During lerobot-record, the VR teleop's 30 Hz background timer kept publishing absolute pose targets to the AIC controller throughout the reset phase (scene reload / robot repositioning), causing the robot to fight the sim reset. Additionally, the VR reference frame was never reset between episodes, so each new episode started from the previous episode's end pose rather than the loaded scene's initial TCP pose.

Changes

AICVRTeleop (aic_teleop.py)

  • get_action() — appends "_vr_active": _vr_enabled or _analogue_enabled to the returned dict. False when in IDLE/paused mode. Not in VRMotionUpdateActionDict, so ignored by build_dataset_frame.
  • pause() — disables VR/analogue modes and sets _paused=True, causing _update() to return early. Call before the reset record_loop.
  • start_episode() — resets all reference state, enters VR TRACKING mode (_vr_enabled=True), and blocks up to 1 s until _capture_reference() completes. Guarantees the first recorded frame reflects the scene's initial TCP pose.
  • _update() — early-returns when _paused; signals _init_event after the first successful _capture_reference().

AICRobotAICController (aic_robot_aic_controller.py)

  • send_action_vr_cartesian() — checks action.get("_vr_active", True) and no-ops when False, suppressing all pose and gripper publishes during IDLE/reset.

New: lerobot_record_aic_vr.pylerobot-record-vr entrypoint

Mirrors lerobot-record with VR lifecycle hooks injected around the reset phase:

# Before each episode
if vr_teleop is not None:
    vr_teleop.start_episode()   # re-capture reference, enter TRACKING
record_loop(..., dataset=dataset, ...)

# Before each reset
if vr_teleop is not None:
    vr_teleop.pause()           # stop publishing during scene reload
record_loop(..., dataset=None, ...)

Falls back gracefully when the teleop is not AICVRTeleop (no-ops), so it can replace lerobot-record for all teleop types.

Supporting changes

  • setup.py — registers lerobot-record-vr console script.
  • __init__.py — exports AICVRTeleop / AICVRTeleopConfig.
  • README.md — documents lerobot-record-vr and when to prefer it over lerobot-record.

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.

2 participants