Ardupilot開源飛控工程項目編譯回顧
- 1. 源由
- 2. 工程編譯
- 3. 命令列表
- 3.1 工作環境設置
- 3.2 獲取工程代碼
- 3.3 建立編譯環境
- 3.4 編譯工程代碼
- 3.5 保存編譯結果
- 3.6 清理編譯結果
- 3.7 編譯設備目標
- 4. 補充
1. 源由
最近,有點莫名的連續遇到了2次Ardupilot編譯報錯。百思不得其解,特地記錄下,以便后續不要犯類似的毛病。
問題/現象這里不重復了,請看鏈接: Build error compiling 4.5.1 Copter with F405 (4.4.x) target #26785
2. 工程編譯
正常工作編譯,大家可以參考:
- 【1】ArduPilot飛控AOCODARC-H7DUAL固件編譯
好處:中文
壞處:無法與官方項目同步
- 【2】ArduPilot - Building the code
好處:最新同步文檔
壞處:英語不習慣的人,。。。。不多說,反正永遠也不會習慣。。。。
3. 命令列表
這里羅列一些日常常用的工程編譯命令。
3.1 工作環境設置
- git代理設置
$ git config --global "url.ssh://git@ssh.github.com:443/.insteadOf" git@github.com:
$ git config --global http.proxy http://192.168.1.9:808
$ git config --global https.proxy http://192.168.1.9:808
- http/https代理設置
$ export https_proxy=http://192.168.1.9:808/
$ export http_proxy=http://192.168.1.9:808/
3.2 獲取工程代碼
通常git協議容易獲取代碼,https不是很方便,而且開發角度使用git會更好。
$ git clone git@github.com:ArduPilot/ardupilot.git
3.3 建立編譯環境
$ cd ardupilot
$ ./Tools/environment_install/install-prereqs-ubuntu.sh -y
3.4 編譯工程代碼
$ cd ardupilot
$ ./Tools/gittools/submodule-sync.sh
$ ./Tools/scripts/build_bootloaders.py Aocoda-RC-H743Dual
$ ./waf configure --board Aocoda-RC-H743Dual
$ ./waf copter
3.5 保存編譯結果
$ cd ardupilot
$ cd build
$ rm -rf ArduCopter lib libraries modules .dep .wafpickle-linux*
$ zip -r Aocoda-RC-H743Dua.zip Aocoda-RC-H743Dual
3.6 清理編譯結果
$ ./waf clean
3.7 編譯設備目標
$ ./waf copter //多旋翼
$ ./waf heli //直升機
$ ./waf antennatracker //跟蹤天線
$ ./waf blimp //飛艇
$ ./waf plane //固定翼
$ ./waf rover //車
$ ./waf sub //潛水艇
4. 補充
暫時,先到這里,如果有其他想法的朋友,可以評論區告訴我。