d-robotics 077f2eacf1 feat(skills): add taiyang servo dance skill
Add PWM-based servo control skill for RDK nodes with hardware servo support.

Changes:
- Add taiyang skill with SKILL.md and servo_dance.py script
- Update Dockerfile and Containerfile to include taiyang skill
- Update SOUL.md with skill constraints documentation

The skill controls two servos via /sys/class/pwm interface and must run on node side only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-22 15:36:54 +08:00

60 lines
1.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: 太阳!
description: 控制 RDK 节点上的舵机挥动,让两个舵机同步或反向运动。使用 PWM 信号控制舵机角度0°-180°支持多种舞动模式。触发话太阳、舵机挥动、servo dance、PWM 舵机、双舵机控制、双舵机控制。
---
# 太阳!- 舵机挥动技能
让舵机动起来!就像太阳升起一样充满活力。
## 前置条件
- RDK 节点已连接
- PWM 接口可用(/sys/class/pwm/pwmchip0
- 两个舵机分别连接到 pwm0 和 pwm1
## 快速使用
直接调用脚本启动舵机舞动:
```bash
python3 ~/.openclaw/skills/taiyang/scripts/servo_dance.py
```
停止舞动:
```bash
pkill -f servo_dance.py
```
## 舵机控制参数
| 参数 | 默认值 | 说明 |
|------|--------|------|
| 频率 | 50Hz | 标准舵机频率20ms周期 |
| 脉宽范围 | 1-2ms | 0°-180° 对应 |
| 中心位置 | 1.5ms | 90° |
## PWM 接口路径
- pwm0: `/sys/class/pwm/pwmchip0/pwm0` → Servo 0
- pwm1: `/sys/class/pwm/pwmchip0/pwm1` → Servo 1
## 舞动模式
脚本内置三种模式循环:
1. **波浪模式** - Servo0 和 Servo1 反向运动
2. **同步模式** - 两个舵机同步运动
## 手动控制
如需手动控制单个舵机:
```bash
# 设置角度0-180
echo $((1000000 + angle * 5555)) > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
```
角度计算duty = 1000000 + (angle/180) * 1000000 (单位ns)