Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c6cb0bd
otto v1.4.0 MCP
txp666 Jun 4, 2025
6f49f48
otto v1.4.1 gif as components
txp666 Jun 5, 2025
210d3aa
electronBot v1.1.0 mcp
txp666 Jun 5, 2025
971313d
Merge branch '78:main' into MCP_TEST
txp666 Jun 5, 2025
837150c
Merge branch '78:main' into main
txp666 Jun 5, 2025
009146c
Merge branch '78:main' into main
txp666 Jun 5, 2025
b632e33
规范代码
txp666 Jun 5, 2025
cc6adc5
Merge branch '78:main' into main
txp666 Jun 6, 2025
db3fc1d
Merge branch '78:main' into main
txp666 Jun 13, 2025
03c8ec6
fix(ota): 修复 ottoRobot和electronBot OTA 升级崩溃问题 bug
txp666 Jun 13, 2025
779bb5c
Merge branch '78:main' into main
txp666 Jun 13, 2025
9e67253
1.增加robot舵机初始位置校准
txp666 Jun 13, 2025
4057c30
Merge branch 'main' of https://github.com/txp666/xiaozhi-esp32
txp666 Jun 13, 2025
b982be8
Merge branch '78:main' into main
txp666 Sep 4, 2025
609cc09
Merge branch '78:main' into main
txp666 Sep 17, 2025
d9ab881
Merge branch '78:main' into main
txp666 Oct 5, 2025
97d747a
Merge branch '78:main' into main
txp666 Oct 29, 2025
ea93476
refactor: Update Electron and Otto emoji display implementations
txp666 Oct 31, 2025
e8539bc
Rename OTTO_ICON_FONT.c to otto_icon_font.c
txp666 Oct 31, 2025
76abfb7
Rename OTTO_ICON_FONT.c to otto_icon_font.c
txp666 Oct 31, 2025
9729cb0
refactor: Update Otto emoji display configurations and functionalities
txp666 Nov 1, 2025
5371821
Merge branch '78:main' into main
txp666 Nov 1, 2025
444ce5c
Merge branch 'dev'
txp666 Nov 2, 2025
ab53ff6
refactor: Update chat label long mode for Electron and Otto emoji dis…
txp666 Nov 2, 2025
816b26e
Update Otto robot README with new actions and parameters
txp666 Nov 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main/boards/electron-bot/electron_emoji_display.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void ElectronEmojiDisplay::SetupChatLabel() {
chat_message_label_ = lv_label_create(container_);
lv_label_set_text(chat_message_label_, "");
lv_obj_set_width(chat_message_label_, width_ * 0.9); // 限制宽度为屏幕宽度的 90%
lv_label_set_long_mode(chat_message_label_, LV_LABEL_LONG_WRAP); // 设置为自动换行模式
lv_label_set_long_mode(chat_message_label_, LV_LABEL_LONG_SCROLL_CIRCULAR); // 设置为自动换行模式
lv_obj_set_style_text_align(chat_message_label_, LV_TEXT_ALIGN_CENTER, 0); // 设置文本居中对齐
lv_obj_set_style_text_color(chat_message_label_, lv_color_white(), 0);
SetTheme(LvglThemeManager::GetInstance().GetTheme("dark"));
Expand Down
61 changes: 52 additions & 9 deletions main/boards/otto-robot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ otto 机器人是一个开源的人形机器人平台,具有多种动作能力
>
> **我的动作能力**:
> - **基础移动**: 行走(前后), 转向(左右), 跳跃
> - **特殊动作**: 摇摆, 太空步, 弯曲身体, 摇腿, 上下运动
> - **手部动作**: 举手, 放手, 挥手 (仅在配置手部舵机时可用)
> - **特殊动作**: 摇摆, 太空步, 弯曲身体, 摇腿, 上下运动, 旋风腿, 坐下, 展示动作
> - **手部动作**: 举手, 放手, 挥手, 大风车, 起飞, 健身, 打招呼, 害羞, 广播体操, 爱的魔力转圈圈 (仅在配置手部舵机时可用)
>
> **我的个性特点**:
> - 我有强迫症,每次说话都要根据我的心情随机做一个动作(先发送动作指令再说话)
Expand Down Expand Up @@ -58,37 +58,57 @@ otto 机器人具有丰富的动作能力,包括行走、转向、跳跃、摇
| self.otto.moonwalk | 太空步 | **steps**: 太空步步数(1-100,默认3)<br>**speed**: 速度(500-1500,数值越小越快,默认1000)<br>**direction**: 方向(1=左, -1=右,默认1)<br>**amount**: 幅度(0-170度,默认25) |
| self.otto.bend | 弯曲身体 | **steps**: 弯曲次数(1-100,默认1)<br>**speed**: 弯曲速度(500-1500,数值越小越快,默认1000)<br>**direction**: 弯曲方向(1=左, -1=右,默认1) |
| self.otto.shake_leg | 摇腿 | **steps**: 摇腿次数(1-100,默认1)<br>**speed**: 摇腿速度(500-1500,数值越小越快,默认1000)<br>**direction**: 腿部选择(1=左腿, -1=右腿,默认1) |
| self.otto.sit | 坐下 | 不需要参数 |
| self.otto.showcase | 展示动作 | 不需要参数。串联执行多个动作:往前走3步、挥挥手、跳舞(广播体操)、太空步、摇摆、起飞、健身、往后走3步 |
| self.otto.updown | 上下运动 | **steps**: 上下运动次数(1-100,默认3)<br>**speed**: 运动速度(500-1500,数值越小越快,默认1000)<br>**amount**: 运动幅度(0-170度,默认20) |
| self.otto.whirlwind_leg | 旋风腿 | **steps**: 动作次数(3-100,默认3)<br>**speed**: 动作速度(100-1000,数值越小越快,建议300)<br>**amplitude**: 踢腿幅度(20-40度,默认30) |
| self.otto.hands_up | 举手 * | **speed**: 举手速度(500-1500,数值越小越快,默认1000)<br>**direction**: 手部选择(1=左手, -1=右手, 0=双手,默认1) |
| self.otto.hands_down | 放手 * | **speed**: 放手速度(500-1500,数值越小越快,默认1000)<br>**direction**: 手部选择(1=左手, -1=右手, 0=双手,默认1) |
| self.otto.hand_wave | 挥手 * | **speed**: 挥手速度(500-1500,数值越小越快,默认1000)<br>**direction**: 手部选择(1=左手, -1=右手, 0=双手,默认1) |
| self.otto.hand_wave | 挥手 * | **direction**: 手部选择(1=左手, -1=右手, 0=双手,默认1) |
| self.otto.windmill | 大风车 * | **steps**: 动作次数(3-100,默认6)<br>**speed**: 动作周期(300-2000毫秒,数值越小越快,默认500)<br>**amplitude**: 振荡幅度(50-90度,默认70) |
| self.otto.takeoff | 起飞 * | **steps**: 动作次数(5-100,默认5)<br>**speed**: 动作周期(200-600毫秒,数值越小越快,建议300)<br>**amplitude**: 振荡幅度(20-60度,默认40) |
| self.otto.fitness | 健身 * | **steps**: 动作次数(3-100,默认5)<br>**speed**: 动作速度(500-2000毫秒,数值越小越快,默认1000)<br>**amplitude**: 振荡幅度(10-50度,默认25) |
| self.otto.greeting | 打招呼 * | **direction**: 手部选择(1=左手, -1=右手,默认1)<br>**steps**: 动作次数(3-100,默认5) |
| self.otto.shy | 害羞 * | **direction**: 方向(1=左, -1=右,默认1)<br>**steps**: 动作次数(3-100,默认5) |
| self.otto.radio_calisthenics | 广播体操 * | 不需要参数 |
| self.otto.magic_circle | 爱的魔力转圈圈 * | 不需要参数 |

**注**: 标记 * 的手部动作仅在配置了手部舵机时可用。

### 系统工具

| MCP工具名称 | 描述 | 返回值 |
| MCP工具名称 | 描述 | 返回值/说明 |
|-------------------|-----------------|---------------------------------------------------|
| self.otto.stop | 立即停止 | 停止当前动作并回到初始位置 |
| self.otto.home | 复位机器人到初始位置 | 不需要参数 |
| self.otto.stop | 立即停止所有动作并复位 | 停止当前动作并回到初始位置 |
| self.otto.get_status | 获取机器人状态 | 返回 "moving" 或 "idle" |
| self.otto.set_trim | 校准单个舵机位置 | **servo_type**: 舵机类型(left_leg/right_leg/left_foot/right_foot/left_hand/right_hand)<br>**trim_value**: 微调值(-50到50度) |
| self.otto.get_trims | 获取当前的舵机微调设置 | 返回所有舵机微调值的JSON格式 |
| self.battery.get_level | 获取电池状态 | 返回电量百分比和充电状态的JSON格式 |
| self.otto.servo_sequences | 舵机序列自编程 | 支持分段发送序列,支持普通移动和振荡器两种模式。详见代码注释中的详细说明 |

### 参数说明

1. **steps**: 动作执行的步数/次数,数值越大动作持续时间越长
2. **speed**: 动作执行速度,数值范围500-1500,**数值越小越快**
2. **speed**: 动作执行速度/周期,**数值越小越快**
- 大多数动作: 500-1500毫秒
- 特殊动作可能有所不同(如旋风腿: 100-1000,起飞: 200-600等)
- 具体范围请参考各动作的说明
3. **direction**: 方向参数
- 移动动作: 1=左/前进, -1=右/后退
- 手部动作: 1=左手, -1=右手, 0=双手
4. **amount/arm_swing**: 动作幅度,范围0-170度
4. **amount/amplitude/arm_swing**: 动作幅度,范围根据动作而定(通常0-170度
- 0表示不摆动(适用于手臂摆动)
- 数值越大幅度越大
- 不同动作可能有不同的幅度范围限制

### 动作控制
- 每个动作执行完成后,机器人会自动回到初始位置(home),以便于执行下一个动作
- **例外**: `sit`(坐下)和 `showcase`(展示动作)执行后不会自动复位
- 所有参数都有合理的默认值,可以省略不需要自定义的参数
- 动作在后台任务中执行,不会阻塞主程序
- 支持动作队列,可以连续执行多个动作
- 手部动作需要配置手部舵机才能使用,如果没有配置手部舵机,相关动作将被跳过

### MCP工具调用示例
```json
Expand All @@ -107,6 +127,18 @@ otto 机器人具有丰富的动作能力,包括行走、转向、跳跃、摇
// 挥左手打招呼
{"name": "self.otto.hand_wave", "arguments": {"direction": 1}}

// 展示动作(串联多个动作)
{"name": "self.otto.showcase", "arguments": {}}

// 大风车动作
{"name": "self.otto.windmill", "arguments": {"steps": 10, "amplitude": 80}}

// 起飞动作
{"name": "self.otto.takeoff", "arguments": {"steps": 5, "speed": 300}}

// 广播体操
{"name": "self.otto.radio_calisthenics", "arguments": {}}

// 立即停止
{"name": "self.otto.stop", "arguments": {}}
```
Expand All @@ -115,9 +147,20 @@ otto 机器人具有丰富的动作能力,包括行走、转向、跳跃、摇
- "向前走" / "向前走5步" / "快速向前"
- "左转" / "右转" / "转身"
- "跳跃" / "跳一下"
- "摇摆" / "跳舞"
- "摇摆" / "摇摆舞" / "跳舞"
- "太空步" / "月球漫步"
- "挥手" / "举手" / "放手"
- "旋风腿" / "旋风腿动作"
- "坐下" / "坐下休息"
- "展示动作" / "表演一下"
- "挥手" / "挥手打招呼"
- "举手" / "双手举起" / "放手"
- "大风车" / "做大风车"
- "起飞" / "准备起飞"
- "健身" / "做健身动作"
- "打招呼" / "打招呼动作"
- "害羞" / "害羞动作"
- "广播体操" / "做广播体操"
- "爱的魔力转圈圈" / "转圈圈"
- "停止" / "停下"

**说明**: 小智控制机器人动作是创建新的任务在后台控制,动作执行期间仍可接受新的语音指令。可以通过"停止"语音指令立即停下Otto。
Expand Down
2 changes: 1 addition & 1 deletion main/boards/otto-robot/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@

#define BOOT_BUTTON_GPIO GPIO_NUM_0

#define OTTO_ROBOT_VERSION "2.0.4"
#define OTTO_ROBOT_VERSION "2.0.5"

#endif // _BOARD_CONFIG_H_
8 changes: 8 additions & 0 deletions main/boards/otto-robot/oscillator.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//--------------------------------------------------------------
//-- Oscillator.pde
//-- Generate sinusoidal oscillations in the servos
//--------------------------------------------------------------
//-- (c) Juan Gonzalez-Gomez (Obijuan), Dec 2011
//-- (c) txp666 for esp32, 202503
//-- GPL license
//--------------------------------------------------------------
#include "oscillator.h"

#include <driver/ledc.h>
Expand Down
8 changes: 8 additions & 0 deletions main/boards/otto-robot/oscillator.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//--------------------------------------------------------------
//-- Oscillator.pde
//-- Generate sinusoidal oscillations in the servos
//--------------------------------------------------------------
//-- (c) Juan Gonzalez-Gomez (Obijuan), Dec 2011
//-- (c) txp666 for esp32, 202503
//-- GPL license
//--------------------------------------------------------------
#ifndef __OSCILLATOR_H__
#define __OSCILLATOR_H__

Expand Down
Loading