mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-17 13:01:12 +00:00
* add 3d visualization * 完成在main中启动设备可视化 完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model 添加物料模型管理类,遍历物料与resource_model,完成TF数据收集 * 完成TF发布 * 修改模型方向,在yaml中添加变换属性 * 添加物料tf变化时,发送topic到前端 另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题 * 添加关节发布节点与物料可视化节点进入unilab * 使用json启动plr与3D模型仿真 * 完成启动OT并联动rviz * add 3d visualization * 完成在main中启动设备可视化 完成在main中启动设备可视化,并输出物料ID:mesh的对应关系resource_model 添加物料模型管理类,遍历物料与resource_model,完成TF数据收集 * 完成TF发布 * 修改模型方向,在yaml中添加变换属性 * 添加物料tf变化时,发送topic到前端 另外修改了物料初始化的方法,防止在tf还未发布时提前建立物料模型与发布话题 * 添加关节发布节点与物料可视化节点进入unilab * 使用json启动plr与3D模型仿真 * 完成启动OT并联动rviz * 修复rviz位置问题, 修复rviz位置问题, 在无tf变动时减缓发送频率 在backend中添加物料跟随方法 * fix: running logic * fix: running logic * fix: missing ot * 在main中直接初始化republisher和物料的mesh节点 * 将joint_republisher和resource_mesh_manager添加进 main_slave_run.py中 --------- Co-authored-by: zhangshixiang <@zhangshixiang> Co-authored-by: wznln <18435084+Xuwznln@users.noreply.github.com>
40 lines
1.3 KiB
Python
40 lines
1.3 KiB
Python
import threading
|
|
|
|
from unilabos.utils import logger
|
|
|
|
|
|
# 根据选择的 backend 启动相应的功能
|
|
def start_backend(
|
|
backend: str,
|
|
devices_config: dict = {},
|
|
resources_config: dict = {},
|
|
graph=None,
|
|
controllers_config: dict = {},
|
|
bridges=[],
|
|
without_host: bool = False,
|
|
visual: str = "None",
|
|
resources_mesh_config: dict = {},
|
|
**kwargs
|
|
):
|
|
if backend == "ros":
|
|
# 假设 ros_main, simple_main, automancer_main 是不同 backend 的启动函数
|
|
from unilabos.ros.main_slave_run import main, slave # 如果选择 'ros' 作为 backend
|
|
elif backend == 'simple':
|
|
# 这里假设 simple_backend 和 automancer_backend 是你定义的其他两个后端
|
|
# from simple_backend import main as simple_main
|
|
pass
|
|
elif backend == 'automancer':
|
|
# from automancer_backend import main as automancer_main
|
|
pass
|
|
else:
|
|
raise ValueError(f"Unsupported backend: {backend}")
|
|
|
|
backend_thread = threading.Thread(
|
|
target=main if not without_host else slave,
|
|
args=(devices_config, resources_config, graph, controllers_config, bridges, visual, resources_mesh_config),
|
|
name="backend_thread",
|
|
daemon=True,
|
|
)
|
|
backend_thread.start()
|
|
logger.info(f"Backend {backend} started.")
|