SITL Simulator —— ArduPilot —— Windows

版權聲明:本文爲博主原創博文,未經允許不得轉載,若要轉載,請說明出處並給出博文鏈接 

參考網頁:http://ardupilot.org/dev/docs/sitl-native-on-windows.html

本人實測流程:

1. 安裝MAVProxy,下載地址:http://firmware.ardupilot.org/Tools/MAVProxy/MAVProxySetup-latest.exe

    安裝可執行文件,接受許可證和所有其他默認設置。(一定要安裝在C盤的program files(x86)下,否則後面會報錯)

2. 安裝Cygwin, 下載Cygwin 32-bit installer or the Cygwin 64-bit installer(根據自己的電腦選擇).

而後  接受所有提示(包括默認文件位置),直到到達“選擇包”對話框。有數千個包。 查找包的最簡單方法是搜索名稱。 當您找到所需的軟件包時,單擊“skip”按鈕以選擇下載:

接着  選擇下面列出的包(使用“名稱”字段中的文本進行搜索,通過確認類別,名稱和描述來選擇下載):

名稱 類別 / 名稱 / 描述
autoconf Devel | autoconf: Wrapper scripts for autoconf commands
automake Devel | automake: Wrapper scripts for automake and aclocal
ccache Devel | ccache: A C compiler cache for improving recompilation
g++ Devel | gcc-g++ GNU Compiler Collection (C++)
git Devel | git: Distributed version control system
libtool Devel | libtool: Generic library support script
make Devel | make: The GNU version of the ‘make’ utility
gawk Interpreters | gawk: GNU awk, a pattern scanning and processing language
libexpat Libs | libexpat-devel: Expat XML parser library (development files)
libxml2-devel Libs | libxml2-devel: Gnome XML library (development)
libxslt-devel Libs | libxslt-devel: XML template library (development files)
python2-devel Python | python2-devel: Python2 language interpreter (python3 does not work yet)
procps System | procps-ng: System and process monitoring utilities (required for pkill)

如果您還想編譯固件,那麼您還應該安裝這些軟件包:

名稱 類別 / 名稱 / 描述
patch Devel | patch: Applies diff files
cmake Devel | cmake: Cross-platform makefile generation system
flex Devel | flex: A fast lexical analizer generator
bison Devel | bison: GNU yacc-compatible parser generator
zip Devel | zip: Info-ZIP compression utility
unzip Devel | unzip: Info-ZIP decompression utility
python2-pip Python | python2-pip: Python package instalation tool

上述軟件包安裝好後,如果您還要編譯固件,則還需要在cygwin提示符下發出以下命令:

pip2 install argparse
pip2 install empy

3. 在Cygwin中設置目錄/路徑

    先打開 Cygwin ;

    將文件系統導航到主目錄並打開.bashrc文件(例如C:\ cygwin \ home \ user_name \ .bashrc。

   通過在.bashrc末尾添加以下行,將Ardupilot源的路徑添加到cygwin。 請注意,您的源可能不在$ HOME中,而是在以/ cygdrive / c / Users /開頭的其他固定路徑中

export PATH=$PATH:$HOME/ardupilot/Tools/autotest

    此時關閉Cygwin,再打開。路徑就已經包含了進來。

4. 安裝需要的Python安裝包

python -m ensurepip --user
python -m pip install --user future
python -m pip install --user lxml
python -m pip install --user uavcan

5.  下載和編譯ArduPilot

 在Cygwin裏面輸入下面:

git clone git://github.com/ArduPilot/ardupilot.git
cd ardupilot
git submodule update --init --recursive

如果你已經有clone過了ArduPilot,請使用“cd / cygdrive / drive / path”在終端中導航到它即“cd / cygdrive / c / Users / James / Documents / GitHub / ardupilot”(替換你自己的路徑)。

在終端導航到ArduPlane目錄並運行make,如下所示(也可以更換到ArduCopter or APMrover2):

cd ~/ardupilot/Arduplane
make sitl

6. 上述全部OK,就執行下面(不同的機型  在 -f後面修改,固定翼是plane ,可以sim_vehicle.py  -h 查看下)

cd ~/ardupilot/ArduPlane
sim_vehicle.py -f plane

7. 打開misson planner, 默認連接TCP:127.0.0.1:5762

8. 最後附上一張用模擬器測試飛行的路徑圖

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章