BlueROV仿真

AUV 2年前 (2021) admin
0

BlueROV仿真

BlueROV的源码编译及仿真

具体参考原网址操作:http://www.ardusub.com/
https://ardupilot.org/dev/docs/building-setup-linux.html

一 、源码编译

1、环境配置前最好先安装好Anaconda,最好新开个虚拟环境。并配置默认python版本,否则可能出现python版本不兼容的问题

BlueROV仿真

记得装完Anaconda后先用conda安装一个包future,下文要用。

conda install future

2、安装所需依赖。

sudo apt-get update
sudo apt-get install git
sudo apt-get install gitk git-gui

3、克隆源代码:

 git clone https://github.com/ardupilot/ardupilot.git
 cd ardupilot
 git submodule update --init --recursive
BlueROV仿真

4、运行脚本,克隆完源代码并更新完子模块。

Tools/environment_install/install-prereqs-ubuntu.sh -y
. ~/.profile //设置路径
BlueROV仿真 BlueROV仿真

5、编译代码前,首先检查ArduSub的稳定标签

git fetch --tags
git checkout ArduSub-stable -b new-branch
git submodule update --init --recursive

没报错就开始编译吧

6、编译

./waf configure --board Pixhawk1
./waf sub
BlueROV仿真 BlueROV仿真

如果前面没装好 future 就会报错,所以执行下图

BlueROV仿真

编译大概500多个cpp,完成后如下图

BlueROV仿真

第一阶段完成。。。

二、安装QGC

即安装 QGroundControl.AppImage

官网截图如下

BlueROV仿真

先把命令行的代码贴过来,方便大家复制粘贴

第1步的
sudo usermod -a -G dialout $USER
sudo apt-get remove modemmanager -y
sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl -y
第2步的
chmod +x ./QGroundControl.AppImage
./QGroundControl.AppImage

执行完第一步后关机重启ubuntu!!!

去官网下载QGroundControl.AppImage

第二步添加权限

然后执行或者直接双击即可打开。

三、SITL仿真

1、Pymavlink安装

ArduSub与称为MAVLink的协议进行通信。 Pymavlink是MAVLink协议的python实现。 使用pymavlink,可以创建一个python脚本来读取传感器数据并将命令发送到ArduSub车辆。

pip install mavproxy

记住,conda没有这个模块,必须使用pip装

测试pymavlink是否成功安装

pythonimport pymavlinkprint(pymavlink.__doc__)

输出Python MAVLink library - see http://www.qgroundcontrol.org/mavlink/mavproxy_startpage即为安装成功

2、SITL仿真

cd ardupilot/ArduSubsim_vehicle.py -w  //第一次使用先输入这句话sim_vehicle.py -L RATBeach --out=udp:0.0.0.0:14550 --map --console

执行第三行后出现以下窗口

BlueROV仿真

然后打开QGC即可自动连接

BlueROV仿真

接下来就是QGC操作,搭建环境成功。

版权声明:admin 发表于 2021-08-20 14:24:41。
转载请注明:BlueROV仿真 | 小贝比

暂无评论

暂无评论...