Skip to content

Commit 3e4aa75

Browse files
committed
chore: fix typing problem, supporting python3.10
1 parent 4526d85 commit 3e4aa75

File tree

17 files changed

+3798
-148
lines changed

17 files changed

+3798
-148
lines changed

.gitignore

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# ide
22
.idea/
3-
uv.lock
43
dist
54
debug.log
65
.DS_Store
@@ -93,35 +92,6 @@ target/
9392
profile_default/
9493
ipython_config.py
9594

96-
# pyenv
97-
# For a library or package, you might want to ignore these files since the code is
98-
# intended to run in multiple environments; otherwise, check them in:
99-
# .python-version
100-
101-
# pipenv
102-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
103-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
104-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
105-
# install all needed dependencies.
106-
#Pipfile.lock
107-
108-
# poetry
109-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
110-
# This is especially recommended for binary packages to ensure reproducibility, and is more
111-
# commonly ignored for libraries.
112-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
113-
poetry.lock
114-
115-
uv.lock
116-
117-
# pdm
118-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
119-
#pdm.lock
120-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
121-
# in version control.
122-
# https://pdm.fming.dev/#use-with-ide
123-
.pdm.toml
124-
12595
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
12696
__pypackages__/
12797

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ install-uv: ## Install uv if missing
1919

2020
.PHONY: install-python
2121
install-python: ## Install Python via uv if missing
22-
@echo "==> Ensuring Python 3.12 is available (via uv)"
23-
@if uv python find 3.12 >/dev/null 2>&1; then \
24-
echo "Python 3.12 already available"; \
22+
@echo "==> Ensuring Python 3.10 is available (via uv)"
23+
@if uv python find 3.10 >/dev/null 2>&1; then \
24+
echo "Python 3.10 already available"; \
2525
else \
26-
echo "Python 3.12 not found. Installing..."; \
27-
uv python install 3.12; \
26+
echo "Python 3.10 not found. Installing..."; \
27+
uv python install 3.10; \
2828
fi
2929

3030
.PHONY: uv-venv
@@ -38,7 +38,7 @@ uv-venv: ## Create project virtualenv with uv if missing
3838
fi
3939

4040
.PHONY: install-uv-pyenv
41-
install-uv-pyenv: install-uv install-python uv-venv ## Install uv, Python 3.12, and venv
41+
install-uv-pyenv: install-uv install-python uv-venv ## Install uv, Python 3.10, and venv
4242

4343
.PHONY: install-prek
4444
install-prek: ## Install prek and repo git hooks.
@@ -48,7 +48,7 @@ install-prek: ## Install prek and repo git hooks.
4848
@uv tool run prek install
4949

5050
.PHONY: prepare
51-
prepare: install-uv install-python uv-venv install-prek ## Setup uv, Python 3.12, venv, and prek hooks.
51+
prepare: install-uv install-python uv-venv install-prek ## Setup uv, Python 3.10, venv, and prek hooks.
5252
@echo "==> Syncing dependencies for all workspace packages"
5353
@uv sync --dev --all-extras
5454

examples/jetarm_ws/src/jetarm_channel/jetarm_channel/face_traking_node.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ def image_callback(self, ros_image):
135135
self.image_queue.put(bgr_image)
136136

137137
def main(self):
138-
139138
while self.running:
140139
bgr_image = self.image_queue.get()
141140

examples/jetarm_ws/src/jetarm_channel/jetarm_channel/nodes/pychannel_with_rclpy.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def main(args=None):
6262

6363
@main_channel.build.command()
6464
async def reset_body():
65-
6665
# 发送目标
6766
joint_names = ["joint1", "joint2", "joint3", "joint4", "joint5", "r_joint"]
6867
positions = [0.0, 1.0, -1.57, -1.57, 0.2, 0.0]

examples/miku/README.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,30 @@ Miku 是一个 live2d 数字人躯体, 用来测试 MOSS 架构对躯体的多
55
# 设计思路
66

77
- Body(身体:全身运动)
8-
- Expression(表情)
9-
- Head(头)
10-
- Hair(头发)
11-
- pigtail_L(左辫子)
12-
- pigtail_R(右辫子)
13-
- Face(脸)
14-
- BROW_L(左眉毛)
15-
- BROW_R(右眉毛)
16-
- Eye_L(左眼睛)
17-
- Eye_R(右眼睛)
18-
- Nose(鼻子)
19-
- Mouth(嘴巴)
20-
- Arm_L(左臂)
21-
- Elbow_L(左肘)
22-
- Arm_R(右臂)
23-
- Elbow_R(右肘)
24-
- Tie(领带)
25-
- Leg_L(左腿)
26-
- Leg_R(右腿)
8+
- Expression(表情)
9+
- Head(头)
10+
- Hair(头发)
11+
- pigtail_L(左辫子)
12+
- pigtail_R(右辫子)
13+
- Face(脸)
14+
- BROW_L(左眉毛)
15+
- BROW_R(右眉毛)
16+
- Eye_L(左眼睛)
17+
- Eye_R(右眼睛)
18+
- Nose(鼻子)
19+
- Mouth(嘴巴)
20+
- Arm_L(左臂)
21+
- Elbow_L(左肘)
22+
- Arm_R(右臂)
23+
- Elbow_R(右肘)
24+
- Tie(领带)
25+
- Leg_L(左腿)
26+
- Leg_R(右腿)
2727

2828
# 运行
29+
2930
## 配置环境变量
31+
3032
在项目根目录下创建 `.workspace/.env` 文件,配置环境变量:
3133

3234
```bash
@@ -43,7 +45,9 @@ MOSS_LLM_MODEL=your_llm_model_here
4345
VOLCENGINE_STREAM_TTS_APP=your_volcengine_stream_tts_app_id_here
4446
VOLCENGINE_STREAM_TTS_ACCESS_TOKEN=your_volcengine_stream_tts_access_token_here
4547
```
48+
4649
## 启动
50+
4751
```bash
4852
python main.py
4953
```

examples/miku/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33

44
import dotenv
5-
from ghoshell_common.contracts import LocalWorkspaceProvider, Workspace, WorkspaceConfigs
5+
from ghoshell_common.contracts import LocalWorkspaceProvider
66

77
from ghoshell_moss.speech import make_baseline_tts_speech
88
from ghoshell_moss.speech.player.pyaudio_player import PyAudioStreamPlayer

examples/minecraft_bot/README.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ minecraft_bot 示例提供了一个可对话、可交互的 Minecraft 机器人
99
## 功能特性
1010

1111
当前已集成的机器人行为能力包括:
12+
1213
- 🚶‍♂️ **移动控制** - 在游戏世界中自由移动
1314
- 👥 **跟随玩家** - 自动跟随指定玩家
1415
- 🔍 **物品查找** - 寻找游戏中的特定物品
@@ -28,33 +29,41 @@ minecraft_bot/
2829
```
2930

3031
# 环境准备
32+
3133
## Minecraft 客户端安装
3234

3335
### 下载 HMCL 启动器
36+
3437
访问 [HMCL 官网](https://hmcl.huangyuhui.net/download/) 下载启动器。
3538

3639
### 安装 Minecraft 1.21.8 版本
40+
3741
1. 启动 HMCL 启动器
38-
2. 点击"安装游戏"
39-
3. 选择 "Minecraft 1.21.8" 版本
40-
4. 点击"安装"完成客户端安装
42+
1. 点击"安装游戏"
43+
1. 选择 "Minecraft 1.21.8" 版本
44+
1. 点击"安装"完成客户端安装
4145

4246
## 安装 Minecraft Server
4347

4448
### 使用 Docker 启动服务器
49+
4550
```bash
4651
cd server
4752
docker-compose up -d
4853
```
54+
4955
第一次启动容器时会自动下载 Minecraft 1.21.8 版本的服务器文件。
5056

5157
### 检查服务状态
58+
5259
等待服务启动完成,检查端口是否正常监听:
60+
5361
```bash
5462
docker-compose logs -f
5563
```
5664

5765
出现以下日志表示服务启动成功:
66+
5867
```
5968
[03:30:22] [Server thread/INFO]: Done (5.274s)! For help, type "help"
6069
[03:30:22] [Server thread/INFO]: Starting remote control listener
@@ -63,23 +72,28 @@ docker-compose logs -f
6372
```
6473

6574
### 配置服务器
75+
6676
服务器启动后,在 `server/data` 目录下会生成配置文件:
77+
6778
- `server.properties` - 服务器主配置文件
6879
- `whitelist.json` - 白名单配置
6980
- ...
7081

7182
**重要配置修改:**
7283
编辑 `server.properties`,将 `online-mode` 设置为 `false`
84+
7385
```properties
7486
online-mode=false
7587
```
7688

7789
编辑 `server.properties`,将 `gamemode` 设置为 `creative`(防止被小怪攻击):
90+
7891
```properties
7992
gamemode=creative
8093
```
8194

8295
修改后重启容器使配置生效:
96+
8397
```bash
8498
docker-compose restart
8599
```
@@ -91,9 +105,9 @@ docker-compose restart
91105
## 加入服务器
92106

93107
1. **启动 Minecraft 游戏**
94-
2. **选择"多人游戏"**
95-
3. **添加服务器**,地址设置为 `127.0.0.1`
96-
4. **加入服务器**
108+
1. **选择"多人游戏"**
109+
1. **添加服务器**,地址设置为 `127.0.0.1`
110+
1. **加入服务器**
97111

98112
## 启动机器人
99113

@@ -116,9 +130,11 @@ VOLCENGINE_STREAM_TTS_ACCESS_TOKEN=your_volcengine_stream_tts_access_token_here
116130
```
117131

118132
在项目根目录下运行以下命令启动机器人:
133+
119134
```bash
120135
python main.py [--speech]
121136
```
137+
122138
第一次执行会自动安装 Node.js 依赖
123139

124140
机器人将自动连接到服务器并出现在游戏中。默认机器人用户名为 `Jarvis`
@@ -127,6 +143,7 @@ python main.py [--speech]
127143
## 交互方式
128144

129145
机器人启动后,您可以通过游戏内的聊天功能(按t)与机器人交互:
146+
130147
- 发送消息给机器人
131148
- 使用指令控制机器人行为
132149
- 机器人会根据 MOSS 架构进行智能响应
@@ -153,23 +170,27 @@ PORT = 25565 # 服务器端口
153170
## 常见问题
154171

155172
1. **无法连接服务器**
173+
156174
- 检查 Docker 容器是否正常运行:`docker-compose ps`
157175
- 确认服务器端口 25565 是否被占用
158176
- 验证 `online-mode=false` 配置是否正确
159177

160-
2. **机器人无法启动**
178+
1. **机器人无法启动**
179+
161180
- 检查 Python 和 Node.js 依赖是否安装完整
162181
- 确认 Minecraft 服务器已启动并运行正常
163182
- 查看控制台错误日志进行排查
164183

165-
3. **机器人无响应**
184+
1. **机器人无响应**
185+
166186
- 检查网络连接状态
167187
- 确认机器人是否成功连接到服务器
168188
- 验证游戏内聊天功能是否正常
169189

170190
# 技术架构
171191

172192
本项目基于以下技术栈:
193+
173194
- **MOSS 架构** - 提供智能对话和决策能力
174195
- **Mineflayer** - Minecraft 机器人控制库
175196
- **Python-JavaScript 桥接** - 实现跨语言调用

0 commit comments

Comments
 (0)