[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 ...
随机推荐
- Android基站定位
Android基站定位 一.通过手机信号获取基站信息 通过TelephonyManager 获取lac:mcc:mnc:cell-id(基站信息)的解释: MCC.Mobile Country C ...
- 【python】字符串编码问题
参考:http://blog.csdn.net/tingsking18/article/details/4033645 python内部的字符串是以unicode来编码 decode函数用来将其他编码 ...
- Deep Networks for Image Super-Resolution with Sparse Prior
深度学习中潜藏的稀疏表达 Deep Networks for Image Super-Resolution with Sparse Prior http://www.ifp.illinois.edu/ ...
- 【转】使用UMDH查找内存泄漏
转载出处:http://blog.csdn.net/phiger/article/details/1932141 Umdh 是 Debugging Tools for Windows 里面的一个工具, ...
- (转)使用 PyInstaller 把python程序 .py转为 .exe 可执行程序
最近使用Python为项目开发一款绘图工具(绘出 声场三维模型).因为希望能把Python脚本发布为脱离Python平台运行的可执行程序,比如单个的exe文件.PyInstaller恰满足这个需求.本 ...
- Delphi TreeView – 自动给标题上加图片
Delphi TreeView – 自动给标题上加图片 当处理完TreeView控件树形结构的数据后,根据不同的树形节点Level,加上不同的图片. 图片的ImageList已经放置好,并且TreeV ...
- JavaWeb项目中文乱码问题
1.从浏览器读数据乱码(post 请求方式) 前提是前端页面是UTF-8编码,因为服务器端默认采用ISO解码,所以乱码,在读取前加上: request.setCharacterEncoding(&qu ...
- CodeForces 156B Suspects(枚举)
B. Suspects time limit per test 2 seconds memory limit per test 256 megabytes input standard input o ...
- 学习使用turtlebot2——安装ROS Indigo系统
最近在学习使用turtlebot2,特此做一些学习记录. 安装ROS前要先决定自己电脑的Ubuntu(乌班图)系统.现在学习ROS常使用的Ubuntu系统有Ubuntu 16.04 和Ubuntu14 ...
- google-java-format
https://github.com/google/google-java-format