feat(rollout): decouple policy deployment from data recording with new lerobot-rollout CLI#3413
feat(rollout): decouple policy deployment from data recording with new lerobot-rollout CLI#3413imstevenpmwork wants to merge 6 commits intomainfrom
lerobot-rollout CLI#3413Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
@claude Review this PR |
|
Claude finished @imstevenpmwork's task in 4m 1s —— View job PR Review:
|
Summary / Motivation
lerobot-record) and policy deployment (lerobot-rollout). Previously,lerobot-recordhandled teleoperation, policy inference, RTC async inference, and DAgger-style human-in-the-loop corrections in a single script with growing conditional complexity. This PR extracts all policy-related execution into a newlerobot.rolloutmodule with a dedicated CLI, leavinglerobot-recordas a focused teleoperation-only tool.RolloutContextbundle. This makes each deployment mode independently testable and extensible without touching the others.Related issues
What changed
src/lerobot/rollout/module — Complete policy deployment engine with:BaseStrategy(autonomous, no recording),SentryStrategy(continuous recording + auto-upload),HighlightStrategy(ring buffer + keystroke save),DAggerStrategy(human-in-the-loop RaC with keyboard/pedal input)SyncInferenceEngine(inline) andRTCInferenceEngine(async background thread with action queue)RolloutContextdependency injection bundle with sub-contexts (runtime, hardware, policy, processor, dataset)ThreadSafeRobotwrapper for lock-protected concurrent hardware accessRolloutRingBuffermemory-bounded circular buffer for highlight captureChoiceRegistry(--strategy.type=...,--inference.type=...)lerobot-rolloutCLI (src/lerobot/scripts/lerobot_rollout.py) registered inpyproject.tomllerobot-record— Stripped all policy/inference code; teleop is now required.DatasetRecordConfig→src/lerobot/configs/dataset.py(shared between record and rollout)ActionInterpolator→src/lerobot/utils/action_interpolator.py(decoupled from RTC policy module)start_pedal_listener→src/lerobot/utils/pedal.py(evdev foot pedal support with graceful degradation)policies/rtc/action_queue.py— added missing lock guards onqsize(),empty(),get_action_index()examples/hil/hil_data_collection.py(1184 lines),examples/hil/hil_utils.py,examples/rtc/eval_with_real_robot.py(673 lines) — replaced bylerobot-rolloutrollout.pyand updatedevaluate.pyfor lekiwi, phone-to-so100, and so100-EE setupsdocs/source/inference.mdxcovering all strategies and examples; updatedhil_data_collection.mdx,il_robots.mdx,rtc.mdxHow was this tested (or how to run locally)
tests/test_rollout.py— covers config validation, ring buffer, thread-safe robot, strategy/inference factory dispatch, DAgger state machine transitions, and context dataclass fields. Run withpytest -q tests/test_rollout.py -svvlerobot-rollout --strategy.type=baselerobot-rollout --strategy.type=sentrylerobot-rollout --strategy.type=daggerwith keyboardlerobot-rollout --strategy.type=highlightwith keyboardlerobot-recordpure teleoperation — no regressionsmainand in this branch. Results were successful as the behavior was the same between these two.Checklist (required before merge)
pre-commit run -a)pytest)Reviewer notes