Skip to content

refactor: unify RLinf python path resolution and to_numpy_tree - #162

Merged
jx-qiu merged 6 commits into
RLinf:mainfrom
jx-qiu:refactor/robot-cleanup
Sep 10, 2026
Merged

jx-qiu merged 6 commits into
RLinf:mainfrom
jx-qiu:refactor/robot-cleanup

Conversation

@jx-qiu

@jx-qiu jx-qiu commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

This pull request refactors the robot environment server modules to (1) provide a unified way to start env servers using development checkouts of rlinf, and (2) standardize the conversion of data structures to NumPy arrays using a single to_numpy_tree utility.

…v server creation

Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Copilot AI lite review requested due to automatic review settings September 8, 2026 16:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The daemon now unconditionally prepends a possibly-nonexistent RLinf checkout path to PYTHONPATH without validation or test coverage, which can silently change runtime import behavior and mask misconfiguration.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Refactors RPent’s robot environment/VLA server stack to consistently resolve a development rlinf checkout via PYTHONPATH, and to standardize “RPC-safe” NumPy conversion via a shared to_numpy_tree() helper.

Changes:

  • Add rpent.utils.serialization.to_numpy_tree() and switch env servers to use it instead of per-file _to_numpy_tree helpers.
  • Centralize RLinf checkout path resolution (get_rlinf_repo_path) and inject it into server subprocess PYTHONPATH via ProcessDaemon.
  • Update advanced deployment docs (EN/ZH) to describe manual vs RPent-spawned server behavior.
File summaries
File Description
rpent/utils/serialization.py Introduces shared to_numpy_tree() conversion utility for RPC/pickling-safe values.
rpent/utils/daemon.py Adds prepend_pythonpath() and prepends the resolved RLinf checkout path for spawned subprocesses.
rpent/utils/config.py Makes get_rlinf_repo_path() always return a concrete fallback path (env override or ../rlinf).
rpent/utils/__init__.py Re-exports to_numpy_tree from rpent.utils.
rpent/robots/components/pi05_vla_server.py Removes per-script RLinf sys.path injection in favor of unified PYTHONPATH behavior.
robots/robotwin/env_server.py Replaces local _to_numpy_tree with shared to_numpy_tree.
robots/libero/env_server.py Replaces local _to_numpy_tree with shared to_numpy_tree and updates typing comment.
robots/franka/env_server.py Removes local _to_numpy_tree and RLinf sys.path injection; uses shared to_numpy_tree.
robots/dual_franka/vla_server.py Removes per-script RLinf sys.path injection.
robots/dual_franka/env_server.py Switches from importing Franka _to_numpy_tree to shared to_numpy_tree; removes RLinf sys.path injection.
docs/source-zh/rst_source/usage/advanced_deployment.rst Documents RLinf checkout usage via PYTHONPATH and RPent automatic resolution.
docs/source-en/rst_source/usage/advanced_deployment.rst Same as ZH: clarifies manual PYTHONPATH and RPent automatic resolution.
Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread rpent/utils/daemon.py
Comment thread rpent/utils/daemon.py Outdated
Comment thread rpent/utils/daemon.py Outdated
Comment thread rpent/utils/serialization.py Outdated
Comment thread rpent/utils/serialization.py
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 RPent | 🛠️ Build #34482650 | 📁 Comparing 2534c7f against latest (24541d6)

  🔍 Preview build  

2 files changed
± rst_source/development/interfaces.html
± rst_source/usage/advanced_deployment.html

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 RPent-cn | 🛠️ Build #34482651 | 📁 Comparing 2534c7f against latest (24541d6)

  🔍 Preview build  

2 files changed
± rst_source/development/interfaces.html
± rst_source/usage/advanced_deployment.html

@jx-qiu
jx-qiu merged commit 7dbb975 into RLinf:main Sep 10, 2026
7 checks passed
@jx-qiu
jx-qiu deleted the refactor/robot-cleanup branch September 10, 2026 06:49
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.

4 participants