mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2026-02-07 07:25:15 +00:00
修复可能的web template找不到的问题
新增联网获取json启动 删除非-g传入启动json的方式 兼容传参参数名短横线与下划线 更新版本到0.10.1 修复Upload Registry镜像不匹配
This commit is contained in:
69
.conda/recipe.yaml
Normal file
69
.conda/recipe.yaml
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
package:
|
||||||
|
name: unilabos
|
||||||
|
version: 0.10.1
|
||||||
|
|
||||||
|
build:
|
||||||
|
noarch: python
|
||||||
|
number: 0
|
||||||
|
script:
|
||||||
|
- python -m pip install paho-mqtt opentrons_shared_data
|
||||||
|
- python -m pip install git+https://github.com/Xuwznln/pylabrobot.git
|
||||||
|
|
||||||
|
requirements:
|
||||||
|
host:
|
||||||
|
- python >=3.11
|
||||||
|
- pip
|
||||||
|
- setuptools
|
||||||
|
run:
|
||||||
|
- conda-forge::python =3.11.11
|
||||||
|
- compilers
|
||||||
|
- cmake
|
||||||
|
- make
|
||||||
|
- ninja
|
||||||
|
- sphinx
|
||||||
|
- sphinx_rtd_theme
|
||||||
|
- numpy
|
||||||
|
- scipy
|
||||||
|
- pandas
|
||||||
|
- networkx
|
||||||
|
- matplotlib
|
||||||
|
- pint
|
||||||
|
- pyserial
|
||||||
|
- pyusb
|
||||||
|
- pylibftdi
|
||||||
|
- pymodbus
|
||||||
|
- python-can
|
||||||
|
- pyvisa
|
||||||
|
- opencv
|
||||||
|
- pydantic
|
||||||
|
- fastapi
|
||||||
|
- uvicorn
|
||||||
|
- gradio
|
||||||
|
- flask
|
||||||
|
- websocket
|
||||||
|
- ipython
|
||||||
|
- jupyter
|
||||||
|
- jupyros
|
||||||
|
- colcon-common-extensions
|
||||||
|
- robostack-staging::ros-humble-desktop-full
|
||||||
|
- robostack-staging::ros-humble-control-msgs
|
||||||
|
- robostack-staging::ros-humble-sensor-msgs
|
||||||
|
- robostack-staging::ros-humble-trajectory-msgs
|
||||||
|
- ros-humble-navigation2
|
||||||
|
- ros-humble-ros2-control
|
||||||
|
- ros-humble-robot-state-publisher
|
||||||
|
- ros-humble-joint-state-publisher
|
||||||
|
- ros-humble-rosbridge-server
|
||||||
|
- ros-humble-cv-bridge
|
||||||
|
- ros-humble-tf2
|
||||||
|
- ros-humble-moveit
|
||||||
|
- ros-humble-moveit-servo
|
||||||
|
- ros-humble-simulation
|
||||||
|
- ros-humble-tf-transformations
|
||||||
|
- transforms3d
|
||||||
|
- uni-lab::ros-humble-unilabos-msgs
|
||||||
|
|
||||||
|
about:
|
||||||
|
repository: https://github.com/dptech-corp/Uni-Lab-OS
|
||||||
|
license: GPL-3.0
|
||||||
|
description: "Uni-Lab-OS"
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
configs/
|
configs/
|
||||||
temp/
|
temp/
|
||||||
|
output/
|
||||||
## Python
|
## Python
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -40,21 +40,11 @@ Uni-Lab-OS recommends using `mamba` for environment management. Choose the appro
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Create new environment
|
# Create new environment
|
||||||
mamba env create -f unilabos-[YOUR_OS].yaml
|
mamba create -n unilab unilab -c unilab -c robostack -c robostack-staging -c conda-forge
|
||||||
mamba activate unilab
|
|
||||||
|
|
||||||
# Or update existing environment
|
# Or update existing environment
|
||||||
# Where `[YOUR_OS]` can be `win64`, `linux-64`, `osx-64`, or `osx-arm64`.
|
# Where `[YOUR_OS]` can be `win64`, `linux-64`, `osx-64`, or `osx-arm64`.
|
||||||
conda env update --file unilabos-[YOUR_OS].yml -n environment_name
|
conda env update --file unilabos-[YOUR_OS].yml -n environment_name
|
||||||
|
|
||||||
# Currently, you need to install the `unilabos_msgs` package
|
|
||||||
# You can download the system-specific package from the Release page
|
|
||||||
conda install ros-humble-unilabos-msgs-0.10.0-xxxxx.tar.bz2
|
|
||||||
|
|
||||||
# Install PyLabRobot and other prerequisites
|
|
||||||
git clone https://github.com/PyLabRobot/pylabrobot plr_repo
|
|
||||||
cd plr_repo
|
|
||||||
pip install .[opentrons]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Install Uni-Lab-OS:
|
2. Install Uni-Lab-OS:
|
||||||
|
|||||||
12
README_zh.md
12
README_zh.md
@@ -40,21 +40,11 @@ Uni-Lab-OS 建议使用 `mamba` 管理环境。根据您的操作系统选择适
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 创建新环境
|
# 创建新环境
|
||||||
mamba env create -f unilabos-[YOUR_OS].yaml
|
mamba create -n unilab unilab -c unilab -c robostack -c robostack-staging -c conda-forge
|
||||||
mamba activate unilab
|
|
||||||
|
|
||||||
# 或更新现有环境
|
# 或更新现有环境
|
||||||
# 其中 `[YOUR_OS]` 可以是 `win64`, `linux-64`, `osx-64`, 或 `osx-arm64`。
|
# 其中 `[YOUR_OS]` 可以是 `win64`, `linux-64`, `osx-64`, 或 `osx-arm64`。
|
||||||
conda env update --file unilabos-[YOUR_OS].yml -n 环境名
|
conda env update --file unilabos-[YOUR_OS].yml -n 环境名
|
||||||
|
|
||||||
# 现阶段,需要安装 `unilabos_msgs` 包
|
|
||||||
# 可以前往 Release 页面下载系统对应的包进行安装
|
|
||||||
conda install ros-humble-unilabos-msgs-0.10.0-xxxxx.tar.bz2
|
|
||||||
|
|
||||||
# 安装PyLabRobot等前置
|
|
||||||
git clone https://github.com/PyLabRobot/pylabrobot plr_repo
|
|
||||||
cd plr_repo
|
|
||||||
pip install .[opentrons]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
2. 安装 Uni-Lab-OS:
|
2. 安装 Uni-Lab-OS:
|
||||||
|
|||||||
@@ -1,46 +1,58 @@
|
|||||||
package:
|
package:
|
||||||
name: ros-humble-unilabos-msgs
|
name: ros-humble-unilabos-msgs
|
||||||
version: 0.10.0
|
version: 0.10.1
|
||||||
|
|
||||||
source:
|
source:
|
||||||
path: ../../unilabos_msgs
|
path: ../../unilabos_msgs
|
||||||
folder: ros-humble-unilabos-msgs/src/work
|
target_directory: ros-humble-unilabos-msgs/src/work
|
||||||
|
|
||||||
build:
|
build:
|
||||||
script:
|
script:
|
||||||
sel(win): bld_ament_cmake.bat
|
- if: win
|
||||||
sel(unix): build_ament_cmake.sh
|
then:
|
||||||
|
- call %RECIPE_DIR%/bld_ament_cmake.bat
|
||||||
|
- if: unix
|
||||||
|
then:
|
||||||
|
- bash $RECIPE_DIR/build_ament_cmake.sh
|
||||||
number: 5
|
number: 5
|
||||||
about:
|
about:
|
||||||
home: https://www.ros.org/
|
repository: https://github.com/dptech-corp/Uni-Lab-OS
|
||||||
license: BSD-3-Clause
|
license: BSD-3-Clause
|
||||||
summary: |
|
description: "ros-humble-unilabos-msgs is a package that provides message definitions for Uni-Lab-OS."
|
||||||
Robot Operating System
|
|
||||||
|
|
||||||
extra:
|
|
||||||
recipe-maintainers:
|
|
||||||
- ros-forge
|
|
||||||
|
|
||||||
requirements:
|
requirements:
|
||||||
build:
|
build:
|
||||||
- "{{ compiler('cxx') }}"
|
- ${{ compiler('cxx') }}
|
||||||
- "{{ compiler('c') }}"
|
- ${{ compiler('c') }}
|
||||||
- sel(linux64): sysroot_linux-64 2.17
|
- if: linux and x86_64
|
||||||
|
then:
|
||||||
|
- sysroot_linux-64 2.17
|
||||||
- ninja
|
- ninja
|
||||||
- setuptools
|
- setuptools
|
||||||
- sel(unix): make
|
|
||||||
- sel(unix): coreutils
|
|
||||||
- sel(osx): tapi
|
|
||||||
- sel(build_platform != target_platform): pkg-config
|
|
||||||
- cmake
|
|
||||||
- cython
|
- cython
|
||||||
- sel(win): vs2022_win-64
|
- cmake
|
||||||
- sel(build_platform != target_platform): python
|
- if: unix
|
||||||
- sel(build_platform != target_platform): cross-python_{{ target_platform }}
|
then:
|
||||||
- sel(build_platform != target_platform): numpy
|
- make
|
||||||
|
- coreutils
|
||||||
|
- if: osx
|
||||||
|
then:
|
||||||
|
- tapi
|
||||||
|
- if: win
|
||||||
|
then:
|
||||||
|
- vs2022_win-64
|
||||||
|
- if: build_platform != target_platform
|
||||||
|
then:
|
||||||
|
- pkg-config
|
||||||
|
- python
|
||||||
|
- cross-python_${{ target_platform }}
|
||||||
|
- numpy
|
||||||
host:
|
host:
|
||||||
- numpy
|
- numpy
|
||||||
- pip
|
- pip
|
||||||
- sel(build_platform == target_platform): pkg-config
|
- if: build_platform == target_platform
|
||||||
|
then:
|
||||||
|
- pkg-config
|
||||||
- robostack-staging::ros-humble-action-msgs
|
- robostack-staging::ros-humble-action-msgs
|
||||||
- robostack-staging::ros-humble-ament-cmake
|
- robostack-staging::ros-humble-ament-cmake
|
||||||
- robostack-staging::ros-humble-ament-lint-auto
|
- robostack-staging::ros-humble-ament-lint-auto
|
||||||
@@ -50,12 +62,14 @@ requirements:
|
|||||||
- robostack-staging::ros-humble-rosidl-default-generators
|
- robostack-staging::ros-humble-rosidl-default-generators
|
||||||
- robostack-staging::ros-humble-std-msgs
|
- robostack-staging::ros-humble-std-msgs
|
||||||
- robostack-staging::ros-humble-geometry-msgs
|
- robostack-staging::ros-humble-geometry-msgs
|
||||||
- robostack-staging::ros2-distro-mutex=0.5.*
|
- robostack-staging::ros2-distro-mutex=0.6
|
||||||
run:
|
run:
|
||||||
- robostack-staging::ros-humble-action-msgs
|
- robostack-staging::ros-humble-action-msgs
|
||||||
- robostack-staging::ros-humble-ros-workspace
|
- robostack-staging::ros-humble-ros-workspace
|
||||||
- robostack-staging::ros-humble-rosidl-default-runtime
|
- robostack-staging::ros-humble-rosidl-default-runtime
|
||||||
- robostack-staging::ros-humble-std-msgs
|
- robostack-staging::ros-humble-std-msgs
|
||||||
- robostack-staging::ros-humble-geometry-msgs
|
- robostack-staging::ros-humble-geometry-msgs
|
||||||
# - robostack-staging::ros2-distro-mutex=0.6.*
|
- robostack-staging::ros2-distro-mutex=0.6
|
||||||
- sel(osx and x86_64): __osx >={{ MACOSX_DEPLOYMENT_TARGET|default('10.14') }}
|
- if: osx and x86_64
|
||||||
|
then:
|
||||||
|
- __osx >= {{ MACOSX_DEPLOYMENT_TARGET|default('10.14') }}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package:
|
package:
|
||||||
name: unilabos
|
name: unilabos
|
||||||
version: "0.10.0"
|
version: "0.10.1"
|
||||||
|
|
||||||
source:
|
source:
|
||||||
path: ../..
|
path: ../..
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -4,7 +4,7 @@ package_name = 'unilabos'
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=package_name,
|
name=package_name,
|
||||||
version='0.10.0',
|
version='0.10.1',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=['setuptools'],
|
install_requires=['setuptools'],
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
name: unilab
|
name: unilab
|
||||||
channels:
|
channels:
|
||||||
|
- unilab
|
||||||
- robostack
|
- robostack
|
||||||
- robostack-staging
|
- robostack-staging
|
||||||
- conda-forge
|
- conda-forge
|
||||||
@@ -61,7 +62,8 @@ dependencies:
|
|||||||
- transforms3d
|
- transforms3d
|
||||||
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
|
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
|
||||||
# ilab equipments
|
# ilab equipments
|
||||||
# - ros-humble-unilabos-msgs
|
- uni-lab::ros-humble-unilabos-msgs
|
||||||
- pip:
|
- pip:
|
||||||
- paho-mqtt
|
- paho-mqtt
|
||||||
- opentrons_shared_data
|
- opentrons_shared_data
|
||||||
|
- git+https://github.com/Xuwznln/pylabrobot
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
name: unilab
|
name: unilab
|
||||||
channels:
|
channels:
|
||||||
|
- unilab
|
||||||
- robostack
|
- robostack
|
||||||
- robostack-staging
|
- robostack-staging
|
||||||
- conda-forge
|
- conda-forge
|
||||||
@@ -60,7 +61,8 @@ dependencies:
|
|||||||
- transforms3d
|
- transforms3d
|
||||||
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
|
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
|
||||||
# ilab equipments
|
# ilab equipments
|
||||||
# - ros-humble-unilabos-msgs
|
- uni-lab::ros-humble-unilabos-msgs
|
||||||
- pip:
|
- pip:
|
||||||
- paho-mqtt
|
- paho-mqtt
|
||||||
- opentrons_shared_data
|
- opentrons_shared_data
|
||||||
|
- git+https://github.com/Xuwznln/pylabrobot
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
name: unilab
|
name: unilab
|
||||||
channels:
|
channels:
|
||||||
|
- unilab
|
||||||
- robostack
|
- robostack
|
||||||
- robostack-staging
|
- robostack-staging
|
||||||
- conda-forge
|
- conda-forge
|
||||||
@@ -63,7 +64,8 @@ dependencies:
|
|||||||
- transforms3d
|
- transforms3d
|
||||||
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
|
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
|
||||||
# ilab equipments
|
# ilab equipments
|
||||||
# - ros-humble-unilabos-msgs
|
- uni-lab::ros-humble-unilabos-msgs
|
||||||
- pip:
|
- pip:
|
||||||
- paho-mqtt
|
- paho-mqtt
|
||||||
- opentrons_shared_data
|
- opentrons_shared_data
|
||||||
|
- git+https://github.com/Xuwznln/pylabrobot
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
name: unilab
|
name: unilab
|
||||||
channels:
|
channels:
|
||||||
|
- unilab
|
||||||
- robostack
|
- robostack
|
||||||
- robostack-staging
|
- robostack-staging
|
||||||
- conda-forge
|
- conda-forge
|
||||||
@@ -61,12 +62,13 @@ dependencies:
|
|||||||
- transforms3d
|
- transforms3d
|
||||||
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
|
# ros-humble-gazebo-ros // ignored because of the conflict with ign-gazebo
|
||||||
# ilab equipments
|
# ilab equipments
|
||||||
# ros-humble-unilabos-msgs
|
- uni-lab::ros-humble-unilabos-msgs
|
||||||
# driver
|
# driver
|
||||||
#- crcmod
|
#- crcmod
|
||||||
- pip:
|
- pip:
|
||||||
- paho-mqtt
|
- paho-mqtt
|
||||||
- opentrons_shared_data
|
- opentrons_shared_data
|
||||||
|
- git+https://github.com/Xuwznln/pylabrobot
|
||||||
# driver
|
# driver
|
||||||
#- ur-rtde # set PYTHONUTF8=1
|
#- ur-rtde # set PYTHONUTF8=1
|
||||||
#- pyautogui
|
#- pyautogui
|
||||||
|
|||||||
@@ -34,9 +34,6 @@ def register_devices_and_resources(mqtt_client, lab_registry):
|
|||||||
logger.info(f"[UniLab Register] 成功通过HTTP注册 {len(resources_to_register)} 个资源 {cost_time}ms")
|
logger.info(f"[UniLab Register] 成功通过HTTP注册 {len(resources_to_register)} 个资源 {cost_time}ms")
|
||||||
else:
|
else:
|
||||||
logger.error(f"[UniLab Register] HTTP注册资源失败: {response.status_code}, {response.text} {cost_time}ms")
|
logger.error(f"[UniLab Register] HTTP注册资源失败: {response.status_code}, {response.text} {cost_time}ms")
|
||||||
|
|
||||||
time.sleep(10)
|
|
||||||
|
|
||||||
logger.info("[UniLab Register] 设备和资源注册完成.")
|
logger.info("[UniLab Register] 设备和资源注册完成.")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ from unilabos_msgs.srv import (
|
|||||||
) # type: ignore
|
) # type: ignore
|
||||||
from unique_identifier_msgs.msg import UUID
|
from unique_identifier_msgs.msg import UUID
|
||||||
|
|
||||||
|
from unilabos.app.register import register_devices_and_resources
|
||||||
from unilabos.config.config import BasicConfig
|
from unilabos.config.config import BasicConfig
|
||||||
from unilabos.registry.registry import lab_registry
|
from unilabos.registry.registry import lab_registry
|
||||||
from unilabos.resources.graphio import initialize_resource
|
from unilabos.resources.graphio import initialize_resource
|
||||||
@@ -150,11 +151,7 @@ class HostNode(BaseROS2DeviceNode):
|
|||||||
self.device_status_timestamps = {} # 用来存储设备状态最后更新时间
|
self.device_status_timestamps = {} # 用来存储设备状态最后更新时间
|
||||||
if BasicConfig.upload_registry:
|
if BasicConfig.upload_registry:
|
||||||
from unilabos.app.mq import mqtt_client
|
from unilabos.app.mq import mqtt_client
|
||||||
|
register_devices_and_resources(mqtt_client, lab_registry)
|
||||||
for device_info in lab_registry.obtain_registry_device_info():
|
|
||||||
mqtt_client.publish_registry(device_info["id"], device_info)
|
|
||||||
for resource_info in lab_registry.obtain_registry_resource_info():
|
|
||||||
mqtt_client.publish_registry(resource_info["id"], resource_info)
|
|
||||||
else:
|
else:
|
||||||
self.lab_logger().warning("本次启动注册表不报送云端,如果您需要联网调试,请使用unilab-register命令进行单独报送,或者在启动命令增加--upload_registry")
|
self.lab_logger().warning("本次启动注册表不报送云端,如果您需要联网调试,请使用unilab-register命令进行单独报送,或者在启动命令增加--upload_registry")
|
||||||
time.sleep(1) # 等待MQTT连接稳定
|
time.sleep(1) # 等待MQTT连接稳定
|
||||||
|
|||||||
Reference in New Issue
Block a user