update todo

This commit is contained in:
Xuwznln
2025-10-11 13:53:17 +08:00
parent 25d46dc9d5
commit c8d16c7024
6 changed files with 11 additions and 15 deletions

View File

@@ -189,8 +189,8 @@ def slave(
# 只有二级子设备
if sub_node.res_content.type != "device":
device_tracker = devices_instances[node.res_content.id].resource_tracker
resource_instance = device_tracker.figure_resource( # todo: 要换成uuid进行figure
{"name": sub_node.res_content.name})
resource_instance = device_tracker.figure_resource(
{"uuid": sub_node.res_content.uuid})
device_tracker.loop_update_uuid(resource_instance, uuid_mapping)
else:
logger.error("Slave模式不允许新增非设备节点下的物料")

View File

@@ -256,9 +256,10 @@ class BaseROS2DeviceNode(Node, Generic[T]):
node_name: str
namespace: str
# TODO 要删除,添加时间相关的属性,避免动态添加属性的警告
time_spent = 0.0
time_remaining = 0.0
# 内部共享变量
_time_spent = 0.0
_time_remaining = 0.0
# 是否创建Action
create_action_server = True
def __init__(
@@ -998,8 +999,8 @@ class BaseROS2DeviceNode(Node, Generic[T]):
goal_handle.canceled()
return action_type.Result()
self.time_spent = time.time() - time_start
self.time_remaining = time_overall - self.time_spent
self._time_spent = time.time() - time_start
self._time_remaining = time_overall - self._time_spent
# 发布反馈
feedback_values = {}
@@ -1393,7 +1394,6 @@ class ROS2DeviceNode:
or driver_class.__name__ == "PRCXI9300Handler"
)
# TODO: 要在创建之前预先请求服务器是否有当前id的物料放到resource_tracker中让pylabrobot进行创建
# 创建设备类实例
if use_pylabrobot_creator:
# 先对pylabrobot的子资源进行加载不然subclass无法认出

View File

@@ -260,8 +260,8 @@ class HostNode(BaseROS2DeviceNode):
if sub_node.res_content.type != "device":
# slave节点走c2s更新接口拿到add自行update uuid
device_tracker = self.devices_instances[node.res_content.id].resource_tracker
resource_instance = device_tracker.figure_resource( # todo: 要换成uuid进行figure
{"name": sub_node.res_content.name})
resource_instance = device_tracker.figure_resource(
{"uuid": sub_node.res_content.uuid})
device_tracker.loop_update_uuid(resource_instance, uuid_mapping)
else:
try: