Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
a66369e
Cleanup registry to be easy-understanding (#76)
TablewareBox Aug 3, 2025
46aa7a7
fix: workstation handlers and vessel_id parsing
TablewareBox Aug 4, 2025
343f394
fix: working dir error when input config path
Xuwznln Aug 4, 2025
5cd0f72
modify default discovery_interval to 15s
Xuwznln Aug 4, 2025
98ce360
feat: add trace log level
Xuwznln Aug 4, 2025
06e6676
feat: 添加ChinWe设备控制类,支持串口通信和电机控制功能 (#79)
ZiWei09 Aug 6, 2025
5b2d066
fix: drop_tips not using auto resource select
Xuwznln Aug 6, 2025
6081dac
fix: discard_tips error
Xuwznln Aug 6, 2025
37d8108
fix: discard_tips
Xuwznln Aug 6, 2025
0605f30
fix: prcxi_res
Xuwznln Aug 6, 2025
e6c556c
add: prcxi res
Xuwznln Aug 6, 2025
01cbbba
feat: workstation example
Xuwznln Aug 7, 2025
662c063
fix pumps and liquid_handler handle
TablewareBox Aug 7, 2025
fe1a029
feat: 优化protocol node节点运行日志
Xuwznln Aug 10, 2025
50e93cb
fix all protocol_compilers and remove deprecated devices
TablewareBox Aug 11, 2025
573bcf1
feat: 新增use_remote_resource参数
Xuwznln Aug 11, 2025
eac9b8a
fix and remove redundant info
TablewareBox Aug 11, 2025
ea60cbe
bugfixes on organic protocols
TablewareBox Aug 12, 2025
f791c1a
fix filter protocol
TablewareBox Aug 12, 2025
e8c1f76
fix protocol node
Xuwznln Aug 12, 2025
e570ba4
临时兼容错误的driver写法
Xuwznln Aug 12, 2025
0063df4
fix: prcxi import error
Xuwznln Aug 12, 2025
a1538da
use call_async in all service to avoid deadlock
TablewareBox Aug 12, 2025
8a669ac
fix: figure_resource
Xuwznln Aug 13, 2025
4b7bde6
Update recipe.yaml
Xuwznln Aug 13, 2025
227ff12
add workstation template and battery example
TablewareBox Aug 19, 2025
02c7936
feat: add sk & ak
Xuwznln Aug 20, 2025
9f823a4
update workstation base
TablewareBox Aug 21, 2025
14bc2e6
Create workstation_architecture.md
TablewareBox Aug 21, 2025
ae3c110
refactor: workstation_base 重构为仅含业务逻辑,通信和子设备管理交给 ProtocolNode
TablewareBox Aug 21, 2025
5ec8a57
refactor: ProtocolNode→WorkstationNode
TablewareBox Aug 25, 2025
7d8e6d0
Add:msgs.action (#83)
ZiWei09 Aug 26, 2025
1ec642e
update: Workstation dev 将版本号从 0.10.3 更新为 0.10.4 (#84)
ZiWei09 Aug 26, 2025
332b33c
simplify resource system
TablewareBox Aug 27, 2025
82d9ef6
uncompleted refactor
TablewareBox Aug 27, 2025
ce5bab3
example for use WorkstationBase
TablewareBox Aug 27, 2025
cd84e26
feat: websocket
Xuwznln Aug 28, 2025
bbbdb06
feat: websocket test
Xuwznln Aug 28, 2025
1902735
feat: workstation example
Xuwznln Aug 28, 2025
68513b5
feat: action status
Xuwznln Aug 29, 2025
a312de0
fix: station自己的方法注册错误
Xuwznln Aug 30, 2025
bdddbd5
fix: 还原protocol node处理方法
Xuwznln Aug 30, 2025
cd0428e
fix: build
Xuwznln Aug 30, 2025
78c04ac
fix: missing job_id key
Xuwznln Sep 1, 2025
e3b8164
ws test version 1
Xuwznln Sep 2, 2025
f4d4eb0
ws test version 2
Xuwznln Sep 2, 2025
831f454
ws protocol
Xuwznln Sep 2, 2025
0cfc6f4
增加物料关系上传日志
Xuwznln Sep 3, 2025
5dda940
增加物料关系上传日志
Xuwznln Sep 3, 2025
2a60a6c
修正物料关系上传
Xuwznln Sep 3, 2025
a27b933
修复工站的tracker实例追踪失效问题
Xuwznln Sep 3, 2025
0b56efc
增加handle检测,增加material edge关系上传
Xuwznln Sep 4, 2025
4e52c7d
修复event loop错误
Xuwznln Sep 4, 2025
6ddceb8
修复edge上报错误
Xuwznln Sep 4, 2025
5516502
修复async错误
Xuwznln Sep 4, 2025
961752f
更新schema的title字段
Xuwznln Sep 6, 2025
c25283a
主机节点信息等支持自动刷新
Xuwznln Sep 7, 2025
361eae2
注册表编辑器
Xuwznln Sep 7, 2025
f68340d
修复status密集发送时,消息出错
Xuwznln Sep 10, 2025
a722636
增加addr参数
Xuwznln Sep 10, 2025
8cffd3d
fix: addr param
Xuwznln Sep 10, 2025
81bcc19
fix: addr param
Xuwznln Sep 10, 2025
22b88c8
取消labid 和 强制config输入
Xuwznln Sep 10, 2025
1ae274a
Add action definitions for LiquidHandlerSetGroup and LiquidHandlerTra…
ElijahChang929 Sep 10, 2025
5676dd6
Add LiquidHandlerSetGroup and LiquidHandlerTransferGroup actions to C…
ElijahChang929 Sep 10, 2025
58d1cc4
Add set_group and transfer_group methods to PRCXI9300Handler and upda…
ElijahChang929 Sep 10, 2025
513e848
result_info改为字典类型
Xuwznln Sep 11, 2025
95b6fd0
新增uat的地址替换
Xuwznln Sep 11, 2025
cde7956
runze multiple pump support
Xuwznln Sep 13, 2025
711a7c6
remove runze multiple software obtainer
Xuwznln Sep 13, 2025
c7a0ff6
support multiple backbone
Xuwznln Sep 13, 2025
2493fb9
Update runze pump format
Xuwznln Sep 13, 2025
bdf27a7
Correct runze multiple backbone
Xuwznln Sep 13, 2025
9e214c5
Update runze_multiple_backbone
Xuwznln Sep 13, 2025
b600fc6
Correct runze pump multiple receive method.
Xuwznln Sep 13, 2025
1cd0791
Correct runze pump multiple receive method.
Xuwznln Sep 13, 2025
94cdcbf
对于PRCXI9320的transfer_group,一对多和多对多
ElijahChang929 Sep 14, 2025
2ca0311
移除MQTT,更新launch文档,提供注册表示例文件,更新到0.10.5
Xuwznln Sep 14, 2025
fc669f0
fix import error
Xuwznln Sep 15, 2025
ffa841a
fix dupe upload registry
Xuwznln Sep 15, 2025
779c969
refactor ws client
Xuwznln Sep 15, 2025
4888f02
add server timeout
Xuwznln Sep 16, 2025
50c7777
Fix: run-column with correct vessel id (#86)
TablewareBox Sep 15, 2025
09549d2
resource_update use resource_add
Xuwznln Sep 17, 2025
573c724
新增版位推荐功能
ElijahChang929 Sep 17, 2025
e500628
重新规定了版位推荐的入参
ElijahChang929 Sep 18, 2025
01f8816
update registry with nested obj
Xuwznln Sep 18, 2025
da4bd92
fix protocol node log_message, added create_resource return value
Xuwznln Sep 18, 2025
6f8f070
fix protocol node log_message, added create_resource return value
Xuwznln Sep 18, 2025
2eaa0ca
try fix add protocol
Xuwznln Sep 18, 2025
a1a55a2
fix resource_add
Xuwznln Sep 18, 2025
41eaa88
修复移液站错误的aspirate注册表
Xuwznln Sep 18, 2025
ace98a4
Feature/xprbalance-zhida (#80)
Andy6M Sep 19, 2025
762c3c7
重新补全zhida注册表
Xuwznln Sep 19, 2025
768f438
PRCXI9320 json
Xuwznln Sep 19, 2025
eb70ad0
PRCXI9320 json
Xuwznln Sep 19, 2025
62f3a6d
PRCXI9320 json
Xuwznln Sep 19, 2025
7aab2ea
fix resource download
Xuwznln Sep 19, 2025
67ca45a
remove class for resource
Xuwznln Sep 19, 2025
091c9fa
Merge branch 'workstation_dev' into dev
Xuwznln Sep 19, 2025
304aebb
bump version to 0.10.6
Xuwznln Sep 19, 2025
2889e9b
更新所有注册表
Xuwznln Sep 19, 2025
4b5a83e
修复protocolnode的兼容性
Xuwznln Sep 19, 2025
301bea6
修复protocolnode的兼容性
Xuwznln Sep 19, 2025
94a7b8a
Update install md
Xuwznln Sep 19, 2025
f8ef6e0
Add Defaultlayout
ElijahChang929 Sep 19, 2025
13fd1ac
更新物料接口
Xuwznln Sep 22, 2025
f13156e
fix dict to tree/nested-dict converter
TablewareBox Sep 18, 2025
0dc2488
coin_cell_station draft
h840473807 Sep 22, 2025
34f05f2
refactor: rename "station_resource" to "deck"
TablewareBox Sep 24, 2025
a8419dc
add standardized BIOYOND resources: bottle_carrier, bottle
TablewareBox Sep 24, 2025
63ab1af
refactor and add BIOYOND resources tests
TablewareBox Sep 25, 2025
5c47cd0
add BIOYOND deck assignment and pass all tests
TablewareBox Sep 25, 2025
c3b9583
fix: update resource with correct structure; remove deprecated liquid…
TablewareBox Sep 25, 2025
ad2e143
feat: 将新威电池测试系统驱动与配置文件并入 workstation_dev_YB2 (#92)
Andy6M Sep 25, 2025
a8cc02a
add bioyond studio draft
TablewareBox Sep 25, 2025
a632fd4
bioyond station with communication init and resource sync
TablewareBox Sep 25, 2025
196e0f7
fix bioyond station and registry
TablewareBox Sep 26, 2025
622e579
fix: update resource with correct structure; remove deprecated liquid…
TablewareBox Sep 25, 2025
c6c2da6
frontend_docs
LccLink Sep 26, 2025
a5397ff
create/update resources with POST/PUT for big amount/ small amount data
TablewareBox Sep 26, 2025
14b7d52
create/update resources with POST/PUT for big amount/ small amount data
TablewareBox Sep 26, 2025
709eb0d
Merge branch 'dev' of https://github.com/dptech-corp/Uni-Lab-OS into dev
TablewareBox Sep 26, 2025
10aabb7
refactor: add itemized_carrier instead of carrier consists of Resourc…
TablewareBox Sep 29, 2025
9bbae96
Merge branch 'workstation_dev_YB2' of https://github.com/dptech-corp/…
TablewareBox Sep 29, 2025
7b426ed
create warehouse by factory func
TablewareBox Sep 30, 2025
2476821
update bioyond launch json
TablewareBox Sep 30, 2025
3fe8f4c
add child_size for itemized_carrier
TablewareBox Sep 30, 2025
1c9d2ee
fix bioyond resource io
TablewareBox Sep 30, 2025
cfc1ee6
Workstation templates: Resources and its CRUD, and workstation tasks …
TablewareBox Sep 30, 2025
5610c28
更新物料接口
Xuwznln Oct 9, 2025
54cfaf1
Workstation dev yb2 (#100)
ZiWei09 Oct 10, 2025
a8f6527
修复to_plr_resources
Xuwznln Oct 10, 2025
a1783f4
Merge remote-tracking branch 'origin/workstation_dev_YB2' into dev
Xuwznln Oct 10, 2025
67c0127
add update remove
Xuwznln Oct 10, 2025
609b600
支持选择器注册表自动生成
Xuwznln Oct 10, 2025
1f49924
修复资源添加
Xuwznln Oct 10, 2025
df33e1a
修复transfer_resource_to_another生成
Xuwznln Oct 10, 2025
0c42d60
更新transfer_resource_to_another参数,支持spot入参
Xuwznln Oct 10, 2025
704e13f
新增test_resource动作
Xuwznln Oct 10, 2025
174b191
fix host_node error
Xuwznln Oct 10, 2025
4b43734
fix host_node test_resource error
Xuwznln Oct 10, 2025
93f0e08
fix host_node test_resource error
Xuwznln Oct 10, 2025
6fc7ed1
过滤本地动作
Xuwznln Oct 10, 2025
7f40f14
移动内部action以兼容host node
Xuwznln Oct 10, 2025
387866b
修复同步任务报错不显示的bug
Xuwznln Oct 10, 2025
3a11eb9
feat: 允许返回非本节点物料,后面可以通过decoration进行区分,就不进行warning了
Xuwznln Oct 10, 2025
81fd829
update todo
Xuwznln Oct 10, 2025
88c4d1a
modify bioyond/plr converter, bioyond resource registry, and tests
TablewareBox Oct 10, 2025
25d46dc
pass the tests
TablewareBox Oct 10, 2025
c8d16c7
update todo
Xuwznln Oct 11, 2025
5f18789
add conda-pack-build.yml
Xuwznln Oct 12, 2025
dec474e
add auto install script for conda-pack-build.yml
Xuwznln Oct 12, 2025
15ce0d6
update conda-pack-build.yml
Xuwznln Oct 12, 2025
299f010
update conda-pack-build.yml
Xuwznln Oct 12, 2025
0b8bdf5
update conda-pack-build.yml
Xuwznln Oct 12, 2025
9aa97ed
update conda-pack-build.yml
Xuwznln Oct 12, 2025
3d95c98
update conda-pack-build.yml
Xuwznln Oct 12, 2025
040073f
Add version in __init__.py
Xuwznln Oct 12, 2025
434b9e9
Update conda-pack-build.yml
Xuwznln Oct 12, 2025
6422fa5
Update conda-pack-build.yml (with mamba)
Xuwznln Oct 12, 2025
43b992e
Update conda-pack-build.yml
Xuwznln Oct 12, 2025
ec882df
Fix FileNotFoundError
Xuwznln Oct 12, 2025
05a3ff6
Try fix 'charmap' codec can't encode characters in position 16-23: ch…
Xuwznln Oct 12, 2025
2455ca1
Fix unilabos msgs search error
Xuwznln Oct 12, 2025
65abc5d
Fix environment_check.py
Xuwznln Oct 12, 2025
18b0bb3
Update recipe.yaml
Xuwznln Oct 12, 2025
98b8e37
rebase from main
Xuwznln Oct 12, 2025
fd0ee74
Workshop bj (#99)
ZiWei09 Oct 12, 2025
ea08d71
Update prcxi driver & fix transfer_liquid mix_times (#90)
shiyubo0410 Oct 12, 2025
6fa877b
Update registry from pr
Xuwznln Oct 12, 2025
c9da9ea
clean files
Xuwznln Oct 12, 2025
5e9d320
fix startup env check.
Xuwznln Oct 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 27 additions & 28 deletions .github/workflows/conda-pack-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ jobs:
channels: conda-forge,robostack-staging,uni-lab,defaults
channel-priority: flexible
activate-environment: unilab
auto-activate-base: true
auto-update-conda: false
show-channel-urls: true

Expand All @@ -82,23 +81,23 @@ jobs:
run: |
echo Installing unilabos and dependencies to unilab environment...
echo Using mamba for faster and more reliable dependency resolution...
mamba install uni-lab::unilabos conda-pack -c uni-lab -c robostack-staging -c conda-forge -y
mamba install -n unilab uni-lab::unilabos conda-pack -c uni-lab -c robostack-staging -c conda-forge -y

- name: Install conda-pack, unilabos and dependencies (Unix)
if: steps.should_build.outputs.should_build == 'true' && matrix.platform != 'win-64'
shell: bash
run: |
echo "Installing unilabos and dependencies to unilab environment..."
echo "Using mamba for faster and more reliable dependency resolution..."
mamba install uni-lab::unilabos conda-pack -c uni-lab -c robostack-staging -c conda-forge -y
mamba install -n unilab uni-lab::unilabos conda-pack -c uni-lab -c robostack-staging -c conda-forge -y

- name: Get latest ros-humble-unilabos-msgs version (Windows)
if: steps.should_build.outputs.should_build == 'true' && matrix.platform == 'win-64'
id: msgs_version_win
run: |
echo Checking installed ros-humble-unilabos-msgs version...
conda list ros-humble-unilabos-msgs
for /f "tokens=2" %%i in ('conda list ros-humble-unilabos-msgs --json ^| python -c "import sys, json; pkgs=json.load(sys.stdin); print(pkgs[0]['version'] if pkgs else 'not-found')"') do set VERSION=%%i
conda list -n unilab ros-humble-unilabos-msgs
for /f "tokens=2" %%i in ('conda list -n unilab ros-humble-unilabos-msgs --json ^| python -c "import sys, json; pkgs=json.load(sys.stdin); print(pkgs[0]['version'] if pkgs else 'not-found')"') do set VERSION=%%i
echo installed_version=%VERSION% >> %GITHUB_OUTPUT%
echo Installed ros-humble-unilabos-msgs version: %VERSION%

Expand All @@ -108,7 +107,7 @@ jobs:
shell: bash
run: |
echo "Checking installed ros-humble-unilabos-msgs version..."
VERSION=$(conda list ros-humble-unilabos-msgs --json | python -c "import sys, json; pkgs=json.load(sys.stdin); print(pkgs[0]['version'] if pkgs else 'not-found')")
VERSION=$(conda list -n unilab ros-humble-unilabos-msgs --json | python -c "import sys, json; pkgs=json.load(sys.stdin); print(pkgs[0]['version'] if pkgs else 'not-found')")
echo "installed_version=$VERSION" >> $GITHUB_OUTPUT
echo "Installed ros-humble-unilabos-msgs version: $VERSION"

Expand All @@ -119,7 +118,7 @@ jobs:
mamba search ros-humble-unilabos-msgs -c uni-lab -c robostack-staging -c conda-forge || echo Search completed
echo.
echo Updating ros-humble-unilabos-msgs to latest version...
mamba update ros-humble-unilabos-msgs -c uni-lab -c robostack-staging -c conda-forge -y || echo Already at latest version
mamba update -n unilab ros-humble-unilabos-msgs -c uni-lab -c robostack-staging -c conda-forge -y || echo Already at latest version

- name: Check for newer ros-humble-unilabos-msgs (Unix)
if: steps.should_build.outputs.should_build == 'true' && matrix.platform != 'win-64'
Expand All @@ -129,28 +128,28 @@ jobs:
mamba search ros-humble-unilabos-msgs -c uni-lab -c robostack-staging -c conda-forge || echo "Search completed"
echo ""
echo "Updating ros-humble-unilabos-msgs to latest version..."
mamba update ros-humble-unilabos-msgs -c uni-lab -c robostack-staging -c conda-forge -y || echo "Already at latest version"
mamba update -n unilab ros-humble-unilabos-msgs -c uni-lab -c robostack-staging -c conda-forge -y || echo "Already at latest version"

- name: Install latest unilabos from source (Windows)
if: steps.should_build.outputs.should_build == 'true' && matrix.platform == 'win-64'
run: |
echo Uninstalling existing unilabos...
pip uninstall unilabos -y || echo unilabos not installed via pip
conda run -n unilab pip uninstall unilabos -y || echo unilabos not installed via pip
echo Installing unilabos from source (branch: ${{ github.event.inputs.branch }})...
pip install .
conda run -n unilab pip install .
echo Verifying installation...
pip show unilabos
conda run -n unilab pip show unilabos

- name: Install latest unilabos from source (Unix)
if: steps.should_build.outputs.should_build == 'true' && matrix.platform != 'win-64'
shell: bash
run: |
echo "Uninstalling existing unilabos..."
pip uninstall unilabos -y || echo "unilabos not installed via pip"
conda run -n unilab pip uninstall unilabos -y || echo "unilabos not installed via pip"
echo "Installing unilabos from source (branch: ${{ github.event.inputs.branch }})..."
pip install .
conda run -n unilab pip install .
echo "Verifying installation..."
pip show unilabos
conda run -n unilab pip show unilabos

- name: Display environment info (Windows)
if: steps.should_build.outputs.should_build == 'true' && matrix.platform == 'win-64'
Expand All @@ -159,10 +158,10 @@ jobs:
conda env list
echo.
echo === Installed Packages ===
conda list | findstr /C:"unilabos" /C:"ros-humble-unilabos-msgs" || conda list
conda list -n unilab | findstr /C:"unilabos" /C:"ros-humble-unilabos-msgs" || conda list -n unilab
echo.
echo === Python Packages ===
pip list | findstr unilabos || pip list
conda run -n unilab pip list | findstr unilabos || conda run -n unilab pip list

- name: Display environment info (Unix)
if: steps.should_build.outputs.should_build == 'true' && matrix.platform != 'win-64'
Expand All @@ -172,36 +171,36 @@ jobs:
conda env list
echo ""
echo "=== Installed Packages ==="
conda list | grep -E "(unilabos|ros-humble-unilabos-msgs)" || conda list
conda list -n unilab | grep -E "(unilabos|ros-humble-unilabos-msgs)" || conda list -n unilab
echo ""
echo "=== Python Packages ==="
pip list | grep unilabos || pip list
conda run -n unilab pip list | grep unilabos || conda run -n unilab pip list

- name: Verify environment integrity (Windows)
if: steps.should_build.outputs.should_build == 'true' && matrix.platform == 'win-64'
run: |
echo Verifying Python version...
python -c "import sys; print(f'Python version: {sys.version}')"
conda run -n unilab python -c "import sys; print(f'Python version: {sys.version}')"
echo Verifying unilabos import...
python -c "import unilabos; print(f'UniLabOS version: {unilabos.__version__}')" || echo Warning: Could not import unilabos
conda run -n unilab python -c "import unilabos; print(f'UniLabOS version: {unilabos.__version__}')" || echo Warning: Could not import unilabos
echo Checking critical packages...
python -c "import rclpy; print('ROS2 rclpy: OK')"
echo Running comprehensive verification script...
python scripts\verify_installation.py || echo Warning: Verification script reported issues
conda run -n unilab python -c "import rclpy; print('ROS2 rclpy: OK')"
echo Running comprehensive verification script with auto-install...
conda run -n unilab python scripts\verify_installation.py --auto-install || echo Warning: Verification script reported issues
echo Environment verification complete!

- name: Verify environment integrity (Unix)
if: steps.should_build.outputs.should_build == 'true' && matrix.platform != 'win-64'
shell: bash
run: |
echo "Verifying Python version..."
python -c "import sys; print(f'Python version: {sys.version}')"
conda run -n unilab python -c "import sys; print(f'Python version: {sys.version}')"
echo "Verifying unilabos import..."
python -c "import unilabos; print(f'UniLabOS version: {unilabos.__version__}')" || echo "Warning: Could not import unilabos"
conda run -n unilab python -c "import unilabos; print(f'UniLabOS version: {unilabos.__version__}')" || echo "Warning: Could not import unilabos"
echo "Checking critical packages..."
python -c "import rclpy; print('ROS2 rclpy: OK')"
echo "Running comprehensive verification script..."
python scripts/verify_installation.py || echo "Warning: Verification script reported issues"
conda run -n unilab python -c "import rclpy; print('ROS2 rclpy: OK')"
echo "Running comprehensive verification script with auto-install..."
conda run -n unilab python scripts/verify_installation.py --auto-install || echo "Warning: Verification script reported issues"
echo "Environment verification complete!"

- name: Pack conda environment (Windows)
Expand Down
34 changes: 28 additions & 6 deletions scripts/verify_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
Run this script after installing the conda-pack environment to ensure everything works.

Usage:
python verify_installation.py
python verify_installation.py [--auto-install]

Options:
--auto-install Automatically install missing packages

Or in the conda environment:
conda activate unilab
Expand All @@ -17,14 +20,15 @@

import sys
import os
import argparse

# IMPORTANT: Set UTF-8 encoding BEFORE any other imports
# This ensures all subsequent imports (including unilabos) can output UTF-8 characters
if sys.platform == "win32":
# Method 1: Reconfigure stdout/stderr to use UTF-8 with error handling
try:
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
sys.stderr.reconfigure(encoding="utf-8", errors="replace")
sys.stdout.reconfigure(encoding="utf-8", errors="replace") # type: ignore
sys.stderr.reconfigure(encoding="utf-8", errors="replace") # type: ignore
except (AttributeError, OSError):
pass

Expand All @@ -49,7 +53,7 @@
CROSS_MARK = "[FAIL]"


def check_package(package_name: str, display_name: str = None) -> bool:
def check_package(package_name: str, display_name: str | None = None) -> bool:
"""
Check if a package can be imported.

Expand Down Expand Up @@ -87,9 +91,25 @@ def check_python_version() -> bool:

def main():
"""Run all verification checks."""
# Parse command line arguments
parser = argparse.ArgumentParser(
description="Verify UniLabOS installation",
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument(
"--auto-install",
action="store_true",
help="Automatically install missing packages",
)
args = parser.parse_args()

print("=" * 60)
print("UniLabOS Installation Verification")
print("=" * 60)
if args.auto_install:
print("Mode: Auto-install missing packages")
else:
print("Mode: Verification only")
print()

all_passed = True
Expand All @@ -113,14 +133,16 @@ def main():

print(f" {CHECK_MARK} UniLabOS installed")

# Check environment without auto-install (verification only)
# Check environment with optional auto-install
# Set show_details=False to suppress detailed Chinese output that may cause encoding issues
env_check_passed = check_environment(auto_install=False, show_details=False)
env_check_passed = check_environment(auto_install=args.auto_install, show_details=False)

if env_check_passed:
print(f" {CHECK_MARK} All required packages available")
else:
print(f" {CROSS_MARK} Some optional packages are missing")
if not args.auto_install:
print(" Hint: Run with --auto-install to automatically install missing packages")
except ImportError:
print(f" {CROSS_MARK} UniLabOS not installed")
all_passed = False
Expand Down
8 changes: 3 additions & 5 deletions unilabos/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@
import networkx as nx
import yaml

from unilabos.ros.nodes.resource_tracker import ResourceTreeSet, ResourceDict

# 首先添加项目根目录到路径
current_dir = os.path.dirname(os.path.abspath(__file__))
unilabos_dir = os.path.dirname(os.path.dirname(current_dir))
if unilabos_dir not in sys.path:
sys.path.append(unilabos_dir)

from unilabos.config.config import load_config, BasicConfig, HTTPConfig
from unilabos.utils.banner_print import print_status, print_unilab_banner
from unilabos.resources.graphio import modify_to_backend_format

from unilabos.config.config import load_config, BasicConfig, HTTPConfig

def load_config_from_file(config_path):
if config_path is None:
Expand Down Expand Up @@ -268,6 +264,8 @@ def main():
from unilabos.app.web import http_client
from unilabos.app.web import start_server
from unilabos.app.register import register_devices_and_resources
from unilabos.resources.graphio import modify_to_backend_format
from unilabos.ros.nodes.resource_tracker import ResourceTreeSet, ResourceDict

# 显示启动横幅
print_unilab_banner(args_dict)
Expand Down
Loading