refactor(robocasa): switch env_server to rlinf Robocasa365Env - #83
Draft
qurakchin wants to merge 7 commits into
Draft
refactor(robocasa): switch env_server to rlinf Robocasa365Env#83qurakchin wants to merge 7 commits into
qurakchin wants to merge 7 commits into
Conversation
…tives, driver, CLI)
…ll docs
- Split `_init_runtime` into `init_shared_runtime` (session VLA) and
`init_task_runtime` (task env) with a dashboard spec, matching the
LIBERO pattern; `_init_runtime` stays as the CLI fallback.
- Thread `check_cancelled` through primitives/rldx_skill/toolkit so an
interrupted tool stops promptly instead of draining the episode.
- Pin torch/torchvision/numpy/transformers/rldx in the robocasa extra;
relax protobuf to <4 for tianshou.
- Switch vla_server to CUDA_VISIBLE_DEVICES pinning (RLDX hardcodes
device=0 internally now).
- Rewrite robocasa install docs (prereqs, 3-step post-install, RLDX-1
checkpoint, 50-task list); trim installation.rst to a pointer.
- Remove obsolete scripts/robocasa/ and tests/test_api_dashboard_session.py.
Rebase onto main brought RLinf#73's EnvState + Toolkit.get_env_state abstraction; LIBERO was adapted upstream but RoboCasa still used hand-rolled flat-file IO (_append_state/_load_states/_load_image) and a manual _step dispatcher. This puts RoboCasa on the same EnvState + StepRecord + _publish_step path so the dashboard frame / action-video / timeline wiring works for both envs. - toolkit.py: rewrite to mirror libero — EnvState bound in __init__, _FRAME_ARTIFACTS {camera, wrist}, get_env_state() captures frame slice + dumps state + writes action_{}.mp4 via env_state.save, init_primitives_clean() publishes step 0 + success_criteria.md, close() flushes episode.mp4, write_recipe() reads state.records() - tools.py: dump_state(primitives, env_state, log) goes through env_state.record_step + _save_observation_artifacts + _prune_heavy_artifacts (npy pruning via artifact_path().unlink); readonly perception tools take state: EnvState kwarg; write_recipe_from_states(state, tag) walks state.records() - primitives.py: replace save_frame_slice / stop_recording_and_save with frame_slice / stop_recording; drop dump_state(step_idx) file writes; add current_state_dict(); dump_success_criteria() returns text for the toolkit to save - __init__.py: drop video_path from get_toolkit (callers never passed it) - delete legacy file-protocol driver (interactive_driver.py, main_robocasa.py) — superseded by the centralized Toolkit path Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: qurakchin <czzcy3832515@hotmail.com>
Signed-off-by: qurakchin <czzcy3832515@hotmail.com>
…atch - RpcFacade: per-session bookkeeping with idle-timeout sweep thread; _on_session_drop hook for policy-state cleanup; serve() requires session_sweep_s > 0 when sessions are enabled. - RpcClient: owns a private session id + atexit close; wait_for_ready registers it on connect. - http/socket transports: thread session_id through dispatch. - libero/robocasa servers: _dispatch now takes _lock around the body and accepts session_id; robocasa VLA enables sessions and injects the caller's sid into predict (rejects caller-supplied session_ids). - rldx_skill: drop hardcoded sid; rely on server-side injection. - docs (en/zh): document session lifecycle in add_robot / add_primitive / interfaces. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace direct robocasa/robosuite usage with rlinf's Robocasa365Env wrapper. The raw env now lives in an rlinf subprocess owned by RobocasaSubprocEnv; the facade translates env.* RPC calls into Robocasa365Env method calls. - Add _resolve_rlinf_repo_path() to locate the rlinf checkout (env var → sibling rlinf → in-repo rlinf_robocasa) and mirror it onto PYTHONPATH so macOS spawn'd workers can import rlinf. - Build the Robocasa365Env OmegaConf cfg in build_env_cfg(); --split all maps to pretrain (RoboCasa365 only knows pretrain/target). - Fall back to max_episode_steps=600 when --max-episode-steps is 0 so RoboCasa365's episode_horizon_source validation passes. - Delegate reset/step/render_raw/camera_meta/grasp_contact/etc. to the matching Robocasa365Env methods (RLDX_RESET_SEED flows through set_seed into the subprocess). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
qurakchin
force-pushed
the
adapt/robocasa_5
branch
from
August 11, 2026 10:04
779c2d3 to
1390a3e
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.
Summary
robocasa/robosuiteusage inrobots/robocasa/env_server.pywithrlinf'sRobocasa365Envwrapper. The raw env now lives in an rlinf subprocess (RobocasaSubprocEnv); the facade translatesenv.*RPC calls intoRobocasa365Envmethod calls._resolve_rlinf_repo_path()(env var → siblingrlinf→ in-reporlinf_robocasa) and mirror it ontoPYTHONPATHso macOS spawn'd workers can import rlinf.Robocasa365EnvOmegaConf cfg inbuild_env_cfg();--split allmaps topretrain. Fall back tomax_episode_steps=600when--max-episode-steps=0so theepisode_horizon_sourcevalidation passes.Depends on
Blocks on #82 landing first. This branch is built on top of #82 (
refactor(rpc): add per-client session isolation + lock-protected dispatch) and the new env_server relies on the RPC facade shape introduced there. Do not merge until #82 is inmain.Test plan
env_server.pyagainst a RoboCasa365 task and verifyreset/step/render_rawround-trip via RPC.RLDX_RESET_SEEDreproduces the fullshot eval scene (paired comparison).--cuda-devicepins EGL + torch on multi-GPU boxes without crashing.