PI-SwarmGCS
基于Cesium的无人设备管理、控制,能够显示无人设备的各种信息,完成控制,任务管理,地图显示等。
安装、使用
建议使用conda
# 首次创建环境
conda create -n pi-uav python=3.11
# 激活环境
conda activate pi-uav
下载代码:
git clone --recurse-submodules git@gitee.com:pi-lab/pi-swarmgcs.git
如果下载的时候没有加 --recurse-submodules,可以在普通的clone后执行:
git clone git@gitee.com:pi-lab/pi-swarmgcs.git
git submodule update --init --recursive
安装Python到本地conda环境, 方便开发
pip install -e ".[all]"
cd thirdparty/pi-uav-protocol
pip install -e ".[all]"
打包说明:本项目已改为标准 Python 包(
src/pi_swarmgcs/布局)。安装后可直接用pi-swarmgcs命令启动。前端资源(Cesium 库、css、js、index.html、示例 mission) 随包分发;场景数据(3D 模型models/、3DGS 点云3dgs_data/、3D TilesMS-3Dtiles/、*.pt权重等体积较大,不进包)需自备,通过--data-dir指向。
本程序运行起来需要一些场景数据文件,可从服务器上的
/home/a409/users/songziheng/cesium_gcs/data 拷贝到本地某个数据目录(如 ./data),
启动时用 --data-dir 指向它。
首先在 scripts/pi-mavlink-tools/apm_sim.py 有apm仿真器
可以执行这个指令仿真两台无人机
python scripts/pi-mavlink-tools/apm_sim.py --UAV_N 2
如果报错是apm文件需要授权输入这个指令:
chmod +x ~/scripts/pi-mavlink-tools/apm/arducopter
注意目录替换成自己的
然后启动服务器(pip 安装后用 pi-swarmgcs 命令;开发态也可 python -m pi_swarmgcs):
# 在数据目录所在位置启动(-d 指向场景数据目录)
pi-swarmgcs -c data/config.json -d ./data
启动完成之后在服务器控制台输入
load apm_protocol
会加载apm仿真的无人机到UI界面上
在浏览器输入http://localhost:8100 就能看到对应的无人机了
第二部分:
大语言模型控制服务启动:
参照thirdparty/llm_auto_control_v2/README.md里的说明对环境进行安装。注:主要是安装本地语音大模型的环境,还有python必须是py3.10
python thirdparty/llm_auto_control_v2/experiment/web_apm_ui_main.py
等待语音模型加载成功即可。
效果展示:
大语言模型控制的通用接口适配了 PX4、AirSim、PI-MAVLink、APM 等各个平台的控制及语音控制功能,详见 airsim-lib。
关于git submodule
增加submodule
cd thirdparty
git submodule add -b master git@gitee.com:pi-lab/pi-uav-protocol.git pi-uav-protocol
在更新submodule的内容后,需要注意branch是否是master,如果不是,则需要先切换到 master 然后在提交
cd thirdparty/pi-uav-protocol
git baranch
git add -A
git commit -m "commit message"
# 如果当前的分支不是master,分支是一个数字,那么先创建一个临时分支
git checkout -b test
# 切换到master分支,然后合并临时分支
git checkout master
git merge test
# 提交到submodule的仓库
git push origin master
等各个submodule都提交了之后,再提交 pi-swarmgcs 到仓库
# 先确认一下当前项目做了那些改变,如果有些不需要提交的东西,可以把不提交的内容放到 .gitignore 里面
git add -A
git commit -m "commit message"
git push origin master
关于 git submodule 更详细的用法可以可以参考 git submodule用法说明
References
- https://gitee.com/pi-lab/pi-uav-protocol 无人设备统一协议
- https://gitee.com/pi-lab/PI-Metaverse 新一代集无人机操控、任务控制、数据处理、结果展示和态势感知为一体的软件系统
- https://gitee.com/pi-lab/pi-mavlink 集群无人机控制程序
- https://gitee.com/pi-lab/cesium_viz Cesium可视化程序,本项目前身的项目
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pi_swarmgcs-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pi_swarmgcs-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4848d50dc2f5ff7e91bf101a20f80482ddcda1387dd4f89c581215eff1b24f64
|
|
| MD5 |
4b6fc41dfae7fd3b4486b29ace53e9b0
|
|
| BLAKE2b-256 |
dc4efcb29a3ae11f335e2a40ba3c0cdc07ba57b2d9548236638681780c55ee6e
|