cmvr_head/applications/erpc/proto/face_servo.erpc
2026-04-21 17:21:20 +08:00

31 lines
890 B
Plaintext
Raw 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.

// face_servo.erpc
// 生成命令 .\erpcgen.exe -o .\generated\ -g c .\face_servo.erpc
// .\erpcgen.exe -g py .\face_servo.erpc
program face_servo
// 舵机ID字符串最大长度
const int32 kServoIdMaxLen = 32
// 最多支持的舵机数量
const int32 kMaxServoCount = 48
// 按 ID 设置角度的命令
struct ServoCmd {
string id @max_length(kServoIdMaxLen)
float angle_deg
}
interface FaceServo
{
// 接口1一次性设置所有舵机角度可变长度
// angles_deg 的顺序由固件映射表顺序定义
setAllAngles(list<float> angles_deg @max_length(kMaxServoCount)) -> int32
// 接口2按字符串ID批量设置角度可变长度
setAngles(list<ServoCmd> cmds @max_length(kMaxServoCount)) -> int32
// 单个按字符串ID设置角度
setAngle(string id @max_length(kServoIdMaxLen), float angle_deg) -> int32
}