Skip to content

feat: franka/lerobot environment support - #29

Draft
jx-qiu wants to merge 22 commits into
RLinf:mainfrom
jx-qiu:feature/lerobot
Draft

feat: franka/lerobot environment support#29
jx-qiu wants to merge 22 commits into
RLinf:mainfrom
jx-qiu:feature/lerobot

Conversation

@jx-qiu

@jx-qiu jx-qiu commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

This draft PR adds support for franka and lerobot.

A few progress blockers:

@jx-qiu
jx-qiu force-pushed the feature/lerobot branch 2 times, most recently from 4e174ff to 6751f24 Compare July 24, 2026 03:19
jx-qiu added 22 commits August 6, 2026 03:29
Ported from jx-qiu/feature/lerobot (d3ee39c) onto the rpent/robots layout: physical_agent.* -> rpent.*, env package moved to robots/lerobot/ with env_client.py, MCP namespace mcp__rpent__.

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Ported from jx-qiu/feature/lerobot (72b9911) onto the rpent/robots layout: env package under robots/franka/ with env_client.py, deployment/franka driver scripts, calibration board resources.

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Ported from jx-qiu/feature/lerobot (2b165f5): cap resent history by a max recent-image count (_MAX_HISTORY_IMAGES) instead of a cumulative byte budget.

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
This branch keeps per-robot driver code under robots/<robot>/ (e.g. robots/libero/env_server.py); deployment/ has no tracked files. The ported lerobot/franka env_server + calibration/geometry/kinematics/scene-camera helpers landed under deployment/ by mistake. Move them into robots/lerobot/ and robots/franka/, rewrite intra-package imports (deployment.<robot> -> robots.<robot>), and update build_command paths and the ADD_A_NEW_ENV docs example.

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Main moved rpent.rpc_driver.{base,socket} to rpent.utils.{rpc,socket_rpc}. Point the rebased lerobot/franka drivers (RpcClient, SocketRpcClient, SocketRpcServer) at the new module paths so they import against new main.

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Dropping cbb0ee8 removed rpent/deployment/launcher.py and the EnvSpec build_command/requires_suite_task fields it added. Strip the launcher-era machinery (EnvDriverContext import, _build_driver_command, unused driver_context param) so robots.lerobot and robots.franka import and register against the current EnvSpec(name, prompts) contract, matching robots.libero. Driver wiring is deferred to the later refactor.

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
start_env_server now selects the driver per --env: libero (python env_server + LIBERO_TYPE/MUJOCO_GL, suite/task/seed), lerobot (python env_server + --max-episode-steps), franka (bash run_env_server.sh). The VLA/model server and its --vla-endpoint requirement are now libero-only; franka/lerobot build their toolkit via get_toolkit(rpc_client=...). --suite/--task are required only for libero, and the output-dir slug and recipe_tag fall back to the env name otherwise. Fix stale run_env_server.sh usage comment.

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Align the lerobot (SO101) and franka env packages with main's conventions:

- get_toolkit now takes primitives_kwargs (assembled in the CLI) instead of an
  rpc_client, matching robots/libero.
- env_server.py serves via rpent.utils.rpc.RpcFacade (--transport/--host/--port,
  healthz readiness) instead of a raw SocketRpcServer with a stdout
  transport_ready event, so ProcessDaemon + wait_for_ready drive them like
  libero. Socket stays the default transport for the numpy obs/action payloads.
- Real-hardware cleanup is preserved: SIGTERM/SIGINT trigger a graceful
  shutdown that runs env.close() (arm parking / motor + camera release);
  parent death is handled by RpcFacade's stdin-EOF watch.
- run_env_server.sh usage notes updated to the --env-endpoint CLI.

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
The env_server now uses --port (not --transport-port); also fix the stale
toolkits/ path to robots/.

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Match libero's default: spawn the lerobot/franka env_servers with --transport
http and talk to them over HttpRpcClient (http_rpc base64-encodes the numpy
obs/action payloads). Socket transport stays available via --transport socket or
an explicit socket://host:port --env-endpoint.

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
The env refactor (RLinf#41) made rpent/cli/main.py env-agnostic: env-specific CLI
args and runtime init now live behind EnvSpec's add_cli_args / parse_config /
init_runtime hooks. Port lerobot and franka to that contract, mirroring
robots/libero:

- get_env_spec() now wires _add_cli_args / _parse_config / _init_runtime
  (previously these envs returned a bare EnvSpec(name, prompts), which no
  longer satisfies the now-required hook fields).
- _init_runtime moves the old CLI-side _init_lerobot / _init_franka spawn/attach
  logic into the env package (ProcessDaemon spawn with --transport http, or
  attach via --env-endpoint [socket|http]://host:port; lazy heavy imports).
- _parse_config derives a real-robot run identity (recipe_tag/output_dir/
  task_desc keyed by env name; no suite/task/seed) and returns
  dashboard_state=None (the dashboard is libero-shaped; a warning is logged if
  --dashboard is passed).
- main.py: widen --env choices to libero | lerobot | franka (the only CLI
  change; all other wiring is env-agnostic).

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
…d improved target grid

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
…_FRAME_ARTIFACTS

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.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