Skip to content

merge: dev → lab_2_isacc_sim(设备锁/action-lock 上报 + 调度)#297

Open
Skyzuo9 wants to merge 19 commits into
lab_2_isacc_simfrom
merge/dev-into-lab2
Open

merge: dev → lab_2_isacc_sim(设备锁/action-lock 上报 + 调度)#297
Skyzuo9 wants to merge 19 commits into
lab_2_isacc_simfrom
merge/dev-into-lab2

Conversation

@Skyzuo9

@Skyzuo9 Skyzuo9 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

目的

test 后端已升级为强制 device_lock(执行前获取设备锁)。edge 需向后端上报
report_action_lock 快照(含 UniLabJsonCommand 动作),否则 acquire device lock failed (30052)
该子系统在 dev 上,lab_2_isacc_sim 缺失(lab_2 只有 always_free 队列、无 action-lock 上报)。
本 PR 将 dev 合入 lab_2_isacc_sim,补齐设备锁/调度。

冲突解决(5 文件)

  • app/ws_client.py:取 dev 设备锁协议(report_all_action_locks/report_action_lock/is_action_busy,host_ready 前先发锁快照);删除 lab_2 已被 dev 取代的 JobInfo.set_ready_timeout/is_ready_timeout(无 ready_timeout 字段、无调用;dev 用 refresh_ready_timeouts)。
  • ros/nodes/presets/host_node.py:两侧都留——lab_2(PR#292)本地图设备补建 _execute_driver_command(_async) 基础 ActionClient + dev 的 new_action_pairs 全量锁上报。
  • registry/registry.py:同时保留 apply_simulation_meta(lab_2 sim)与 validate_init_param_enforce(dev,registry.py:1907 有调用)。
  • ros/initialize_device.py:取 lab_2 版(real/sim/twin/pair 关键路径);dev 的 init_enforce merge 对未声明 init_param_enforce 的设备无影响,registry 侧 validate 仍独立生效。
  • app/main.py:去重 lab_2 Plan09 外源 registry 发现块 + 恢复被合并吞掉的 if workflow_upload: + 合入 dev 的 use_remote_resource 检查(用 .get() 防 KeyError)。

验证

  • 5 冲突文件 + app/registry/ros/sim 全区域 py_compile/compileall 通过。
  • 4090 真实环境:merge 分支启动成功——成功注册 109 设备/135 资源、连上 wss://.../ws/schedule,dev 新增 client/* 依赖无 import 报错。
  • 端到端 device_lock(单 edge、对齐工作流实验室 ak/sk):下发应发 report_action_lock、不再 30052、RViz 联动。

备注

  • edge-only;不改 cloud 前端 / Go backend。
  • PF400(feat/pf400-fullstack,领先 lab_2 1 提交)未含;lab_2 合入本 PR 后需将 PF400 rebase 到新 lab_2。

Made with Cursor

TablewareBox and others added 19 commits June 17, 2026 14:16
Normalize missing init_param_enforce to an empty object so registry schema contracts do not prevent devices from loading.

Co-authored-by: Cursor <cursoragent@cursor.com>
…evice discovery

Co-authored-by: Cursor <cursoragent@cursor.com>
…d in action locks

Action locks now report the full invokable action set from _action_value_mappings, including @action(auto_prefix=True) 'auto-*' actions (e.g. workbench prepare_materials/heating/move) that were previously dropped by the 'auto-' filter. Only the generic _execute_driver_command[_async] command channels are excluded.

Applied across all three lock-report paths: report_all_action_locks (host_ready full snapshot), _create_action_clients_for_device (device discovery), and initialize_device (local device startup, which previously reported zero locks for JsonCommand/auto- only devices like workbench).

Co-authored-by: Cursor <cursoragent@cursor.com>
Use action lock reports as the source of callable actions so host readiness does not publish mismatched action sets.

Co-authored-by: Cursor <cursoragent@cursor.com>
Default resources land at 000 and falsely match by position; rely on occupied_by instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
将 dev 的调度/设备锁子系统合入 lab_2:后端已强制 device_lock,edge 需向后端
上报 report_action_lock 快照(含 UniLabJsonCommand 动作),否则 acquire device
lock 失败(30052)。

冲突解决:
- ws_client.py: 取 dev 版设备锁协议(report_all_action_locks/report_action_lock/
  is_action_busy),删除 lab_2 已被 dev 机制取代的 JobInfo.set_ready_timeout/
  is_ready_timeout(dev 用 refresh_ready_timeouts,且无 ready_timeout 字段)。
- host_node.py: 保留双方——lab_2(PR#292) 本地图设备补建 _execute_driver_command
  (_async) 基础 ActionClient + dev 的 new_action_pairs 全量锁上报。
- registry.py: 同时保留 apply_simulation_meta(lab_2 sim)与 validate_init_param_enforce(dev)。
- initialize_device.py: 取 lab_2 版(sim real/twin/pair 关键路径);dev 的 init_enforce
  merge 对未声明 init_param_enforce 的设备无影响,registry 侧 validate 仍独立生效。
- main.py: 去重 lab_2 Plan09 外源 registry 发现块 + 恢复丢失的 if workflow_upload:
  + 合入 dev 的 use_remote_resource 检查。

Co-authored-by: Cursor <cursoragent@cursor.com>
非 moveit 设备(STX110/PF400)的 --visual rviz 走 view_robot_lite.rviz,
但该文件从未创建 -> rviz2 -d 缺失文件回退默认配置(Fixed Frame=map/无 RobotModel)。
补一个含 Grid+TF+RobotModel(topic /robot_description)、Fixed Frame=world 的精简配置,
使单条 --visual rviz 命令即可显示模型。

Co-authored-by: Cursor <cursoragent@cursor.com>
initialize_device._lookup_registry_class 在 class 不在注册表时 import
unilabos.registry.community_alias.normalize_community_class,但该模块从未创建
(lab_2/dev 均无)-> 社区/别名设备(如 community.pylabrobot_unilab.liconic_stx110
经短别名 liconic_stx110 引用)初始化时 ModuleNotFoundError 崩溃。
补上双向归一化(短别名<->community.<ns>.<id>)。

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

3 participants