新增注册表补全功能,修复Protocol执行失败

This commit is contained in:
Xuwznln
2025-06-27 23:45:05 +08:00
parent f9a9e91d56
commit bbc49e9aab
39 changed files with 21761 additions and 3336 deletions

View File

@@ -567,6 +567,7 @@ class HostNode(BaseROS2DeviceNode):
def send_goal(
self,
device_id: str,
action_type: str,
action_name: str,
action_kwargs: Dict[str, Any],
goal_uuid: Optional[str] = None,
@@ -577,11 +578,26 @@ class HostNode(BaseROS2DeviceNode):
Args:
device_id: 设备ID
action_type: 动作类型
action_name: 动作名称
action_kwargs: 动作参数
goal_uuid: 目标UUID如果为None则自动生成
server_info: 服务器发送信息,包含发送时间戳等
"""
action_id = f"/devices/{device_id}/{action_name}"
if action_type.startswith("UniLabJsonCommand"):
if action_name.startswith("auto-"):
action_name = action_name[5:]
action_id = f"/devices/{device_id}/_execute_driver_command"
action_kwargs = {
"string": json.dumps({
"function_name": action_name,
"function_args": action_kwargs,
})
}
if action_type.startswith("UniLabJsonCommandAsync"):
action_id = f"/devices/{device_id}/_execute_driver_command_async"
else:
action_id = f"/devices/{device_id}/{action_name}"
if action_name == "test_latency" and server_info is not None:
self.server_latest_timestamp = server_info.get("send_timestamp", 0.0)
if action_id not in self._action_clients: