planner_config.yaml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. # Planner 配置文件
  2. # ============================================================================
  3. # 该文件包含 planner.py 的规则引擎配置和 planner_node.py 的运行参数。
  4. # 启动时由 planner_node 通过 planner_config_loader 加载。
  5. #
  6. # 目录位置:
  7. # ROS2 包内:share/agint_brain/config/planner_config.yaml
  8. # 或通过参数 planner_config_path 指定绝对路径
  9. # ============================================================================
  10. # Planner 模式
  11. # ============================================================================
  12. # 可选值:rule / llm / hybrid
  13. # - rule: 仅使用规则引擎(不调用 LLM)
  14. # - llm: 仅使用 LLM(调用 OmniNode)
  15. # - hybrid: 优先规则,复杂意图走 LLM
  16. mode: "hybrid"
  17. # ============================================================================
  18. # Planner 核心参数
  19. # ============================================================================
  20. planner:
  21. # 默认风险等级:low / medium / high
  22. default_risk_level: "low"
  23. # 中高风险操作是否需要用户确认
  24. require_confirmation_on_medium_risk: true
  25. require_confirmation_on_high_risk: true
  26. # 单个 Plan 最大步骤数
  27. max_plan_steps: 10
  28. # 计划来源标识(用于 Plan.source 字段)
  29. default_source: "hybrid"
  30. # ============================================================================
  31. # 可用工具(Capability 列表)
  32. # ============================================================================
  33. available_tools:
  34. - "feed"
  35. - "adjust_fan"
  36. - "control_light"
  37. - "speak"
  38. - "query"
  39. - "move"
  40. - "inspect"
  41. - "turn_on"
  42. - "turn_off"
  43. - "adjust"
  44. # 工具语义描述(供 OmniNode 使用)
  45. # 格式:name, description, tool_call_type, category
  46. tool_descriptions:
  47. - name: "feed"
  48. description: "用于执行喂食动作(如宠物或牲畜喂食)"
  49. tool_call_type: "execute"
  50. category: "action"
  51. - name: "adjust_fan"
  52. description: "用于调整风扇的风力档位或开关状态"
  53. tool_call_type: "execute"
  54. category: "action"
  55. - name: "control_light"
  56. description: "用于控制灯光的开关或亮度"
  57. tool_call_type: "execute"
  58. category: "action"
  59. - name: "speak"
  60. description: "用于播报自然语言给用户,仅用于对话播报"
  61. tool_call_type: "speak"
  62. category: "dialog"
  63. - name: "query"
  64. description: "用于查询机器人系统内部状态,不代表联网查询外部实时信息"
  65. tool_call_type: "query_world"
  66. category: "query"
  67. - name: "move"
  68. description: "用于控制机器人移动到指定位置"
  69. tool_call_type: "execute"
  70. category: "action"
  71. - name: "inspect"
  72. description: "用于巡检、查看环境或检查状态"
  73. tool_call_type: "execute"
  74. category: "action"
  75. - name: "turn_on"
  76. description: "用于打开设备"
  77. tool_call_type: "execute"
  78. category: "action"
  79. - name: "turn_off"
  80. description: "用于关闭设备"
  81. tool_call_type: "execute"
  82. category: "action"
  83. - name: "adjust"
  84. description: "用于通用调节操作"
  85. tool_call_type: "execute"
  86. category: "action"
  87. # ============================================================================
  88. # 意图映射(关键词 → action)
  89. # ============================================================================
  90. intent_to_action:
  91. # 喂食相关
  92. "喂": "feed"
  93. "喂食": "feed"
  94. "喂养": "feed"
  95. # 风扇控制
  96. "打开风扇": "adjust_fan"
  97. "关闭风扇": "adjust_fan"
  98. "调整风扇": "adjust_fan"
  99. "降温": "adjust_fan"
  100. "升温": "adjust_fan"
  101. # 灯光控制
  102. "开灯": "control_light"
  103. "关灯": "control_light"
  104. "调整灯光": "control_light"
  105. # 通用开关
  106. "打开": "turn_on"
  107. "关闭": "turn_off"
  108. "启动": "turn_on"
  109. "停止": "turn_off"
  110. "调节": "adjust"
  111. # 移动
  112. "移动": "move"
  113. "前往": "move"
  114. "走到": "move"
  115. # 查询/检查
  116. "查询": "query"
  117. "查看": "query"
  118. "检查": "inspect"
  119. "巡检": "inspect"
  120. "监测": "monitor"
  121. # 语音/通知
  122. "播报": "speak"
  123. "报告": "speak"
  124. "说": "speak"
  125. "告诉": "speak"
  126. "通知": "notify"
  127. "提醒": "remind"
  128. "警告": "warn"
  129. "询问": "ask"
  130. # ============================================================================
  131. # 高风险动作列表
  132. # ============================================================================
  133. high_risk_actions:
  134. - "turn_off"
  135. - "emergency_stop"
  136. - "shutdown"
  137. - "power_off"
  138. # ============================================================================
  139. # 中风险动作列表
  140. # ============================================================================
  141. medium_risk_actions:
  142. - "adjust_fan"
  143. - "adjust"
  144. - "control_light"
  145. # ============================================================================
  146. # 确认规则
  147. # ============================================================================
  148. confirmation_rules:
  149. # 重复动作需要确认
  150. repeated_action_requires_confirmation: true
  151. # 执行器不可用时需要确认
  152. unavailable_actuator_requires_confirmation: true
  153. # 高风险需要确认(覆盖默认值)
  154. high_risk_requires_confirmation: true
  155. # 中风险需要确认(覆盖默认值)
  156. medium_risk_requires_confirmation: true
  157. # ============================================================================
  158. # Planner Node 运行时参数(也可通过 ROS2 参数传入)
  159. # ============================================================================
  160. planner_node:
  161. # Topic 配置
  162. input_world_topic: "/world/snapshot"
  163. input_asr_topic: "/asr"
  164. output_plan_topic: "/plan"
  165. llm_request_topic: "/planner/llm_request"
  166. llm_response_topic: "/planner/llm_response"
  167. planner_config_path: "planner_config.yaml"
  168. # LLM 配置
  169. llm_timeout_sec: 10.0
  170. use_llm: true
  171. default_session_id: "default"
  172. # 日志配置
  173. debug_log: true
  174. # ============================================================================
  175. # Gate 前置治理配置(可选,已迁移到 planner_gate_config.yaml)
  176. # ============================================================================
  177. # gate_rules 和 project_env 配置已迁移到独立的 planner_gate_config.yaml
  178. # 此处保留占位,便于后续扩展
  179. gate_config:
  180. # Gate 配置文件路径
  181. gate_config_path: "planner_gate_config.yaml"
  182. # 是否启用 Gate 前置治理
  183. enable_gate: true
  184. # 是否启用 Teacher Memory
  185. enable_teacher_memory: true
  186. # ============================================================================
  187. # 项目环境配置(场景相关,可切换)
  188. # ============================================================================
  189. # 此处为基础配置,详细配置见 planner_gate_config.yaml
  190. project_env:
  191. # 场景标识
  192. scene: cattle_farm_robot
  193. # 标准地点列表
  194. standard_locations:
  195. - "广场"
  196. - "大门"
  197. - "充电站"
  198. - "牛棚1号"
  199. - "牛棚2号"
  200. # 地点别名映射(用户说法 -> 标准地点)
  201. location_alias_map:
  202. "牛鹏1号": "牛棚1号"
  203. "牛鹏2号": "牛棚2号"
  204. "牛栏1号": "牛棚1号"
  205. "牛栏2号": "牛棚2号"
  206. # 机器人角色
  207. robot_role: "智能农场机器人"
  208. robot_name: "农宝"
  209. # ============================================================================
  210. # Teacher Memory 模板(基础模板,详细模板见 teaching_memory_templates.yaml)
  211. # ============================================================================
  212. # 此处为基础模板,系统会优先加载 teaching_memory_templates.yaml
  213. teaching_memory_base:
  214. # 查询类基础回复
  215. query.position: "我目前在广场。"
  216. query.status: "我当前电量充足,状态正常,随时可以工作。"
  217. query.weather: "当前天气晴朗,温度28°C,适合户外工作。"
  218. query.identity: "我是农宝,智能农场机器人,为您服务。"