原文链接:http://ardupilot.org/dev/docs/building-ardupilot-onwindows10.html

翻译水平有限,如有错误请指出!

  在Windows上使用waf和Bash编译ArduPilot

警告:

  这个编译方法仅适用于Windows10 X64并且没有描述编译不推荐的给予Arduino的飞行控制器(APM1.x,2.x)。支持大多数使用者,但是你可能需要或者更喜欢备用的windows编译过程:http://ardupilot.org/dev/docs/building-px4-with-make.html

  微软有介绍WSL-the Windows Subsytem for Linux(Linux的Windows子系统)-对Win10.这个教程描写“在Windows上的Ubuntu的Bash”,因为他是目前唯一由WSL支持的发行版本。其他Linux版本比如Fedora,可能在未来可以使用然而将稍微需要不同的设置去编译ArduPilot。

警告:

  这个教程预期作为一个“复制粘贴”引导,只要按照这个步骤一步步来就好。

小窍门:

  网上有很多安装Linux的Windows子系统。这是一个例子:https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/

小窍门:

  随着Windows10更新的“秋季推送”从WSL到Windows的文件夹访问被破坏。貌似如果你把Ardupilot的源代码放到一个windows驱动下从WSL经过/mnt/<drive>文件夹编译,最终会有随机的包含(include)错误。为了成功编译源代码,你必须把源码放到一个本地的WSL文件系统下或者放到Windows下面共享它,并通过drvfs驱动程序挂载,如:

mount -t drvfs '\\127.0.0.1\ardupilot' /devel/ardupilot

  

  通过Windows10上的Ubuntu bash安装Ardupilot开发环境

  1.第一步,你必须将你的本地主机写入到/etc/hosts文件:

sudo nano /etc/hosts

  2.插入到第一行的下面:

127.0.0.1 "hostname"

  (“hostname”是指PC名称)

  3.然后使用root账户操作终端:

sudo passwd root
su root

  4.返回主目录

cd

  5.安装git:

sudo apt-get install git

  6.为将来的参考做一个新文件夹(可选):

mkdir GitHub
cd GitHub

  7.Clone ardupilot git

git clone https://github.com/ArduPilot/ardupilot.git

  8.当WSL的root路径下没有“opt”文件夹的时候创建一个新的文件夹:

sudo mkdir /opt

  9.运行 install-prereqs-ubuntu.sh 脚本:

./ardupilot/Tools/scripts/install-prereqs-ubuntu.sh

  10.我们同时需要安装一些外部工具,以便我们能够编译各种各样的Ardupilot目标:

cd

sudo add-apt-repository ppa:george-edison55/cmake-.x -y
sudo apt-get update
sudo apt-get install cmake sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9 sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi=4.9..2015q3-1trusty1 sudo apt-get update
sudo apt-get upgrade

  编译ArduPilot源码

  1.“waf”是首选的Ardupilot编译工具,他在windows和Ubuntu Bash下性能优异。首先gitArdupilot软件:

cd
cd GitHub/ardupilot/

  2.使用下面的命令能够获得ArduPilot的支持板卡列表:

./waf list_boards

  3.设置你的板卡

./waf configure --board target

  (“target”可以是px4-v2,navio,pxf...从上述提到的支持板卡中选择)

  4.编译你的目标:

./waf vehicle

  (“vehicle”能够是 copter,plane,rover...)

  5.当你到了这里,你已经编译成功了!

笔记:

  已发布的WSL无法访问USB串行外设,因此waf中的上传选项无法通过USB工作。编译生成的二进制文件必须通过其他工具上传到你的飞控,比如使用MissionPlanner作为一个“自制固件”。如果你想要通过waf上传,在写USB串行访问时,只能在Windows子系统Linux版(WSL)的Windows内部版本中使用,这需要你加入Windows内部人员程序。https://insider.windows.com/GettingStarted 对于有网络连接的飞行器管理者,Linu targets,上传的功能描述如下:https://github.com/ArduPilot/ardupilot/blob/master/BUILD.md

小窍门:

  如果你想取消隐藏Windows系统上的Ubuntu系统文件夹,以管理员身份打开命令提示符,导航到Ubuntu系统路径(C:\Users\username\AppData\Local)并更改文件夹属性。所以(“username”是你的用户名):

cd C:\Users\username\AppData\Local
attrib -s -h lxss

  你可以建立一个快捷方式在你的桌面方便快捷导航到“lxss”。

  如果事情没有按照计划进行,你可能需要一些东西

sudo apt-get install python
git submodule update --recursive --init modules/uavcan
pip install future
pip install lxml
sudo apt-get install genromfs
sudo apt-get install unzip
sudo apt-get install zip
apt-get install python-empy

【译】Building ArduPilot on Windows with waf and Bash的更多相关文章

  1. Building OpenCascade on Windows with Visual Studio

    Building OpenCascade on Windows with Visual Studio eryar@163.com 摘要Abstract:详细说明OpenCascade的编译配置过程,希 ...

  2. 在Windows中运行Linux bash命令的几种方法

    如果你正在课程中正在学习 shell 脚本,那么需要使用 Linux 命令来练习命令和脚本. 你的学校实验室可能安装了 Linux,但是你自己没有安装了 Linux 的笔记本电脑,而是像其他人一样的 ...

  3. 译:重置/还原Windows IIs设置为默认设置

    译文出处:http://www.codeproject.com/Tips/870858/Reset-Restore-IIS-Settings-to-its-Default-in-Windo 简介: I ...

  4. Building Apps for Windows 10 on LattePanda–Jump Start

    1.引言 目前来看,LattePanda应该是最小的运行Full Windows 10系统的开发板了(注意,不是Windows 10 for Mobile,也不是Windows 10 IoT系列,而是 ...

  5. 在windows上编译chrome浏览器Building Chromium for Windows

    web端用webRTC实现的一对一视频,互动直播和会议.https://github.com/starrtc/android-demo Chromium requires Visual Studio ...

  6. Building Apps for Windows Phone 8.1教程下载地址整理

    官方教程地址http://channel9.msdn.com/Series/Building-Apps-for-Windows-Phone-8-1http://media.ch9.ms/ch9/8db ...

  7. Tips on Building WebRTC on Windows

    Problem: Git ask me to input git user and password Solution: Set environment variable SET DEPOT_TOOL ...

  8. Windows 10 运行原生Bash【Ubuntu】

    当前widnows用户的 AppData\Local\lxss 目录下安装了ubuntu,其中rootfs是和ubuntu安装的目录一致 bash进入的就是LINUX的SHELL,因此其二进制格式是E ...

  9. Windows下修改Git bash的HOME路径

    Windows中使用http://git-scm.com/安装Git bash工具,默认的HOME和~路径一般都是C:\Users\用户名,每次得用命令切换到常用的Repository下,此操作重复而 ...

随机推荐

  1. 牛客小白月赛12 I 华华和月月逛公园 Tarjan算法求隔边

    题目链接:https://ac.nowcoder.com/acm/contest/392/I 题意:给你一个连通的无向图,问图的隔边有多少条 输入:N,M分别是点数和边数 之后M行每行两个正整数u,v ...

  2. CSS中的伪类与伪元素

    在前端开发中,大家或多或少的有接触过CSS伪类和伪元素,使用伪元素的时候,总感觉和伪类很相似,但又不能详细的说出两者的区别和联系,那么两者到底有什么区别和联系呢? 在 W3C 中定义: 伪类:用于向某 ...

  3. 云服务器上mysql的配置

    mysql的配置 要想云服务器的mysql数据库能被外部连接,还需要做一些配置 首先执行下面三条命令: sudo apt-get install mysql-server sudo apt isnta ...

  4. 菜鸟脱壳之脱壳的基础知识(五)——利用内存断点寻找OEP

    经过第一节的基础知识,我们都知道了,加壳程序首先解把原来压缩的代码解压,然后放到所对应的区块中,当外壳程序执行完毕后,跳回到OEP执行,我们都知道,OEP是放在代码段中,也就是当外壳程序处理完毕后,跳 ...

  5. AVL平衡二叉树实现

    #include<stdio.h> #include<stdlib.h> #define TRUE 1 #define FALSE 0 #define EH 0 #define ...

  6. ie 下date对象

    var t = '2014-02-26T21:18:02.497' var a = t.replace(/(\d{4})-(\d{2})-(\d{2})T(.*)?\.(.*)/, "$1/ ...

  7. 聚合函数count()

    2018-08-12

  8. Linux 搭建Hadoop集群 ----workcount案例

    在 Linux搭建集群---JDK配置 Linux搭建集群---SSH免密登陆 Linux搭建集群---集群搭建成功 的基础上实现workcount案例 注意 虚拟机三台启动集群(自己亲自搭建) 1. ...

  9. C语言:统计数字空格其他字符程序

    #include <stdio.h> int main(){ char t; int num=0; int spac=0; int other=0; int sum=0; printf(& ...

  10. linux基本网络配置

    -- linux基本网络配置管理 rhel6开始有一个networkmanger的网络配置服务(可以图形配置网络,拔号,无线连接,vpn等)但此服务开启会造成你的ip不固定(会dhcp获取),而且后期 ...