bump version & protocol fix

This commit is contained in:
Xuwznln
2025-06-12 21:21:25 +08:00
parent 96f37b3b0d
commit 11e4f053f1
10 changed files with 197 additions and 253 deletions

View File

@@ -601,10 +601,10 @@ class BaseROS2DeviceNode(Node, Generic[T]):
goal = goal_handle.request
# 从目标消息中提取参数, 并调用对应的方法
if "sequence" in self._action_value_mappings:
if "sequence" in action_value_mapping:
# 如果一个指令对应函数的连续调用,如启动和等待结果,默认参数应该属于第一个函数调用
def ACTION(**kwargs):
for i, action in enumerate(self._action_value_mappings["sequence"]):
for i, action in enumerate(action_value_mapping["sequence"]):
if i == 0:
self.lab_logger().info(f"执行序列动作第一步: {action}")
self.get_real_function(self.driver_instance, action)[0](**kwargs)
@@ -612,9 +612,7 @@ class BaseROS2DeviceNode(Node, Generic[T]):
self.lab_logger().info(f"执行序列动作后续步骤: {action}")
self.get_real_function(self.driver_instance, action)[0]()
action_paramtypes = get_type_hints(
self.get_real_function(self.driver_instance, self._action_value_mappings["sequence"][0])
)[1]
action_paramtypes = self.get_real_function(self.driver_instance, action_value_mapping["sequence"][0])[1]
else:
ACTION, action_paramtypes = self.get_real_function(self.driver_instance, action_name)

View File

@@ -256,12 +256,12 @@ class ROS2ProtocolNode(BaseROS2DeviceNode):
return write_func(*args, **kwargs)
if read_method:
bound_read = MethodType(_read, device.driver_instance)
setattr(device.driver_instance, read_method, bound_read)
# bound_read = MethodType(_read, device.driver_instance)
setattr(device.driver_instance, read_method, _read)
if write_method:
bound_write = MethodType(_write, device.driver_instance)
setattr(device.driver_instance, write_method, bound_write)
# bound_write = MethodType(_write, device.driver_instance)
setattr(device.driver_instance, write_method, _write)
async def _update_resources(self, goal, protocol_kwargs):