take_picture
GitHub用于调用板载摄像头拍摄单张照片并保存为JPEG文件。需先确认硬件信息,执行Lua脚本获取图片路径、大小及分辨率等元数据。
触发场景
安装
npx skills add espressif/esp-claw --skill take_picture -g -y
SKILL.md
Frontmatter
{
"name": "take_picture",
"metadata": {
"cap_groups": [
"cap_lua"
]
},
"description": "Take one photo with the first available video camera and save it as a JPEG file."
}
Take Picture
Use this skill when the user asks to take a photo, capture a picture, snap an image, or save a camera still.
Run exactly one script with lua_run_script.
If lua_run_script returns an error, report that error directly to the user.
Do not retry with changed arguments or run another camera script in the same turn unless the user explicitly asks.
Script Args Schema
{
"type": "object",
"properties": {
"filename": {
"type": "string",
"default": "capture.jpg",
"description": "JPEG filename to create under the storage root or under dir."
},
"dir": {
"type": "string",
"default": "",
"description": "Optional single directory name under the storage root."
},
"timeout_ms": {
"type": "integer",
"default": 3000,
"minimum": 0
},
"skip_frames": {
"type": "integer",
"default": 3,
"minimum": 0,
"description": "Number of warm-up frames to discard before saving the photo."
}
}
}
Path rules:
filenamemust be a simple.jpgor.jpegfilename.filenamemust not contain/,\, or...diris optional and must be a single directory name under the storage root.dirmust not contain/,\, or...
Tool Call Inputs
Take a photo with the default output name:
{"path":"{CUR_SKILL_DIR}/scripts/take_picture.lua","args":{}}
Take a photo with a custom filename:
{"path":"{CUR_SKILL_DIR}/scripts/take_picture.lua","args":{"filename":"photo.jpg"}}
Take a photo into a storage-root-relative directory:
{"path":"{CUR_SKILL_DIR}/scripts/take_picture.lua","args":{"dir":"photos","filename":"latest.jpg","timeout_ms":5000}}
Take a photo after discarding more warm-up frames:
{"path":"{CUR_SKILL_DIR}/scripts/take_picture.lua","args":{"filename":"stable.jpg","skip_frames":5}}
Recommended Flow
- Activate the
board_hardware_infoskill and confirm that acameradevice is listed. - If no camera is listed, tell the user that the board does not declare a camera and stop.
- Choose a safe filename. Use the default unless the user requested a specific output name.
- Run
{CUR_SKILL_DIR}/scripts/take_picture.luawith the selectedargs. - Report the saved path, byte count, resolution, pixel format, skipped warm-up frames, and any error directly from the script output.
版本历史
-
36b377f
当前 2026-11-02 21:37
移除了描述中关于'from the board camera'的冗余表述;将流程第一步明确为激活board_hardware_info技能以确认相机设备存在,增强了前置检查逻辑。
- 06eb576 2026-07-24 19:54


