Repository navigation
refactor: unify RLinf python path resolution and to_numpy_tree - #162
Conversation
…v server creation Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
There was a problem hiding this comment.
🟡 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_treehelpers. - Centralize RLinf checkout path resolution (
get_rlinf_repo_path) and inject it into server subprocessPYTHONPATHviaProcessDaemon. - 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.
Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
Documentation build overview
2 files changed± rst_source/development/interfaces.html± rst_source/usage/advanced_deployment.html |
Documentation build overview
2 files changed± rst_source/development/interfaces.html± rst_source/usage/advanced_deployment.html |
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 singleto_numpy_treeutility.