{
 "assets": {
  "named_locations": [
   {
    "id": "bin_a",
    "label": "A 箱"
   },
   {
    "id": "bin_b",
    "label": "B 箱"
   }
  ],
  "target_maps": [
   {
    "diagram": {
     "height_px": 240,
     "note": "示意圖；類別是示範資料",
     "shapes": [
      {
       "h": 240,
       "kind": "outline",
       "label": "托盤",
       "w": 360,
       "x": 0,
       "y": 0
      }
     ],
     "width_px": 360
    },
    "frame": {
     "id": "tray",
     "origin": "托盤左下角",
     "unit": "mm",
     "x_axis": "沿長邊向右",
     "y_axis": "沿短邊向上",
     "z_axis": "朝上"
    },
    "groups": [
     {
      "id": "row_front",
      "kind": "row",
      "label": "前排"
     },
     {
      "id": "row_back",
      "kind": "row",
      "label": "後排"
     }
    ],
    "id": "tray_v1",
    "known_limitations": [
     "托盤內容固定，不會因為搬走而更新"
    ],
    "label": "六格零件托盤",
    "localization_subject": "tray",
    "revision": "v1",
    "targets": [
     {
      "attributes": {
       "category": "red",
       "slot": 1
      },
      "display": {
       "r_px": 18,
       "x_px": 60,
       "y_px": 180
      },
      "group": "row_front",
      "id": "tray_v1.s1",
      "label": "格 1 紅色零件",
      "local": {
       "x": 20,
       "y": 20,
       "z": 8
      }
     },
     {
      "attributes": {
       "category": "blue",
       "slot": 2
      },
      "display": {
       "r_px": 18,
       "x_px": 180,
       "y_px": 180
      },
      "group": "row_front",
      "id": "tray_v1.s2",
      "label": "格 2 藍色零件",
      "local": {
       "x": 60,
       "y": 20,
       "z": 8
      }
     },
     {
      "attributes": {
       "category": "metal",
       "slot": 3
      },
      "display": {
       "r_px": 18,
       "x_px": 300,
       "y_px": 180
      },
      "group": "row_front",
      "id": "tray_v1.s3",
      "label": "格 3 金屬零件",
      "local": {
       "x": 100,
       "y": 20,
       "z": 8
      }
     },
     {
      "attributes": {
       "category": "red",
       "slot": 4
      },
      "display": {
       "r_px": 18,
       "x_px": 60,
       "y_px": 60
      },
      "group": "row_back",
      "id": "tray_v1.s4",
      "label": "格 4 紅色零件",
      "local": {
       "x": 20,
       "y": 60,
       "z": 8
      }
     },
     {
      "attributes": {
       "category": "red",
       "slot": 5
      },
      "display": {
       "r_px": 18,
       "x_px": 180,
       "y_px": 60
      },
      "group": "row_back",
      "id": "tray_v1.s5",
      "label": "格 5 紅色零件",
      "local": {
       "x": 60,
       "y": 60,
       "z": 8
      }
     },
     {
      "attributes": {
       "category": "blue",
       "slot": 6
      },
      "display": {
       "r_px": 18,
       "x_px": 300,
       "y_px": 60
      },
      "group": "row_back",
      "id": "tray_v1.s6",
      "label": "格 6 藍色零件",
      "local": {
       "x": 100,
       "y": 60,
       "z": 8
      }
     }
    ]
   }
  ]
 },
 "compatibility": {
  "camera_requirements": {
   "note": "v1 的類別來自托盤示範資料；真實分類需要相機與分類模型",
   "required": false
  },
  "required_capabilities": [
   "mock_motion",
   "mock_fixture_localization",
   "mock_gripper"
  ],
  "robot_profiles": [
   "ras_6dof_mock_v1"
  ],
  "runtime_requirements": {
   "min_platform_version": 1
  },
  "tool_profile": "gripper_mock_v1"
 },
 "constraints": {
  "allowed_modes": [
   "mock"
  ],
  "required_settings": [
   {
    "kind": "tool_mounted",
    "tool_profile": "gripper_mock_v1"
   },
   {
    "kind": "localized",
    "subject": "tray"
   },
   {
    "kind": "workcell_location",
    "location": "bin_a"
   },
   {
    "kind": "workcell_location",
    "location": "bin_b"
   }
  ],
  "tool_limits": {
   "heating": "forbidden",
   "max_height_mm": 80,
   "min_height_mm": 20
  }
 },
 "interaction": {
  "confirmation": {
   "highlight_steps": [
    "grasp",
    "release"
   ],
   "required": true,
   "text": "確認後，MOCK 執行端會依序夾起下列零件並放進箱子。只是模擬，夾爪不會動。"
  },
  "fields": [
   {
    "id": "preset_id",
    "label": "預設任務",
    "required": false,
    "type": "preset_choice"
   },
   {
    "choices": [
     {
      "aliases": [
       "紅"
      ],
      "label": "紅色",
      "value": "red"
     },
     {
      "aliases": [
       "藍"
      ],
      "label": "藍色",
      "value": "blue"
     },
     {
      "aliases": [
       "鐵"
      ],
      "label": "金屬",
      "value": "metal"
     }
    ],
    "id": "categories",
    "label": "零件類別",
    "max_items": 3,
    "min_items": 1,
    "required": true,
    "type": "multi_choice"
   },
   {
    "id": "destination",
    "label": "放到",
    "locations": [
     "bin_a",
     "bin_b"
    ],
    "required": true,
    "type": "named_location"
   },
   {
    "default": 6,
    "id": "max_items",
    "integer": true,
    "label": "最多幾個",
    "max": 6,
    "min": 1,
    "required": true,
    "step": 1,
    "type": "number",
    "unit": "個"
   },
   {
    "id": "batch_label",
    "label": "批次標籤（寫進紀錄）",
    "max_length": 40,
    "required": false,
    "type": "text"
   }
  ],
  "steps": [
   {
    "fields": [
     "preset_id"
    ],
    "id": "preset",
    "kind": "fields",
    "title": "選擇預設任務（可略過）"
   },
   {
    "fields": [
     "categories",
     "destination"
    ],
    "id": "what",
    "kind": "fields",
    "title": "要分哪些、放哪裡"
   },
   {
    "fields": [
     "max_items",
     "batch_label"
    ],
    "id": "limits",
    "kind": "fields",
    "title": "數量與批次標籤"
   },
   {
    "id": "review",
    "kind": "summary",
    "title": "檢查摘要"
   }
  ],
  "text_commands": {
   "language": "zh-TW",
   "prefixes": [
    "請",
    "幫我"
   ],
   "rules": [
    {
     "action": {
      "into_field": "preset_id",
      "kind": "select_preset"
     },
     "id": "preset",
     "pattern": "預設 {preset}",
     "slots": {
      "preset": "preset"
     }
    },
    {
     "action": {
      "into_field": "categories",
      "kind": "set_choice"
     },
     "choice_field": "categories",
     "id": "category",
     "pattern": "分 {cat}",
     "slots": {
      "cat": "choice"
     }
    }
   ]
  }
 },
 "metadata": {
  "author": {
   "contact": null,
   "name": "RAS 範例技能"
  },
  "description": "從零件托盤挑出指定類別的零件，放進指定的箱子。只有 MOCK：托盤內容是作者提供的示範資料，不是相機辨識結果。",
  "execution_modes": [
   "mock"
  ],
  "license": "MIT",
  "skill_id": "ras.object_sorting",
  "tags": [
   "分類",
   "取放",
   "示範",
   "MOCK"
  ],
  "title": "指定物件分類（MOCK）",
  "version": "0.1.0"
 },
 "perception": {
  "notes": [
   "零件類別是作者提供的示範資料，沒有辨識"
  ],
  "subjects": [
   {
    "id": "tray",
    "input": {
     "kind": "operator_confirmation",
     "note": "操作員確認托盤已放在 MOCK 位置"
    },
    "max_age_s": 600,
    "method": "mock_fixture",
    "on_missing": "refuse",
    "on_stale": "refuse",
    "on_untrusted": "refuse",
    "output": {
     "frame": "robot_base",
     "pose_of": "tray",
     "unit": "m"
    },
    "what": "放在固定位置的零件托盤"
   }
  ]
 },
 "presets": [
  {
   "aliases": [
    "紅色"
   ],
   "editable_fields": [
    "max_items",
    "batch_label"
   ],
   "id": "red_to_a",
   "label": "紅色零件放 A 箱",
   "params": {
    "categories": [
     "red"
    ],
    "destination": "bin_a",
    "max_items": 6
   }
  },
  {
   "editable_fields": [
    "batch_label"
   ],
   "id": "blue_to_b_two",
   "label": "藍色零件放 B 箱（最多 2 個）",
   "params": {
    "categories": [
     "blue"
    ],
    "destination": "bin_b",
    "max_items": 2
   }
  }
 ],
 "schema_version": 1,
 "target_mapping": {
  "rules": [
   {
    "attribute": "category",
    "from": "attribute_filter",
    "limit_field": "max_items",
    "map": "tray_v1",
    "values_field": "categories"
   }
  ]
 },
 "testing": {
  "author_provided_only": true,
  "known_limitations": [
   "沒有相機辨識",
   "夾取力與物件重量都沒有模擬"
  ],
  "modes_tested": [
   "mock"
  ],
  "scenarios": [
   {
    "description": "紅色零件全部放 A 箱，MOCK 執行成功",
    "id": "red_to_a"
   }
  ]
 },
 "workflow": {
  "steps": [
   {
    "id": "check_tray",
    "label": "確認托盤已定位（MOCK）",
    "subject": "tray",
    "type": "require_localization"
   },
   {
    "id": "per_item",
    "label": "逐個零件",
    "steps": [
     {
      "height_mm": 40,
      "id": "approach",
      "label": "移到零件上方",
      "on_failure": "abort",
      "timeout_s": 10,
      "type": "move_above_target"
     },
     {
      "id": "grasp",
      "label": "夾取（MOCK）",
      "on_failure": "skip_target",
      "retry": {
       "max_attempts": 2
      },
      "timeout_s": 5,
      "type": "mock_grasp"
     },
     {
      "height_mm": 60,
      "id": "carry",
      "label": "移到箱子上方",
      "location": {
       "param": "destination"
      },
      "on_failure": "abort",
      "timeout_s": 10,
      "type": "move_to_named_location"
     },
     {
      "id": "release",
      "label": "放開（MOCK）",
      "on_failure": "abort",
      "timeout_s": 5,
      "type": "mock_release"
     }
    ],
    "type": "for_each_target"
   },
   {
    "id": "finish",
    "label": "回到安全位置",
    "timeout_s": 10,
    "type": "return_to_safe"
   }
  ]
 }
}