[pixhawk笔记]1-编译过程
好久没有编译过PIXHAWK了,由于项目需要,又买了一个pixhawk2,由于每次编译都会出现新的问题,这次写帖子将过程记录下来。
环境:WIN10+Ubuntu16.04 64位(VMware Workstation 12 Pro虚拟机)。
基本按照pixhawk的Devguide里面给的步骤,将遇到的问题和解决方法给出,希望能帮助到遇到这些问题的同学。
使用下列命令将用户加入dialout用户组:
sudo usermod -a -G dialout $USER
然后,下载并运行工具链安装脚本:
为简便起见,我使用wget命令行下载。
wget https://raw.githubusercontent.com/PX4/Devguide/master/build_scripts/ubuntu_sim_nuttx.sh
source ubuntu_sim_nuttx.sh
待一串提示完成之后,即完成工具链安装。
之后是下载并编译代码:
mkdir -p ~/src
cd ~/src
git clone https://github.com/PX4/Firmware.git
然后更新子模块(官网的文档以前有这一步,但不知为何,现在将这一步去掉了,加入该步可以在编译时更省时并免且排错时更容易):
cd Firmware
git submodule update --init --recursive
make posix jmavsim
编译通过后会弹出jmavsim的界面仿真界面
但是题主的老弹出Gyro和Accel fail的错误,据说是因为电脑配置太差,虚拟机太慢所致( ˇˍˇ ),所以建议大家有条件还是用单独的机子装Ubuntu玩。
然后编译V2固件,为pixhawk一代用的标准固件:
make px4fmu-v2_default
题主在编译V2固件时,遇到如下问题:
- 创建编译目录的权限问题
处理方法如下:修改src目录的权限
sudo chmod -R 777 src
- python的em模块以及catkin_pkg包找不到
经检查是因为题主之前用anaconda装了python3.5,默认的用的python3.5,而pixhawk中的包貌似用的python2,将默认的改为python2.7,修改方法将.bashrc中的python路径改为python2.7的即可。
并安装对应的pip和python-empy。注意,安装pip时,按照官网给出的方法通过下载get-pip.py,然后安装,下载时速度很慢。可以用apt安装,代码如下:
sudo apt-get install python-pip
以上两个问题处理之后,可以编译通过,由于题主用的pixhawk2,所以使用
make px4fmu-v3_default upload
编译并上传代码
用usb线将pixhawk2和电脑usb口连接,即可完成编译并上传,如无错误,输出如下:spy@ubuntu:~/src/Firmware$ make px4fmu-v3_default upload
[ %] Built target git_genmsg
[ %] Built target mixer_gen
[ %] Built target git_nuttx
[ %] Built target git_gencpp
[ %] Built target git_matrix
[ %] Built target git_uavcan
[ %] Built target git_mavlink
[ %] Built target git_ecl
[ %] Built target libuavcan_dsdlc
[ %] Built target ver_gen
[ %] Built target airframes_xml
[ %] Built target parameters_xml
[ %] Built target nuttx_copy_px4fmu-v3
[ %] Built target nuttx_copy_px4io-v2
[ %] Built target px4fmu-v3-nuttx_patch_00001-REJECTED-add-math.h.patch
[ %] Built target px4io-v2-nuttx_patch_00001-REJECTED-add-math.h.patch
[ %] Built target px4fmu-v3-nuttx_patch_00002-REJECTED-fix-shadow-wanings.patch
[ %] Built target px4io-v2-nuttx_patch_00002-REJECTED-fix-shadow-wanings.patch
[ %] Built target px4io-v2-nuttx_patch_00003-REJECTED-add-var-expansion-in-nsh-parse.patch
[ %] Built target px4fmu-v3-nuttx_patch_00003-REJECTED-add-var-expansion-in-nsh-parse.patch
[ %] Built target px4io-v2-nuttx_patch_00004-REJECTED-avoid-export-copy-with-export-insitu.patch
[ %] Built target px4fmu-v3-nuttx_patch_00004-REJECTED-avoid-export-copy-with-export-insitu.patch
[ %] Built target px4io-v2-nuttx_patch_00005-REJECTED-support-c++.patch
[ %] Built target px4fmu-v3-nuttx_patch_00005-REJECTED-support-c++.patch
[ %] Built target px4io-v2-nuttx_patch_00006-REJECTED-cstdint-fix.patch
[ %] Built target px4fmu-v3-nuttx_patch_00006-REJECTED-cstdint-fix.patch
[ %] Built target px4io-v2-nuttx_patch_00007-REJECTED-silence-jobserver-warnings.patch
[ %] Built target px4io-v2-nuttx_patch_00008-REJECTED-static-assert-fix.patch
[ %] Built target px4fmu-v3-nuttx_patch_00007-REJECTED-silence-jobserver-warnings.patch
[ %] Built target px4io-v2-nuttx_patch_00009-REJECTED-ctype-fix-shadow-wanings.patch
[ %] Built target px4fmu-v3-nuttx_patch_00008-REJECTED-static-assert-fix.patch
[ %] Built target px4io-v2-nuttx_patch_00010-BACKPORT-stm32-flash-F4-dcache-corruption-fix-no-HSI-on.patch
[ %] Built target px4io-v2-nuttx_patch_00011-BACKPORT-priority-restoration-fix.patch
[ %] Built target px4fmu-v3-nuttx_patch_00009-REJECTED-ctype-fix-shadow-wanings.patch
[ %] Built target px4io-v2-nuttx_patch_00012-BACKPORT-stack-coloration-overreach-fix.patch
[ %] Built target px4fmu-v3-nuttx_patch_00010-BACKPORT-stm32-flash-F4-dcache-corruption-fix-no-HSI-on.patch
[ %] Built target px4io-v2-nuttx_patch_00013-BACKPORT-stm32-serial-dma-hotfix.patch
[ %] Built target px4fmu-v3-nuttx_patch_00011-BACKPORT-priority-restoration-fix.patch
[ %] Built target px4io-v2-nuttx_patch_00014-BACKPORT-i2c-hotfix.patch
[ %] Built target px4fmu-v3-nuttx_patch_00012-BACKPORT-stack-coloration-overreach-fix.patch
[ %] Built target px4io-v2-nuttx_patch_00015-BACKPORT-stm32f7-DTCM.patch
[ %] Built target px4fmu-v3-nuttx_patch_00013-BACKPORT-stm32-serial-dma-hotfix.patch
[ %] Built target px4io-v2-nuttx_patch_00016-BACKPORT-fix-CRTSCTS-defines.patch
[ %] Built target px4io-v2-nuttx_patch_00017-BACKPORT-cdcacm.patch
[ %] Built target px4fmu-v3-nuttx_patch_00014-BACKPORT-i2c-hotfix.patch
[ %] Built target px4io-v2-nuttx_patch_00018-BACKPORT-stm32-serial-break.patch
[ %] Built target px4fmu-v3-nuttx_patch_00015-BACKPORT-stm32f7-DTCM.patch
[ %] Built target px4io-v2-nuttx_patch_00019-BACKPORT-stm32-rcc-keep-HSI-on.patch
[ %] Built target px4fmu-v3-nuttx_patch_00016-BACKPORT-fix-CRTSCTS-defines.patch
[ %] Built target px4io-v2-nuttx_patch_00020-BACKPORT-ramtron-CONFIG-prefix.patch
[ %] Built target px4fmu-v3-nuttx_patch_00017-BACKPORT-cdcacm.patch
[ %] Built target px4io-v2-nuttx_patch_00021-BACKPORT-stm32f3x-add-BKP.patch
[ %] Built target px4fmu-v3-nuttx_patch_00018-BACKPORT-stm32-serial-break.patch
[ %] Built target px4io-v2-nuttx_patch_00022-BACKPORT-stm32-bkp-reference-fix.patch
[ %] Built target px4fmu-v3-nuttx_patch_00019-BACKPORT-stm32-rcc-keep-HSI-on.patch
[ %] Built target px4io-v2-nuttx_patch_00023-BACKPORT-stm32f7-bkp-reference-fix.patch
[ %] Built target px4fmu-v3-nuttx_patch_00020-BACKPORT-ramtron-CONFIG-prefix.patch
[ %] Built target px4io-v2-nuttx_patch_00024-BACKPORT-stm32f7-serial-dma-hotfix.patch
[ %] Built target px4fmu-v3-nuttx_patch_00021-BACKPORT-stm32f3x-add-BKP.patch
[ %] Built target px4io-v2-nuttx_patch_00025-BACKPORT-add-set-ex-to-nsh.patch
[ %] Built target px4fmu-v3-nuttx_patch_00022-BACKPORT-stm32-bkp-reference-fix.patch
[ %] Built target px4io-v2-nuttx_patch_00026-BACKPORT-stm32fX-serial-fix-freezing.patch
[ %] Built target px4fmu-v3-nuttx_patch_00023-BACKPORT-stm32f7-bkp-reference-fix.patch
[ %] Built target px4io-v2-nuttx_patch_00027-BACKPORT-stm32-sdio--bit-and-16G-fix.patch
[ %] Built target px4fmu-v3-nuttx_patch_00024-BACKPORT-stm32f7-serial-dma-hotfix.patch
[ %] Built target px4io-v2-nuttx_patch_00030-BACKPORT-fix-arm-none-eabi-gcc--warnings-nuttx.patch
[ %] Built target px4fmu-v3-nuttx_patch_00025-BACKPORT-add-set-ex-to-nsh.patch
[ %] Built target px4io-v2-nuttx_patch_00031-BACKPORT-fix-arm-none-eabi-gcc--warnings-apps.patch
[ %] Built target px4io-v2-nuttx_patch_90000-PENDING-wip-inflight-to-upstream.patch
[ %] Built target px4fmu-v3-nuttx_patch_00026-BACKPORT-stm32fX-serial-fix-freezing.patch
[ %] Built target nuttx_patch_px4io-v2
[ %] Built target px4fmu-v3-nuttx_patch_00027-BACKPORT-stm32-sdio--bit-and-16G-fix.patch
[ %] Built target nuttx_configure_px4io-v2
[ %] Built target px4fmu-v3-nuttx_patch_00030-BACKPORT-fix-arm-none-eabi-gcc--warnings-nuttx.patch
[ %] Built target nuttx_export_px4io-v2
[ %] Built target px4fmu-v3-nuttx_patch_00031-BACKPORT-fix-arm-none-eabi-gcc--warnings-apps.patch
[ %] Built target io_prebuild_targets
[ %] Built target px4fmu-v3-nuttx_patch_90000-PENDING-wip-inflight-to-upstream.patch
[ %] Built target nuttx_patch_px4fmu-v3
[ %] Built target nuttx_configure_px4fmu-v3
[ %] Built target nuttx_export_px4fmu-v3
[ %] Built target prebuild_targets
[ %] Built target msg_gen
[ %] Built target generate_topic_listener
[ %] Built target platforms__common
[ %] Built target drivers__airspeed
[ %] Built target drivers__blinkm
[ %] Built target px4io-v2
[ %] Built target drivers__bmi160
[ %] Built target drivers__bmp280
[ %] Built target drivers__boards__px4fmu-v2
[ %] Built target drivers__camera_trigger
[ %] Built target drivers__bst
[ %] Built target drivers__device
[ %] Built target drivers__ets_airspeed
[ %] Built target drivers__hott
[ %] Built target drivers__frsky_telemetry
[ %] Built target drivers__hmc5883
[ %] Built target drivers__gps
[ %] Built target drivers__iridiumsbd
[ %] Built target drivers__hott__hott_telemetry
[ %] Built target drivers__hott__hott_sensors
[ %] Built target drivers__l3gd20
[ %] Built target drivers__led
[ %] Built target drivers__lsm303d
[ %] Built target drivers__lis3mdl
[ %] Built target drivers__ll40ls
[ %] Built target drivers__mb12xx
[ %] Built target drivers__mkblctrl
[ %] Built target drivers__mpu6000
[ %] Built target drivers__ms4525_airspeed
[ %] Built target drivers__mpu9250
[ %] Built target drivers__ms5525_airspeed
[ %] Built target drivers__oreoled
[ %] Built target drivers__ms5611
[ %] Built target drivers__pwm_out_sim
[ %] Built target drivers__pwm_input
[ %] Built target drivers__px4flow
[ %] Built target drivers__px4fmu
[ %] Built target lib__led
[ %] Built target drivers__sf0x
[ %] Built target drivers__px4io
[ %] Built target drivers__sdp3x_airspeed
[ %] Built target drivers__sf1xx
[ %] Built target drivers__srf02
[ %] Built target drivers__stm32__adc
[ %] Built target drivers__snapdragon_rc_pwm
[ %] Built target drivers__stm32
[ %] Built target drivers__stm32__tone_alarm
[ %] Built target drivers__tap_esc
[ %] Built target drivers__trone
[ %] Built target drivers__vmount
[ %] Built target modules__sensors
[ %] Built target systemcmds__config
[ %] Built target systemcmds__bl_update
[ %] Built target systemcmds__esc_calib
[ %] Built target systemcmds__dumpfile
[ %] Built target systemcmds__hardfault_log
[ %] Built target systemcmds__led_control
[ %] Built target systemcmds__mixer
[ %] Built target systemcmds__motor_ramp
[ %] Built target systemcmds__mtd
[ %] Built target systemcmds__perf
[ %] Built target systemcmds__param
[ %] Built target systemcmds__nshterm
[ %] Built target systemcmds__pwm
[ %] Built target systemcmds__reboot
[ %] Built target systemcmds__sd_bench
[ %] Built target systemcmds__top
[ %] Built target systemcmds__ver
[ %] Built target systemcmds__topic_listener
[ %] Built target drivers__sf0x__sf0x_tests
[ %] Built target drivers__test_ppm
[ %] Built target lib__controllib__controllib_test
[ %] Built target modules__commander__commander_tests
[ %] Built target modules__unit_test
[ %] Built target modules__mc_pos_control__mc_pos_control_tests
[ %] Built target modules__mavlink__mavlink_tests
[ %] Built target modules__uORB__uORB_tests
[ %] Built target modules__gpio_led
[ %] Built target modules__uORB
[ %] Built target modules__commander
[ %] Built target modules__land_detector
[ %] Built target modules__load_mon
[ %] Built target systemcmds__tests
[ %] Built target platforms__nuttx
[ %] Built target modules__camera_feedback
[ %] Built target modules__mavlink
[ %] Built target modules__navigator
[ %] Built target modules__attitude_estimator_q
[ %] Built target modules__ekf2
[ %] Built target modules__position_estimator_inav
[ %] Built target modules__local_position_estimator
[ %] Built target lib__external_lgpl
[ %] Built target modules__mc_att_control
[ %] Built target modules__mc_pos_control
[ %] Built target lib__ecl
[ %] Built target modules__vtol_att_control
[ %] Built target modules__logger
[ %] Built target modules__sdlog2
[ %] Built target modules__dataman
[ %] Built target modules__systemlib__param
[ %] Built target modules__systemlib__mixer
[ %] Built target lib__controllib
[ %] Built target lib__conversion
[ %] Built target modules__systemlib
[ %] Built target df_driver_framework
[ %] Built target lib__geo
[ %] Built target lib__geo_lookup
[ %] Built target lib__launchdetection
[ %] Built target lib__mathlib
[ %] Built target lib__mathlib__math__filter
[ %] Built target lib__runway_takeoff
[ %] Built target lib__tailsitter_recovery
[ %] Built target lib__version
[ %] Built target lib__terrain_estimation
[ %] Built target examples__rover_steering_control
[ %] Built target platforms__nuttx__px4_layer
[ %] Built target modules__bottle_drop
[ %] Built target examples__segway
[ %] Built target examples__fixedwing_control
[ %] Built target examples__px4_mavlink_debug
[ %] Built target examples__px4_simple_app
[ %] Built target examples__px4_daemon_app
[ %] Built target fw_io
[ %] Built target examples__hwtest
[ %] Built target examples__ekf_att_pos_estimator
[ %] Built target drivers__rgbled
[ %] Built target modules__fw_att_control
[ %] Built target modules__fw_pos_control_l1
[ %] Built target modules__events
[ %] Built target modules__gnd_pos_control
[ %] Built target modules__gnd_att_control
[ %] Built target lib__DriverFramework__framework
[ %] Built target uavcan
[ %] Built target romfs
[ %] Built target uavcan_stm32_driver
[%] Built target modules__uavcan
[%] Built target firmware_nuttx
[%] uploading /home/spy/src/Firmware/build_px4fmu-v3_default/src/firmware/nuttx/px4fmu-v3_default.px4
Loaded firmware for ,, size: bytes, waiting for the bootloader...
If the board does not respond within - seconds, unplug and re-plug the USB connector.
Attempting reboot on /dev/serial/by-id/usb-3D_Robotics_PX4_FMU_v2.x_0-if00 with baudrate=...
If the board does not respond, unplug and re-plug the USB connector.
Found board , bootloader rev on /dev/serial/by-id/usb-3D_Robotics_PX4_BL_FMU_v2.x_0-if00
ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff type: ÿÿÿÿ
idtype: =FF
vid: ffffffff
pid: ffffffff
coa: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8= sn: 005000253036510b31353833
chip:
family: STM32F42x
revision:
flash Erase : [====================] 100.0% (timeout: seconds)
Program: [====================] 100.0%
Verify : [====================] 100.0%
Rebooting. [%] Built target uploadover,编译完工。
[pixhawk笔记]1-编译过程的更多相关文章
- Vue学习笔记:编译过程
碰到是否有template选项时,会询问是否要对template进行编译: 在template编译(渲染成UI)有一个过程.模板通过编译生成AST,再由AST生成Vue的渲染函数,渲染函数结合数据生成 ...
- [pixhawk笔记]4-如何写一个简单的应用程序
本文主要内容来自于:https://dev.px4.io/en/tutorials/tutorial_hello_sky.html,并对文档中的部分问题进行更正. 本文假设已经建立好开发环境并能正确编 ...
- 笔记:C 编译过程
笔记:C 编译过程 参考了 编译器的工作过程 1 C 编译过程 配置 确定标准库和头文件位置 确定依赖关系 头文件的预编译 预处理 编译 连接 F4NNIU 2018-06-12 编译器的工作过程 h ...
- C语言笔记——简介与编译过程初探
序言 从今天起,详细说说C语言.这一年多,在大多数语言和技术之间转了一大圈,终于看清楚了事实,决心静下心来好好学学C语言.初学者会认为C语言是个入门用的东西,没有必要深入研究.但对计算机领域再稍加了解 ...
- 【嵌入式开发】gcc 学习笔记(一) - 编译C程序 及 编译过程
一. C程序编译过程 编译过程简介 : C语言的源文件 编译成 可执行文件需要四个步骤, 预处理 (Preprocessing) 扩展宏, 编译 (compilation) 得到汇编语言, 汇编 (a ...
- gcc 学习笔记(一) - 编译C程序 及 编译过程
一. C程序编译过程 编译过程简介 : C语言的源文件 编译成 可执行文件需要四个步骤, 预处理 (Preprocessing) 扩展宏, 编译 (compilation) 得到汇编语言, 汇编 (a ...
- asp.net原理笔记----页面控件类型,页面状况和asp.net编译过程
通过查看asp.net的整个生命周期之后 了解到在aspx的页面生命周期中 调用了BuildControlTree()方法生成页面控件树 之后再调用Rend()方法根据控件树生成html返回 aspx ...
- Hadoop源码编译过程
一. 为什么要编译Hadoop源码 Hadoop是使用Java语言开发的,但是有一些需求和操作并不适合使用java,所以就引入了本地库(Native Libraries)的概念,通 ...
- 在linux使用make编译ArduPilot for Pixhawk/PX4 ArduPilot 编译环境搭建
Building ArduPilot for Pixhawk/PX4 on Linux with Make 使用Make编译 ArduPilot for Pixhawk 2, Pixhawk and ...
随机推荐
- Oracle11g Active Data Guard搭建、管理
说明:參考网络众多人的笔记及思路,加上自己亲身实践之后的整理笔记.仅供參考. Data Guard与RAC不同的是.在普通情况下.Standby仅仅有一个节点处于活动状态,全部的应用都连接到主serv ...
- 用pypy运行ryu
最近看到pypy可以提高python的运行速率到很变态的境地,加之现在ryu发现拓扑的能力有限,不能满足实验要求,所以想将其试着在pypy上运行 部署pypy在virtualenv,在学python初 ...
- 前端模板<script type="text/template" id="tmpl">
前端模板, 比连接字符串好用多了, 还可以使用循环\判断等语句, 减少工作量 <script type="text/template" id="member-tmp ...
- The Thinking of AutomaticTest(有关自动化测试的思考)
考虑因素: 容易维护 简洁易懂 代码重用性好 系统的稳定性强 UI自动化: 数据的获取:装载的数据文件类型.数据的形式.数据的解析方法定义. 1.利用Junit单元测试组织用例,明确输入数据.预期 ...
- POJ 3150 Cellular Automaton(矩阵快速幂)
Cellular Automaton Time Limit: 12000MS Memory Limit: 65536K Total Submissions: 3504 Accepted: 1421 C ...
- to_base64 --- from_base64
UPDATE traceroleid_copy SET Pwd=to_base64(Pwd) SELECT from_base64(Pwd) FROM traceroleid_copy
- HttpSession 入门
1. HttpSession 概述 位于 javax.servlet.http 包; HttpSession 是由 JavaWeb 提供的功能, 用来会话跟踪的类, session 是服务器端对象, ...
- python基础之类的内置__setattr__,__delattr__,__getattr__和 二次加工标准类型(包装)
一.内置attr:__setattr__,__delattr__,__getattr__ __setattr__ #添加/修改属性会触发它的执行 __delattr__ #删除属性的时候会触发 __g ...
- Type Java compiler level does not match the version of the installed Java project facet.项目内容没错但是项目上报错,不影响运行
1.Window->Show View->Problems 2.在项目上右键properties->project Facets->修改右侧的version 保持一致 3.w ...
- 我的Android进阶之旅------>Android无第三方Jar包的源代报错:The current class path entry belongs to container ...的解决方法
今天使用第三方Jar包afinal.jar时候.想看一下源码,无法看 然后像加入jar相应的源代码包.也无法加入相应的源代码,报错例如以下:The current class path entry b ...