execute_collaborative_task
Execute multi-robot collaborative tasks by providing a task ID to coordinate Universal Robots for synchronized operations.
Instructions
执行多机器人协同任务
参数:
- task_id: 任务ID
返回:
- 执行结果
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes |
Implementation Reference
- This is the main handler function for the 'execute_collaborative_task' MCP tool. It is decorated with @mcp.tool(), which registers it as a tool. The function checks if the multi-robot coordinator is initialized, executes the task with the given task_id, and returns the result or an error message.def execute_collaborative_task(task_id: str): """ 执行多机器人协同任务 参数: - task_id: 任务ID 返回: - 执行结果 """ try: if multi_robot_coordinator is None: return return_msg("多机器人协调器未初始化") # 执行任务 result = multi_robot_coordinator.execute_task(task_id) return return_msg(f"协同任务执行结果: {result}") except Exception as e: logger.error(f"执行协同任务失败: {str(e)}") return return_msg(f"执行协同任务失败: {str(e)}")