Gimbal Color Detectのロゴ

Gimbal Color Detect

組織
espressif
gimbal_color_detect

Use the camera and ESP-DL-backed color_detect Lua module to identify a target object's color, track that color, show the camera preview on the LCD, draw a bounding box, and drive X/Y gimbal servos toward the target center.

概要

公開者espressif
リポジトリesp-claw-skills-lab
スキル名gimbal_color_detect
スター
37
フォーク
19
同梱ファイル
1
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    espressifがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Gimbal Color Detect」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/espressif/esp-claw-skills-lab/tree/master/skills/gimbal_color_detect
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/espressif/esp-claw-skills-lab.git /tmp/esp-claw-skills-lab
mkdir -p .claude/skills
cp -r /tmp/esp-claw-skills-lab/skills/gimbal_color_detect .claude/skills/gimbal_color_detect
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでGimbal Color Detectを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にGimbal Color Detectを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Gimbal Color Detectは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Gimbal Color Detect

Use this skill when the user wants esp-claw to use the camera as a visual servo target tracker.

Visible Object Rule

If the user asks to track "this object", "the object in front", "the thing in front", "这个物体", "前面这个东西", or any other visible object without naming a specific color, you MUST NOT start color tracking directly and MUST NOT fall back to the default green preset. First use the take_picture skill to capture the object, inspect the saved photo with AI vision, identify the intended foreground object's dominant visible color, tell the user the recognized color, and only then start this color tracking script with the recognized color.

If the recognized color is one of the built-in presets, pass only target_color_name. If it is not a preset, ask AI vision to return an HSV range and pass target_h_min, target_h_max, target_s_min, target_s_max, target_v_min, and target_v_max.

The built-in green preset is used only when the user gives no color and also does not refer to a specific visible object. HSV thresholds match ESP-DL: hue uses 0..180, saturation uses 0..255, and value uses 0..255. If target_h_min > target_h_max, the script treats the hue range as wrapping through 0, which is useful for red targets.

Preview display follows the esp-hello-new/examples/gimbal_base camera path by default: crop a centered 240x240 square from the board-default camera stream, and draw it centered on the 284x240 LCD. Detection runs on that same centered crop so off-screen colors do not affect the tracked box. Each display frame uses screen:begin(), draws the image and overlay, then submits with screen:present({ full = true }). Camera discovery uses camera.list_devices(); the built-in screen is opened with display.open().

Default Hardware

  • Camera device: from camera.list_devices()
  • Camera stream: board default mode from camera.open(dev_path)
  • LCD panel: from display.open()
  • X servo GPIO: 4
  • Y servo GPIO: 5
  • PWM driver: ledc, 50 Hz, 500 us .. 2500 us
  • X angle range: 0 .. 180, initial 90
  • Y angle range: 10 .. 70, initial 50
  • Runtime shape: a single async Lua job owns camera, LCD, color detection, and X/Y LEDC servos.

Start Script Args Schema

json
{
  "type": "object",
  "properties": {
    "run_seconds": {
      "type": "integer",
      "default": 0,
      "description": "0 means run until the async Lua job is stopped."
    },
    "frame_interval_ms": {
      "type": "integer",
      "default": 0,
      "description": "Extra delay after each frame. Keep 0 for maximum camera/display throughput."
    },
    "display_every_n": {
      "type": "integer",
      "default": 1
    },
    "perf_log_every_n": {
      "type": "integer",
      "default": 10,
      "description": "Print average get/convert/detect/display/loop timing every N frames. Set 0 to disable."
    },
    "display_crop_size": {
      "type": "integer",
      "default": 240,
      "description": "Centered square crop size before drawing to the LCD."
    },
    "detect_stride": {
      "type": "integer",
      "default": 4,
      "description": "Kept for compatibility. ESP-DL color detection evaluates the HSV mask for the selected source crop."
    },
    "detect_min_pixels": {
      "type": "integer",
      "default": 250,
      "description": "Minimum connected-component size, matching the ESP-DL gimbal_base detector scale."
    },
    "detect_max_blob_percent": {
      "type": "integer",
      "default": 35,
      "description": "Reject connected components larger than this percentage of the display crop."
    },
    "target_color_name": {
      "type": "string",
      "default": "green",
      "description": "Registered target color name. Built-in presets: red, orange, yellow, green, cyan, blue, purple."
    },
    "target_h_min": {
      "type": "integer",
      "description": "Custom registered target hue lower bound, 0..180. Required only when target_color_name is not a built-in preset."
    },
    "target_h_max": {
      "type": "integer",
      "description": "Custom registered target hue upper bound, 0..180. Values lower than target_h_min wrap through 0."
    },
    "target_s_min": {
      "type": "integer",
      "description": "Custom registered target saturation lower bound, 0..255."
    },
    "target_s_max": {
      "type": "integer",
      "description": "Custom registered target saturation upper bound, 0..255."
    },
    "target_v_min": {
      "type": "integer",
      "description": "Custom registered target value lower bound, 0..255."
    },
    "target_v_max": {
      "type": "integer",
      "description": "Custom registered target value upper bound, 0..255."
    },
    "deadzone_px": {
      "type": "integer",
      "default": 12
    },
    "x_gain": {
      "type": "number",
      "default": 0.035
    },
    "y_gain": {
      "type": "number",
      "default": 0.035
    },
    "max_track_step_degrees": {
      "type": "number",
      "default": 2
    },
    "x_gpio": {
      "type": "integer",
      "default": 4
    },
    "y_gpio": {
      "type": "integer",
      "default": 5
    },
    "servo_max_step_degrees": {
      "type": "number",
      "default": 2
    }
  }
}

Tool Call Inputs

Start color tracking:

json
{
  "path": "{CUR_SKILL_DIR}/scripts/start_gimbal_color_detect.lua",
  "args": {},
  "timeout_ms": 0,
  "name": "gimbal_color_detect",
  "exclusive": "gimbal_color_detect",
  "replace": false
}

Start tracking a built-in blue preset:

json
{
  "path": "{CUR_SKILL_DIR}/scripts/start_gimbal_color_detect.lua",
  "args": {
    "target_color_name": "blue"
  },
  "timeout_ms": 0,
  "name": "gimbal_color_detect",
  "exclusive": "gimbal_color_detect",
  "replace": false
}

Start tracking a custom AI-returned color:

json
{
  "path": "{CUR_SKILL_DIR}/scripts/start_gimbal_color_detect.lua",
  "args": {
    "target_color_name": "custom teal",
    "target_h_min": 78,
    "target_h_max": 92,
    "target_s_min": 64,
    "target_s_max": 255,
    "target_v_min": 46,
    "target_v_max": 255
  },
  "timeout_ms": 0,
  "name": "gimbal_color_detect",
  "exclusive": "gimbal_color_detect",
  "replace": false
}

When the user says "track this object" / "追踪这个物体", activate the take_picture skill and follow its own script instructions. Pass filename: "gimbal_target.jpg" and skip_frames: 3; resolve its script path from that skill's directory, not this package.

After this call returns the saved JPEG path, inspect that image with AI vision. Then start start_gimbal_color_detect.lua using the recognized preset color or custom HSV range. Do not skip the photo and do not start with empty args for a visible-object request.

Stop color tracking:

json
{
  "name": "gimbal_color_detect",
  "wait_ms": 2000
}

Recommended Flow

  1. Activate board_hardware_info first when the user wants pin validation.
  2. If the user refers to a visible object instead of naming a color, run the take_picture skill first. Use a simple filename such as gimbal_target.jpg.
  3. Inspect the saved photo with AI vision and identify the intended foreground object's dominant visible color.
  4. Tell the user the recognized color before starting tracking.
  5. If the recognized color is one of red, orange, yellow, green, cyan, blue, or purple, register it by passing only target_color_name.
  6. If the recognized color is not one of those presets, ask AI vision for a practical HSV range and register it with target_color_name plus target_h_min, target_h_max, target_s_min, target_s_max, target_v_min, and target_v_max.
  7. If the user gives no color and does not refer to a specific visible object, run the tracker with no color args; it defaults to the built-in green preset.
  8. Run the tracking script with lua_run_script_async.
  9. Use timeout_ms: 0, name: "gimbal_color_detect", exclusive: "gimbal_color_detect", and replace: false.
  10. Tune x_gain / y_gain signs if servo direction is reversed on a specific mount.

Color Registration Hints

The script has built-in presets for these colors. When AI identifies one of these names, pass only target_color_name; do not pass HSV values unless you need to override the preset for local lighting. For red, the preset uses a hue range that wraps through 0. Chinese names 红色, 橙色, 黄色, 绿色, 青色, 蓝色, and 紫色 are accepted as aliases.

Colortarget_h_mintarget_h_maxNotes
red17010Wraps through 0
orange824Often needs higher target_s_min
yellow2240Sensitive to warm lighting
green5088Default when no color is specified
cyan82100Narrow if blue objects also appear
blue95130Use lower target_v_min for dark blue
purple128158Includes violet/magenta edge

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Gimbal Color Detect」では何ができますか?

Use the camera and ESP-DL-backed color_detect Lua module to identify a target object's color, track that color, show the camera preview on the LCD, draw a bounding box, and drive X/Y gimbal servos toward the target center.

TypingMindでGimbal Color Detectを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Gimbal Color Detectはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにGimbal Color Detectをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/espressif/esp-claw-skills-lab/tree/master/skills/gimbal_color_detectを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Gimbal Color Detectを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Gimbal Color Detectで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもGimbal Color Detectを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Gimbal Color Detect」は無料ですか?

はい。espressifがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇