qgroundcontrol在LINUX下的编译与调试

/***************************************************************************************************************/
 *
 *                                    (c)    光明工作室  2017-2037  COPYRIGHT
 *
 *   光明工作室团队成员大部分来自全国著名985、211工程院校。具有丰富的工程实践经验,
 *本工作室热忱欢迎大家的光临。工作室长期承接嵌入式开发、PCB设计、算法仿真等软硬件设计。
 *
 *
 *1)基于C8051、AVR、MSP430单片机开发。
 *2)基于STM32F103、STM32F407等ARM处理器开发。(IIC、SPI、485、WIFI等相关设计)
 *3)基于C6678、DM388等DSP处理器开发。(视频、网络、通信协议相关设计)
 *4)基于QT、C#软件开发。
 *5)基于OPENCV、OPENGL图像处理算法开发。(基于LINUX、WINDOWS、MATLAB等)
 *6)无人机飞控、地面站程序开发。(大疆、PIX、 qgroundcontrol、missionplanner、MAVLINK)
 *7)  ROS机器人操作系统下相关开发。
 *8)LINUX、UCOSII、VXWORKS操作系统开发。
 *
 *
 *                                                                                                       联系方式:
 *                                                                                                        QQ:2468851091 call:18163325140
 *                                                                                                        Email:2468851091@qq.com
 *
/ ****************************************************************************************************************/

Compile and run qgroundcontrol  for Linux Ubuntu .

在LINUX UBUNTU下面编译和运行qgroundcontrol。

Perquisites:

Open a terminal and check the followings:----测试环境,看看是什么LINUX版本。

# ubuntu version

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"


# compiler (gcc and g++) versions (should be 4.7.X or greater)---查看编译器版本。

g++ --version
g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
gcc --version

gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3

#install following packages (qt,regex,sdl,osg,osgearth,osg phonon...I hope they are all)安装相关依赖项。

sudo apt-get update

sudo apt-get install build-essential

sudo apt-get install libopenscenegraph-dev

sudo apt-get install regexxer

sudo apt-get install libsdl1.2-dev

sudo apt-get install flite-dev

sudo apt-get install libosgViewer

sudo apt-get install libosgearth-dev

sudo apt-get install libphonon(4)   # try with 4 or without

sudo apt-get install phonon-backend-gstreamer

sudo apt-get install qt4-default-------这里是缺省安装QT4。但是现在的qgroundcontrol的编译可能要更高版本的QT环境了。

sudo apt-get install libqt4-dev (optional)

#(I don't know if this is mandatory, I just have it in history)

sudo apt-get install  libglade2.0-cil-dev 

sudo apt-get install  git

Repos:

# get the sources for mavlink from git, and build it-----安装MAVLINK数据链路通信协议。

git clone https://github.com/mavlink/mavlink

cd mavlink

 git submodule update --init --recursive 

mkdir build

cd  build

cmake ..   #<----------------------------correction from qmake ..

make configure   

make

sudo make install

# if you get any errors (repo changes always), in building mavlink crap,

just forget it andhttps://github.com/downloads/mavlink/mavlink/mavlink-1.0.9.deb

and install it with package manager. Right click, open with 'package|system|* whatever installer'

then continue with the procedure...

#get the sources for qgroundcontrol, and build ir

git clone git://github.com/mavlink/qgroundcontrol.git

cd qgroundcontrol

git clone http://github.com/LorenzMeier/qupgrade/

qmake qgroundcontrol.pro

make

# If you get linker errors as: Geometry::set*Array and View::checkErrors type of..

#apply the attached patchPATCH.TXT obsolette

#apply this patch: patch2.txt

# fixes for linkage errors and FlightModes current PWM value

#Read here how to apply a patch file to a tree (Linux): howto-patch

#then continue

make clean && make

# it should build without errors

# copy the qml/ resources folder where the qgroundcontrol binary was made

cp -r qml /release

cd release

# start qground control application

./qgroundcontol

#select APM. Now let's connect the USB cable from PC to the 3DR arducopter 2.5/6

#open another terminal, and clean the kernel message log

sudo dmesg -c  # clean the log

# insert the usb cable from the PC to the APM 2.5(6). (for telemetry connection radio 3DR scroll a bit down)

sudo dmesg -c    # check (visually in the output) the device tty* which was installed... ttyACM0

[30856.087388] usb 3-2: new full-speed USB device number 3 using xhci_hcd
[30856.160058] usb 3-2: New USB device found, idVendor=2341, idProduct=0010
[30856.160066] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[30856.160072] usb 3-2: Product: Arduino Mega 2560
[30856.160076] usb 3-2: Manufacturer: Arduino (www.arduino.cc)
[30856.160081] usb 3-2: SerialNumber: 64036363039351715080
[30856.160398] usb 3-2: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[30856.162093] cdc_acm 3-2:1.0: ttyACM0: USB ACM device

Go on the right top corner of the QGrouncControl and select ttyACM0 and the speed 115200

Click:  Connect.

Using 3DR Telemetry Radio module 915 MHz

The mavlink build manually, above did not do it's magic, so on top of it, I installed the Debian binary package.

Download @ https://github.com/mavlink/mavlink/downloads the: mavlink-1.0.9.deb

in to your ~/Downloads folder. Open a file browser,  right-click it and Open it

with Ubuntu Software Centre (or Debian installer). Install. Ignore all the messages

about the stability of the package. After install it might say INSTALL again. Just exit the

Installer, if you have seen the progress bar going to the end.

Close the connection to APM. Unplug the USB.Close the qgroundcontrol application.

Power the APM from a USB power  or from the battery (don't forget the safety procedures).

Make sure the radio (s) TX/RX are plugged, RX on APM, ant TX on the USB.

Look here for details: http://code.google.com/p/ardupilot-mega/wiki/3DRadio

Check the dmesg when you plug the USB radio module. On my computer it assigns it to ttyUSB0 device.

Start qgroundcontrol. Change the device by clicking on the [ttyACM0] (previous your device) square

(right-top corner) to ttyUSB0 (new dmesg detected device), and Bit rate to 57600. Press CONNECT.

#The patch has been updated to add current PWM feature to flight modes page:  (Nov/23/2013)

-re-edited on Nov 22 (added the radio 3DR mavlink guideline)

-re-edited on Nov 23 (added current PWM on flight modes page to tune up the PWM's)

Ubuntu 14-04 86_64 x86_64 GNU/Linux

Qgc source code is the same as the one in Ubuntu 13.XX.

required packages for compiling.

sudo apt-get install libsdl-dev

sudo apt-get install phonon-backend-gstreamer

sudo apt-get install libphonon4qt5-dev

sudo apt-get install flite-dev

sudo apt-get install libprotoc-dev libosgearth-dev

qmake ./qgroundcontrol.pro

make

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值