Metadata-Version: 2.4
Name: xgo-blockly-luwuos
Version: 1.0.6.13
Summary: XGO Blockly - 图形化和 AI 编程 Web 服务器
Home-page: https://github.com/xgo-robotics/xgo-blockly
Author: 陆吾科技
Author-email: 陆吾科技 <hello@xgorobot.com>
License: MIT
Project-URL: Homepage, https://github.com/xgo-robotics/xgo-blockly
Project-URL: Bug Reports, https://github.com/xgo-robotics/xgo-blockly/issues
Project-URL: Source, https://github.com/xgo-robotics/xgo-blockly
Project-URL: Documentation, https://docs.xgo.com/
Keywords: xgo,robot,blockly,programming,education
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Education
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Framework :: Flask
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: flask>=2.2.2
Requires-Dist: flask-cors>=4.0.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: pyserial>=3.5
Requires-Dist: mem0ai<2.0.0,>=0.1.118
Requires-Dist: agentscope<2.0.0,>=1.0.19
Requires-Dist: opencv-python>=4.11.0.86
Requires-Dist: packaging>=23.2
Requires-Dist: requests>=2.32.3
Requires-Dist: pyzbar>=0.1.9
Requires-Dist: websockets>=11.0
Requires-Dist: websocket-client>=1.6.0
Requires-Dist: pyaudio>=0.2.13
Requires-Dist: dashscope>=1.14.0
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# XGO Blockly 图形化编程服务器

## 简介

XGO Blockly 是专为陆吾 XGO 机器人系列设计的图形化编程和 AI 编程服务器。通过简单的安装和启动,您可以在电脑浏览器中进行图形化编程,AI 编程,控制您的陆吾 XGO机器人。

## 支持的机型

- **XGO-Lite**：轻量级四足机器狗,680g超轻设计,适合教育入门
- **XGO-Mini**：十二自由度AI机器狗,配备机械臂和500万像素摄像头,支持AI视觉和语音识别
- **XGO-Rider**：双轮足开源开发平台,基于树莓派,560g桌面级设计,支持AI边缘计算、自稳控制和地形跨越

- **未来的机型将陆续加入。**

## 安装要求

该 pip 包需要安装在陆吾 XGO 机器人系列的树莓派机器上。

## 安装步骤


1. **安装 xgo-blockly-luwuos 包**
   ```bash
   pip install xgo-blockly-luwuos -i https://pypi.tuna.tsinghua.edu.cn/simple
   ```
   
   **升级 xgo-blockly-luwuos 包**（如果已安装）：
   ```bash
   pip install --upgrade xgo-blockly-luwuos -i https://pypi.tuna.tsinghua.edu.cn/simple
   ```

## 启动服务

安装成功后，运行以下命令启动图形化编程和AI编程服务器：

```bash
xgo-blockly
```

## 使用方法

服务器启动后，在电脑上打开浏览器，访问树莓派的IP地址和端口号（默认端口号为8000，直接输入IP即可）即可开始图形化编程和AI编程。

## 功能特性

- 🎯 **图形化编程**：拖拽式编程界面，简单易用
- 🤖 **AI编程辅助**：智能代码生成和优化建议
- 🔗 **实时控制**：直接控制陆吾机器人硬件
- 🌐 **Web界面**：跨平台浏览器访问
- 📱 **响应式设计**：支持电脑、平板等设备

## 版本更新记录

### v1.0.6.13（2026-12-04）

1. **服务器项目存储**：编辑后自动保存、启动自动恢复最后一次项目；新增项目列表、打开、删除；项目目录不可写时自动回退到用户目录。
2. **保存方式重构**：保存对话框改为「项目 / 程序 × 本地 / 机器」四种组合，去掉原来独立的保存按钮。
3. **自定义函数增强**：修复函数默认参数显示，拖动调用块、工具箱预览都会带出默认值；双击函数定义或调用块可直接执行，并自动生成依赖的函数定义。
4. **工具箱默认参数补全**：如果条件、for-in 列表、显示图片/文字、变量赋值、函数返回值、「如果…返回」等积木都带可直接填写的默认值。
5. **顶部菜单栏重构**：改为「文件 / 工具」下拉菜单 + Blockly/AI写代码分段切换；切换视图不再丢失 Blockly 项目；打开项目和定位按钮统一回到开始块位置。
6. **API Key 提示优化**：打开项目、切换视图、展开大模型积木、选择模型时不再提示；只有运行实际用到大模型的代码时才提示，支持通义千问/豆包分别检查，单纯 import 不会触发。
7. **手柄连接管理**：主界面新增常驻「🎮 手柄」入口和连接弹窗，支持连接、断开、自动连接已配对设备、扫描配对新设备、设备列表管理。
8. **手柄连接持久化**：记住上次使用的手柄，服务启动后自动重连；脚本运行复用已有连接，不再每次运行都重新扫描/配对。
9. **未连接手柄提示**：运行需要手柄的脚本但未连接时提示「未连接手柄」，可直接打开连接弹窗。
10. **语音合成修复**：修复百度 TTS 写入 result.wav 的权限错误，以及每次合成约 10 秒的延迟（IPv4 优先解析、token 缓存、超时处理、修复文本二次编码）。
11. **SSH 终端修复**：终端地址跟随后端主机，连接失败时显示实际尝试的地址；移除会误杀其他服务终端 WebSocket 的 fuser 强杀逻辑。
12. 移除截图功能。

### v1.0.6.5

1. 新增实时模式，双击执行，同一个 Python 执行器环境
2. 新增网页 SSH，有文件管理功能，和常用命令
3. 新增摄像头标定，用户使用 AprilTag 定位距离方向等
4. 新增自动 import 功能
5. 运动库分区排列优化
6. 其他小功能升级改动

### v1.0.0.1

1. 调整 A、B 按键映射
2. 增加豆包大模型开通管理引导

## 技术支持

如有问题或需要技术支持,请联系陆吾机器人技术团队。

联系方式: hello@xgorobot.com

---

# XGO Blockly Visual Programming Server

## Introduction

XGO Blockly is a visual programming and AI programming server designed specifically for the Luwu XGO robot series. Through simple installation and startup, you can perform visual programming and AI programming in your computer browser to control your Luwu XGO robot.

## Supported Models

- **XGO-Lite**: Lightweight quadruped robot dog, ultra-light 680g design, suitable for educational introduction
- **XGO-Mini**: Twelve degrees of freedom AI robot dog, equipped with robotic arm and 5-megapixel camera, supporting AI vision and voice recognition
- **XGO-Rider**: Wheeled-legged open source development platform, based on Raspberry Pi, 560g desktop-level design, supporting AI edge computing, self-balancing control and terrain crossing

- **More models will be added in the future.**

## Installation Requirements

This pip package needs to be installed on the Raspberry Pi of the Luwu XGO robot series.

## Installation Steps


1. **Install xgo-blockly-luwuos package**
   ```bash
   pip install xgo-blockly-luwuos
   ```
   
   **Upgrade xgo-blockly-luwuos package** (if already installed):
   ```bash
   pip install --upgrade xgo-blockly-luwuos
   ```

## Starting the Service

After successful installation, run the following command to start the visual programming and AI programming server:

```bash
xgo-blockly
```

## Usage

After the server starts, open a browser on your computer and visit the Raspberry Pi's IP address and port number (default port is 8000) to begin visual programming and AI programming.

## Features

- 🎯 **Visual Programming**: Drag-and-drop programming interface, simple and easy to use
- 🤖 **AI Programming Assistant**: Intelligent code generation and optimization suggestions
- 🔗 **Real-time Control**: Direct control of Luwu robot hardware
- 🌐 **Web Interface**: Cross-platform browser access
- 📱 **Responsive Design**: Supports computers, tablets and other devices

## Version History

### v1.0.6.13 (2026-12-04)

1. **Server-side project storage**: auto-save while editing and auto-restore the last project on startup; added project list, open and delete; falls back to the user directory when the project directory is not writable.
2. **Save flow redesign**: the save dialog now offers "Project / Program × Local / Machine" combinations, replacing the previous standalone save buttons.
3. **Custom function improvements**: fixed default parameter display — dragged call blocks and toolbox previews now show defaults; double-clicking a function definition or call block executes it directly and generates dependent function definitions automatically.
4. **Toolbox default values**: if-condition, for-in list, show image/text, variable assignment, function return value, "if…return" and other blocks now come with directly editable defaults.
5. **Toolbar redesign**: "File / Tools" dropdown menus plus a Blockly / AI Code segmented switch; switching views no longer loses the Blockly project; opening a project and the locate button both return to the start block position.
6. **API Key prompt optimization**: no prompts when opening projects, switching views, expanding AI block categories or selecting models; prompts only when running code that actually uses an AI model (Qwen and Doubao checked separately, plain imports do not trigger).
7. **Gamepad connection management**: a persistent "🎮 Gamepad" entry and connection dialog on the main page, supporting connect, disconnect, auto-connect paired devices, scan & pair new devices, and device list management.
8. **Gamepad connection persistence**: remembers the last used device and reconnects automatically when the service starts; scripts reuse the existing connection instead of scanning/pairing on every run.
9. **"Gamepad not connected" prompt**: running a gamepad script without a connection now shows a prompt and can open the connection dialog directly.
10. **Text-to-speech fixes**: fixed the permission error when Baidu TTS writes result.wav, and the ~10-second delay per synthesis (IPv4-first resolution, token cache, timeouts, fixed double URL-encoding).
11. **SSH terminal fixes**: the terminal address now follows the backend host, and connection failures show the attempted address; removed the fuser kill that could terminate another service's terminal WebSocket.
12. Removed the screenshot feature.

### v1.0.6.5

1. Added real-time mode: double-click to execute blocks in a shared Python executor environment
2. Added web-based SSH terminal with file manager and common commands
3. Added camera calibration with AprilTag for distance and orientation positioning
4. Added auto-import functionality
5. Optimized motion library category layout
6. Other minor feature upgrades and improvements

### v1.0.0.1

1. Adjusted A and B button mapping
2. Added Doubao AI model activation and management guide

## Technical Support

If you have any questions or need technical support, please contact the Luwu Robotics technical team.

Contact: hello@xgorobot.com
