SITL 介绍
SITL(循环中的软件)模拟器允许您在没有任何硬件的情况下运行Plane,Copter或Rover。
Windows下的安装使用
1 安装Cygwin
1.1 下载Cywin安装包
下载安装文件setup-x86_64.exe。下载地址
1.2 安装Cywin
在安装文件所在目录打开命令行窗口,根据以下命令安装
setup-x86_64.exe -P autoconf,automake,ccache,gcc-g++,git,libtool,make,gawk,libexpat-devel,libxml2-devel,python36,python36-future,python36-lxml,python36-pip,libxslt-devel,python36-devel,procps-ng,zip,gdb,ddd
一直next,直至完成。
下载完后,新增系统变量,变量名为CYGWIN_HOME,值为安装Cygwin的地址
2 安装 GCC compiler
安装包下载地址
最后一步要选择Add path to environment variable
3 安装MAVProxy
4 在Cygwin中设置目录/路径和额外的包
4.1 初始化
打开“Cygwin64 Terminal" 应用,然后关闭,用于初始化。
4.2 设置目录和下载包
ln -s /usr/bin/python3.6 /usr/bin/python
ln -s /usr/bin/pip3.6 /usr/bin/pip
pip install empy pyserial pymavlink
若出现
ln: failed to create symbolic link ‘/usr/bin/python’: File exists
的错误提示,将命令改为
ln -sf … 如下图所示
5 下载ArduPilot源代码
git clone https://github.com/ardupilot/ardupilot.git
cd ardupilot
git submodule update --init --recursive
6 运行SITL
- 打开Cygwin64终端
- 进入ardupilot所在目录,运行sim_vehicle.py
- 相关的操作看这里https://ardupilot.org/dev/docs/sitl-examples.html
cd ~/ardupilot/ArduCopter
../Tools/autotest/sim_vehicle.py --map --console
这个是模拟无人机的,我在使用过程中发现它一下就没电,不清楚如何修改
可以将ArduCopter改为Rover,即
cd ~/ardupilot/Rover
…/Tools/autotest/sim_vehicle.py --map --console
具体操作可以看https://ardupilot.org/dev/docs/rover-sitlmavproxy-tutorial.html