Skip to content

Commit 157f64f

Browse files
authored
feat: new otto robot demo (tuya#168)
- new otto robot demo
1 parent 9aaa235 commit 157f64f

112 files changed

Lines changed: 1133672 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app_default.config
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
##
2+
# @file CMakeLists.txt
3+
# @brief
4+
#/
5+
6+
# APP_PATH
7+
set(APP_PATH ${CMAKE_CURRENT_LIST_DIR})
8+
9+
# APP_NAME
10+
get_filename_component(APP_NAME ${APP_PATH} NAME)
11+
12+
# APP_SRCS
13+
aux_source_directory(${APP_PATH}/src APP_SRCS)
14+
15+
file(GLOB_RECURSE ai_audio_srcs "${APP_PATH}/src/ai_audio/*.c")
16+
file(GLOB_RECURSE media_srcs "${APP_PATH}/src/ai_audio/media/*.c")
17+
list(APPEND APP_SRCS ${ai_audio_srcs} ${media_srcs})
18+
19+
set(APP_INC
20+
${APP_PATH}/include
21+
${APP_PATH}/include/ai_audio
22+
${APP_PATH}/include/ai_audio/media
23+
)
24+
25+
# ESP32 cannot use app header files
26+
if (NOT CONFIG_PLATFORM_CHOICE STREQUAL "ESP32")
27+
list(APPEND APP_INC "${APP_PATH}/assets")
28+
endif()
29+
30+
list(APPEND APP_INC "${APP_PATH}/src/minimp3")
31+
########################################
32+
# Target Configure
33+
########################################
34+
add_library(${EXAMPLE_LIB})
35+
36+
target_sources(${EXAMPLE_LIB}
37+
PRIVATE
38+
${APP_SRCS}
39+
)
40+
41+
target_include_directories(${EXAMPLE_LIB}
42+
PRIVATE
43+
${APP_INC}
44+
)
45+
46+
########################################
47+
# Add subdirectory
48+
########################################
49+
50+
if (NOT CONFIG_PLATFORM_CHOICE STREQUAL "ESP32")
51+
# esp32 use idf lvgl
52+
if (CONFIG_ENABLE_CHAT_DISPLAY STREQUAL "y")
53+
add_subdirectory(${APP_PATH}/src/display)
54+
endif()
55+
endif()
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
menu "configure app (your_otto_robot) "
2+
3+
config ENABLE_CHAT_BOT
4+
bool
5+
default y
6+
select ENABLE_AUDIO_SERVICE
7+
select ENABLE_VOICE_PROTOCOL_STREAM_GW
8+
select ENABLE_VOICE_STREAM_GW_MID_PROTOBUF
9+
select ENABLE_VOICE_STREAM_GW_MID_WEBSOCKET_CLIENT
10+
select ENABLE_SPEAKER_UPLOAD_SERVICE_OPUS_ENCODE
11+
select ENABLE_SPEAKER_UPLOAD_SERVICE_SPEEX_ENCODE
12+
13+
choice
14+
prompt "choose chat mode"
15+
default ENABLE_CHAT_MODE_KEY_TRIG_VAD_FREE
16+
17+
config ENABLE_CHAT_MODE_KEY_PRESS_HOLD_SINGEL
18+
bool "press and hold button to start a single conversation."
19+
20+
config ENABLE_CHAT_MODE_KEY_TRIG_VAD_FREE
21+
bool "press the button once to start or stop the free conversation."
22+
23+
config ENABLE_CHAT_MODE_ASR_WAKEUP_SINGEL
24+
bool "say the wake-up word to initiate a single conversation, similar to a smart speaker."
25+
26+
config ENABLE_CHAT_MODE_ASR_WAKEUP_FREE
27+
bool "saying the wake-up word, you can have a free conversation."
28+
endchoice
29+
30+
if(ENABLE_CHAT_MODE_ASR_WAKEUP_SINGEL || ENABLE_CHAT_MODE_ASR_WAKEUP_FREE)
31+
choice
32+
prompt "choose wakeup keyword"
33+
default ENABLE_WAKEUP_KEYWORD_NIHAO_TUYA
34+
35+
config ENABLE_WAKEUP_KEYWORD_NIHAO_TUYA
36+
bool "the wake-up word is configured as NI HAO TUYA."
37+
38+
config ENABLE_WAKEUP_KEYWORD_NIHAO_XIAOZHI
39+
bool "the wake-up word is configured as NI HAO XIAO ZHI."
40+
41+
config ENABLE_WAKEUP_KEYWORD_XIAOZHI_TONGXUE
42+
bool "the wake-up word is configured as XIAO ZHI TONG XUE."
43+
44+
config ENABLE_WAKEUP_KEYWORD_XIAOZHI_GUANJIA
45+
bool "the wake-up word is configured as XIAO ZHI GUAN JIA."
46+
endchoice
47+
endif
48+
49+
config ENABLE_AEC
50+
bool "support AEC"
51+
default n
52+
53+
config SPEAKER_EN_PIN
54+
int "the pin for enabling the voice module"
55+
range 0 64
56+
default 28
57+
58+
config CHAT_BUTTON_PIN
59+
int "the pin of the dialogue button"
60+
range 0 64
61+
default 12
62+
63+
config CHAT_INDICATE_LED_PIN
64+
int "the pin of the led, indicate whether it is in the process of a dialogue."
65+
range 0 64
66+
default 1
67+
68+
config ENABLE_CHAT_DISPLAY
69+
bool "enable the display module"
70+
default n
71+
72+
if (ENABLE_CHAT_DISPLAY)
73+
rsource "./src/display/Kconfig"
74+
endif
75+
endmenu
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# 涂鸦T5AI版本 Otto机器人制作教程指南
2+
3+
## 项目概述
4+
5+
Otto Robot 是一个开源的人形机器人平台,支持多种功能扩展。本指南将帮助您快速搭建和配置属于自己的 Otto 机器人,并通过涂鸦智能APP实现远程控制。
6+
7+
## 演示视频
8+
9+
**点击观看效果**[Otto 演示视频](https://t.tuya.com/AY1D3VxAQs)
10+
11+
## 一、材料清单
12+
13+
以下是制作 Otto Robot 所需的硬件材料:
14+
15+
### 1. 外壳
16+
17+
- **型号**: Otto Robot 3D打印机体外壳
18+
- **购买链接**[闲鱼]
19+
20+
### 2. 舵机
21+
22+
- **型号**:SG90 180度舵机
23+
- **购买渠道**:淘宝
24+
25+
### 3. 显示屏
26+
27+
- **型号**:ST7789
28+
- **购买渠道**:淘宝
29+
30+
### 4. 开发板
31+
32+
- **型号**:T5 mini 开发板
33+
- **购买方式**:淘宝
34+
35+
## 二、硬件接线图
36+
37+
| 硬件设备 | 外设 | T5引脚 | 引脚功能 |
38+
| -------- | ---- | ------ | ------------- |
39+
| 屏幕 | SCL | P14 | SPI0时钟 |
40+
| | CS | P13 | SPI0片选 |
41+
| | SDA | P16 | SPI0数据 |
42+
| | RST | P19 | 屏幕复位 |
43+
| | DC | P17 | 数据/命令选择 |
44+
| | BLK | 可不接 | 屏幕背光 |
45+
| 舵机 | PWM0 | P18 | 左腿舵机 |
46+
| | PWM1 | P24 | 右腿舵机 |
47+
| | PWM2 | P9 | 左脚舵机 |
48+
| | PWM3 | P34 | 右脚舵机 |
49+
50+
## 三、软件设计
51+
52+
### 1. 代码下载
53+
54+
- **主仓库**https://github.com/tuya/TuyaOpen
55+
56+
### 2. 开发文档
57+
58+
- **文档地址**[Tuya 开发文档](https://www.tuyaopen.io/en/master/)(先仔细阅读文档哦)
59+
60+
### 3. 配置修改
61+
62+
- **PID修改**:在文件 `apps/tuya.ai/your_otto_robot/include/tuya_config.h`
63+
64+
​ 将 PID 修改为 `**pnax3fya1ctl5pst**`
65+
66+
- **UUID获取**:访问 [Tuya Open 仓库](https://github.com/tuya/TuyaOpen/tree/master) 点击 右上角"Star" 后进群获取 UUID
67+
- **配置T5 mini开发板引脚:**在apps/tuya.ai/your_otto_robot/ 使用命令****tos menuconfig 按下图操作选择
68+
69+
![img](./imgs/project-select.png)
70+
71+
![img](./imgs/project-select.png)
72+
73+
- **选择st7789屏幕**:在apps/tuya.ai/your_otto_robot/ 使用命令:tos menuconfig 按下图操作选择
74+
75+
按照下图的0-5操作后保存
76+
77+
![img](https://cdn.nlark.com/yuque/0/2025/png/55332580/1747995263104-5007fddf-5d51-423e-bf40-3e034b331536.png)
78+
79+
![img](https://cdn.nlark.com/yuque/0/2025/png/55332580/1747994787340-9af0f6bf-638e-4656-bded-c11809341b37.png)
80+
81+
![img](https://cdn.nlark.com/yuque/0/2025/png/55332580/1747995102423-a50c81bc-a75f-4ad6-bcce-9fde9c43ef9a.png)
82+
83+
![img](https://cdn.nlark.com/yuque/0/2025/png/55332580/1747995133265-bdd2800a-c8bc-415d-b9e9-1e17d64d21c7.png)
84+
85+
### 以上配置完成后保存:再tos build哦
86+
编译完成后才会下拉platform/T5AI/tuyaos/tuyaos_adapter/src/driver/tkl_pwm.c文件
87+
记得修改tpwm_chan_t ty_to_bk_pwm(TUYA_PWM_NUM_E ch_id)接口里面的PWM的映射表:
88+
```
89+
pwm_chan_t ty_to_bk_pwm(TUYA_PWM_NUM_E ch_id)
90+
{
91+
pwm_chan_t pwm = PWM_ID_MAX;
92+
switch(ch_id) {
93+
case TUYA_PWM_NUM_0:
94+
pwm = PWM_ID_0;
95+
break;
96+
case TUYA_PWM_NUM_1:
97+
pwm = PWM_ID_4;
98+
break;
99+
case TUYA_PWM_NUM_2:
100+
pwm = PWM_ID_3;//改这行
101+
break;
102+
case TUYA_PWM_NUM_3:
103+
pwm = PWM_ID_8;
104+
break;
105+
case TUYA_PWM_NUM_4:
106+
pwm = PWM_ID_10;
107+
break;
108+
default:
109+
break;
110+
}
111+
112+
return pwm;
113+
}
114+
```
115+
116+
记得再次编译:tos build
117+
118+
### 4. 社区支持
119+
120+
- **企业微信群**
121+
122+
![img](https://cdn.nlark.com/yuque/0/2025/jpeg/55332580/1747998771203-5ac06211-d6ce-424d-99f9-b431804ebc80.jpeg?x-oss-process=image%2Fformat%2Cwebp)
123+
124+
- **QQ群**[加入涂鸦AI开发群](https://github.com/tuya/TuyaOpen/tree/master/apps/tuya.ai)(点star可以领取授权码)
125+
126+
![img](https://cdn.nlark.com/yuque/0/2025/png/55332580/1747998833234-310a2deb-5b01-4ebe-8e85-0b58f3b568f0.png)
127+
128+
## 四、固件烧录指南
129+
130+
### 1. 烧录准备(参考第二章)
131+
132+
1. 下载最新版本的固件 `.bin` 文件
133+
2. 下载烧录工具或在 Linux 环境下使用 `tos` 命令
134+
3. 使用 Type-C 数据线连接 T5 Mini 开发板
135+
136+
### 2. 烧录步骤
137+
138+
1. 打开烧录工具
139+
2. 选择正确的 COM 端口
140+
3. 设置芯片类型为 T5
141+
4. 烧录地址设置为 `0x0`
142+
5. 选择下载的固件文件
143+
6. 点击 "Start" 开始烧录
144+
145+
## 五、控制效果确认
146+
147+
### 1. AI运动控制
148+
149+
1. 下载涂鸦智能APP
150+
2. 在APP右上角添加子设备,选择 "机器人"
151+
3. 进入控制界面,即可通过APP控制机器人实现:
152+
153+
- 左右移动
154+
- 前后移动
155+
156+
4. 使用语音控制Otto机器人前后左右移动(唤醒词:"你好,涂鸦"等)
157+
158+
### 2. AI聊天
159+
160+
1. 使用语音唤醒聊天(唤醒词:"你好,涂鸦"等)
161+
162+
### 3. 功能清单
163+
164+
- 支持基本行走动作
165+
- 支持语音指令控制
166+
- 屏幕显示状态信息
167+
- 支持视频识别(未来规划)
168+
169+
## 六、资源支持
170+
171+
- **技术交流**:加入涂鸦AI开发微信&QQ群获取技术支持
172+
- **社区分享**:欢迎在 GitHub 或涂鸦开发者社区分享您的项目心得
173+
祝您成功打造属于自己的智能Otto机器人!
174+
175+
## 七、致谢
176+
177+
本项目感谢以下开源作者的支持:
178+
179+
1. [txp666]
180+
181+
182+
183+
本项目感谢以下开源项目的支持:
184+
185+
1. OttoDIYLib
186+
187+
188+
189+
190+
本项目感谢以下开源社区的支持:
191+
192+
1. JLCEDA
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
CONFIG_ENABLE_CHAT_MODE_ASR_WAKEUP_SINGEL=y
2+
CONFIG_ENABLE_CHAT_DISPLAY=y
3+
CONFIG_ENABLE_GUI_STREAM_AI_TEXT=y
4+
CONFIG_BOARD_CHOICE_T5AI=y
5+
CONFIG_MEM_SIZE=51200
6+
CONFIG_MEMP_NUM_UDP_PCB=10
7+
CONFIG_MEMP_NUM_TCP_SEG=80
8+
CONFIG_PBUF_LINK_ENCAPSULATION_HLEN=96
9+
CONFIG_TCP_SND_BUF=32768
10+
CONFIG_TCP_SND_QUEUELEN=44
11+
CONFIG_MEMP_NUM_NETBUF=32
12+
CONFIG_DEFAULT_UDP_RECVMBOX_SIZE=24
13+
CONFIG_MEMP_NUM_SYS_TIMEOUT=12
14+
CONFIG_LWIP_EAPOL_SUPPORT=0
15+
CONFIG_LWIP_TX_PBUF_ZERO_COPY=0
16+
CONFIG_CONFIG_TUYA_SOCK_SHIM=0
17+
CONFIG_LWIP_DHCPC_STATIC_IPADDR_ENABLE=1
18+
CONFIG_ETHARP_SUPPORT_STATIC_ENTRIES=1
19+
CONFIG_LWIP_NETIF_STATUS_CALLBACK=1
20+
CONFIG_LWIP_TIMEVAL_PRIVATE=0
21+
CONFIG_IN_ADDR_T_DEFINED=y
22+
CONFIG_ENABLE_LIBLVGL=y
23+
CONFIG_ENABLE_DISPLAY_LCD_RGB=y
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Auto-generated language config
2+
#ifndef __LANGUAGE_CONFIG_H__
3+
#define __LANGUAGE_CONFIG_H__
4+
5+
#include <stdio.h>
6+
7+
#ifndef zh_cn
8+
#define zh_cn
9+
#endif
10+
11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
15+
#define LANG_CODE "zh-CN"
16+
17+
#define VERSION "版本 "
18+
#define INITIALIZING "正在初始化..."
19+
#define REGISTERING_NETWORK "等待网络..."
20+
#define CONNECT_SERVER "连接服务器..."
21+
#define STANDBY "待命"
22+
#define CONNECT_TO "连接 "
23+
#define CONNECTING "连接中..."
24+
#define CONNECTED_TO "已连接 "
25+
#define LISTENING "聆听中..."
26+
#define SPEAKING "说话中..."
27+
#define HOLD_TALK "长按"
28+
#define TRIG_TALK "按键"
29+
#define WAKEUP_TALK "唤醒"
30+
#define FREE_TALK "随意"
31+
#define ENTERING_WIFI_CONFIG_MODE "进入配网模式..."
32+
#define VOLUME "音量 "
33+
#define MUTED "已静音"
34+
#define MAX_VOLUME "最大音量"
35+
36+
#ifdef __cplusplus
37+
}
38+
#endif
39+
40+
#endif // __LANGUAGE_CONFIG_H

0 commit comments

Comments
 (0)