Commit e3dcabe8 authored by LM's avatar LM

Merge branch 'v10release' of github.com:pixhawk/qgroundcontrol into dev-win

parents 2ed96b7c 9e887c44
...@@ -8,6 +8,7 @@ Info.plist ...@@ -8,6 +8,7 @@ Info.plist
obj obj
*.log *.log
*~ *~
*~.skp
bin/*.exe bin/*.exe
bin/*.txt bin/*.txt
bin/mac bin/mac
......
...@@ -78,11 +78,39 @@ Done. ...@@ -78,11 +78,39 @@ Done.
Windows Windows
======= =======
DETAILED STEPS BELOW THE VISUAL STUDIO 2010 NOTES.
GNU GCC / MINGW IS UNTESTED, COULD WORK
VISUAL STUDIO 2008 / 2010 EXPRESS EDITION IS FREE!
-------------------------------------------------------------------------------------
VISUAL STUDIO 2010 NOTES (VS 2008 runs out-of-the-box, just follow the steps below):
For use of Qt 4x with Visual Studio 2010 Add-in.
Visual studio adds automatically certain defines that are wrong and cause errors.
To resolve this, execute these steps:
In the projects properties -> C/C++ ->preprocessor change:
in DEBUG:
delete QT_NO_DEBUG
in both (DEBUG / RELEASE):
delete QT_NO_DYNAMIC_CAST
-------------------------------------------------------------------------------------
Steps for Visual Studio 2008 / 2010. (VS 2008 is easier, VS 2010 only recommended for
expert developers)
Windows XP/7: Windows XP/7:
1) Download and install the QT SDK for Windows from http://qt.nokia.com/downloads/ (Visual Studio 2008 version) 1) Download and install the Qt SDK for Windows from http://qt.nokia.com/downloads/ (Visual Studio 2008 version) OR download Qt source and compile with VS 2010
2) Download and install Visual Studio 2008 Express Edition (free) 2) Download and install Visual Studio 2008 Express Edition (free) OR VS 2010 Express Edition
3) Go to the QGroundControl folder and then to thirdParty -> libxbee 3) Go to the QGroundControl folder and then to thirdParty -> libxbee
......
<PropertyList>
<generic>
<output>
<line_separator>newline</line_separator>
<var_separator>,</var_separator>
<chunk>
<name>lat</name>
<type>float</type>
<format>%+1.8f</format>
<node>/position/latitude-deg</node>
</chunk>
<chunk>
<name>lon</name>
<type>float</type>
<format>%+1.8f</format>
<node>/position/longitude-deg</node>
</chunk>
<chunk>
<name>alt</name>
<type>float</type>
<format>%+1.4f</format>
<node>/position/altitude-ft</node>
</chunk>
<chunk>
<name>speed</name>
<type>float</type>
<format>%2.3f</format>
<node>/velocities/groundspeed-kt</node>
</chunk>
<chunk>
<name>airspeed</name>
<type>float</type>
<format>%2.3f</format>
<node>/velocities/airspeed-kt</node>
</chunk>
<chunk>
<name>pitch</name>
<type>float</type>
<format>%+1.3f</format>
<node>/orientation/pitch-deg</node>
</chunk>
<chunk>
<name>roll</name>
<type>float</type>
<format>%+1.3f</format>
<node>/orientation/roll-deg</node>
</chunk>
<chunk>
<name>heading</name>
<type>float</type>
<format>%+1.3f</format>
<node>/orientation/heading-deg</node>
</chunk>
<chunk>
<name>v_n</name>
<type>float</type>
<format>%2.3f</format>
<node>/velocities/speed-north-fps</node>
</chunk>
<chunk>
<name>v_e</name>
<type>float</type>
<format>%2.3f</format>
<node>/velocities/speed-east-fps</node>
</chunk>
<chunk>
<name>v_d</name>
<type>float</type>
<format>%2.3f</format>
<node>/velocities/speed-down-fps</node>
</chunk>
<chunk>
<name>rate_phi</name>
<type>float</type>
<format>%2.3f</format>
<node>/orientation/roll-rate-degps</node>
</chunk>
<chunk>
<name>rate_theta</name>
<type>float</type>
<format>%2.3f</format>
<node>/orientation/pitch-rate-degps</node>
</chunk>
<chunk>
<name>rate_psi</name>
<type>float</type>
<format>%2.3f</format>
<node>/orientation/yaw-rate-degps</node>
</chunk>
</output>
<input>
<line_separator>newline</line_separator>
<var_separator>,</var_separator>
<chunk>
<name>pitch</name>
<type>float</type>
<format>%+1.3f</format>
<node>/autopilot/settings/target-pitch-deg</node>
</chunk>
<chunk>
<name>roll</name>
<type>float</type>
<format>%+1.3f</format>
<node>/autopilot/settings/target-roll-deg</node>
</chunk>
<chunk>
<name>throttle</name>
<type>float</type>
<format>%+1.3f</format>
<node>/controls/engines/engine/throttle</node>
</chunk>
<chunk>
<name>lat</name>
<type>float</type>
<format>%+1.8f</format>
<node>/sim/view/target/latitude-deg</node>
</chunk>
<chunk>
<name>lon</name>
<type>float</type>
<format>%+1.8f</format>
<node>/sim/view/target/longitude-deg</node>
</chunk>
<chunk>
<name>alt</name>
<type>float</type>
<format>%+1.4f</format>
<node>/sim/view/target/alt</node>
</chunk>
</input>
</generic>
</PropertyList>
B໿SketchUp Model૿{8.0.4810}Ƕ『時҆✱闊ÿ主乁￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣꨀ褀乐േᨊ B໿SketchUp Model૿{8.0.4810}Ƕ『時҆✱闊ÿ主乁￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣꨀ褀乐േᨊ
......
B໿SketchUp Model૿{8.0.4810}∳꛺䧕灁骨鎠讠ÿ侘乁￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣ⼀褀乐േᨊ B໿SketchUp Model૿{8.0.4810}∳꛺䧕灁骨鎠讠ÿ侘乁￿ 噃牥楳湯慍ー￾䌉䄀爀挀䌀甀爀瘀攀Ā＀￾䌊䄀琀琀爀椀戀甀琀攀＀￾䌓䄀琀琀爀椀戀甀琀攀䌀漀渀琀愀椀渀攀爀＀￾䌏䄀琀琀爀椀戀甀琀攀一愀洀攀搀Ā＀￾䌐䈀愀挀欀最爀漀甀渀搀䤀洀愀最攀਀＀￾䌇䌀愀洀攀爀愀Ԁ＀￾䌊䌀漀洀瀀漀渀攀渀琀଀＀￾䌒䌀漀洀瀀漀渀攀渀琀䈀攀栀愀瘀椀漀爀Ԁ＀￾䌔䌀漀洀瀀漀渀攀渀琀䐀攀昀椀渀椀琀椀漀渀਀＀￾䌒䌀漀洀瀀漀渀攀渀琀䤀渀猀琀愀渀挀攀Ѐ＀￾䌕䌀漀渀猀琀爀甀挀琀椀漀渀䜀攀漀洀攀琀爀礀＀￾䌑䌀漀渀猀琀爀甀挀琀椀漀渀䰀椀渀攀Ā＀￾䌒䌀漀渀猀琀爀甀挀琀椀漀渀倀漀椀渀琀＀￾䌆䌀甀爀瘀攀Ѐ＀￾䌏䐀攀昀椀渀椀琀椀漀渀䰀椀猀琀＀￾䌄䐀椀戀̀＀￾䌊䐀椀洀攀渀猀椀漀渀Ā＀￾䌐䐀椀洀攀渀猀椀漀渀䰀椀渀攀愀爀؀＀￾䌐䐀椀洀攀渀猀椀漀渀刀愀搀椀愀氀Ȁ＀￾䌏䐀椀洀攀渀猀椀漀渀匀琀礀氀攀Ѐ＀￾䌏䐀爀愀眀椀渀最䔀氀攀洀攀渀琀ऀ＀￾䌅䔀搀最攀Ȁ＀￾䌈䔀搀最攀唀猀攀Ā＀￾䌇䔀渀琀椀琀礀̀＀￾䌅䘀愀挀攀̀＀￾䌒䘀愀挀攀吀攀砀琀甀爀攀䌀漀漀爀搀猀Ѐ＀￾䌌䘀漀渀琀䴀愀渀愀最攀爀＀￾䌆䜀爀漀甀瀀Ā＀￾䌆䤀洀愀最攀Ā＀￾䌆䰀愀礀攀爀Ȁ＀￾䌍䰀愀礀攀爀䴀愀渀愀最攀爀Ѐ＀￾䌅䰀漀漀瀀Ā＀￾䌉䴀愀琀攀爀椀愀氀ఀ＀￾䌐䴀愀琀攀爀椀愀氀䴀愀渀愀最攀爀Ѐ＀￾䌉倀愀最攀䰀椀猀琀Ā＀￾䌋倀漀氀礀氀椀渀攀㌀搀＀￾䌍刀攀氀愀琀椀漀渀猀栀椀瀀＀￾䌐刀攀氀愀琀椀漀渀猀栀椀瀀䴀愀瀀＀￾䌑刀攀渀搀攀爀椀渀最伀瀀琀椀漀渀猀␀＀￾䌍匀攀挀琀椀漀渀倀氀愀渀攀Ȁ＀￾䌋匀栀愀搀漀眀䤀渀昀漀܀＀￾䌇匀欀䘀漀渀琀Ā＀￾䌉匀欀攀琀挀栀䌀匀＀￾䌎匀欀攀琀挀栀唀瀀䴀漀搀攀氀ᘀ＀￾䌍匀欀攀琀挀栀唀瀀倀愀最攀Ā＀￾䌉匀欀瀀匀琀礀氀攀Ā＀￾䌐匀欀瀀匀琀礀氀攀䴀愀渀愀最攀爀Ȁ＀￾䌅吀攀砀琀ऀ＀￾䌊吀攀砀琀匀琀礀氀攀Ԁ＀￾䌈吀攀砀琀甀爀攀؀＀￾䌊吀栀甀洀戀渀愀椀氀Ā＀￾䌇嘀攀爀琀攀砀＀￾䌉嘀椀攀眀倀愀最攀ఀ＀￾䌊圀愀琀攀爀洀愀爀欀Ā＀￾䌑圀愀琀攀爀洀愀爀欀䴀愀渀愀最攀爀Ȁ＀￾䔒渀搀ⴀ伀昀ⴀ嘀攀爀猀椀漀渀ⴀ䴀愀瀀Ȁ뀀Ā＀ϿЀ䌀楄Ѣ⼀褀乐േᨊ
price quantity
210 81
250 73
280 64
300 61
320 50
340 46
360 45
380 44
400 43
420 39
440 36
...@@ -38,6 +38,7 @@ MOC_DIR = $$BUILDDIR/moc ...@@ -38,6 +38,7 @@ MOC_DIR = $$BUILDDIR/moc
UI_HEADERS_DIR = $$BUILDDIR/ui UI_HEADERS_DIR = $$BUILDDIR/ui
RCC_DIR = $$BUILDDIR/rcc RCC_DIR = $$BUILDDIR/rcc
MAVLINK_CONF = "" MAVLINK_CONF = ""
DEFINES += MAVLINK_NO_DATA
################################################################# #################################################################
...@@ -235,7 +236,7 @@ HEADERS += src/MG.h \ ...@@ -235,7 +236,7 @@ HEADERS += src/MG.h \
src/comm/SerialSimulationLink.h \ src/comm/SerialSimulationLink.h \
src/comm/ProtocolInterface.h \ src/comm/ProtocolInterface.h \
src/comm/MAVLinkProtocol.h \ src/comm/MAVLinkProtocol.h \
src/comm/AS4Protocol.h \ src/comm/QGCFlightGearLink.h \
src/ui/CommConfigurationWindow.h \ src/ui/CommConfigurationWindow.h \
src/ui/SerialConfigurationWindow.h \ src/ui/SerialConfigurationWindow.h \
src/ui/MainWindow.h \ src/ui/MainWindow.h \
...@@ -299,7 +300,6 @@ HEADERS += src/MG.h \ ...@@ -299,7 +300,6 @@ HEADERS += src/MG.h \
src/ui/uas/QGCUnconnectedInfoWidget.h \ src/ui/uas/QGCUnconnectedInfoWidget.h \
src/ui/designer/QGCToolWidget.h \ src/ui/designer/QGCToolWidget.h \
src/ui/designer/QGCParamSlider.h \ src/ui/designer/QGCParamSlider.h \
src/ui/designer/QGCActionButton.h \
src/ui/designer/QGCCommandButton.h \ src/ui/designer/QGCCommandButton.h \
src/ui/designer/QGCToolWidgetItem.h \ src/ui/designer/QGCToolWidgetItem.h \
src/ui/QGCMAVLinkLogPlayer.h \ src/ui/QGCMAVLinkLogPlayer.h \
...@@ -364,7 +364,7 @@ SOURCES += src/main.cc \ ...@@ -364,7 +364,7 @@ SOURCES += src/main.cc \
src/comm/SerialLink.cc \ src/comm/SerialLink.cc \
src/comm/SerialSimulationLink.cc \ src/comm/SerialSimulationLink.cc \
src/comm/MAVLinkProtocol.cc \ src/comm/MAVLinkProtocol.cc \
src/comm/AS4Protocol.cc \ src/comm/QGCFlightGearLink.cc \
src/ui/CommConfigurationWindow.cc \ src/ui/CommConfigurationWindow.cc \
src/ui/SerialConfigurationWindow.cc \ src/ui/SerialConfigurationWindow.cc \
src/ui/MainWindow.cc \ src/ui/MainWindow.cc \
...@@ -426,7 +426,6 @@ SOURCES += src/main.cc \ ...@@ -426,7 +426,6 @@ SOURCES += src/main.cc \
src/ui/uas/QGCUnconnectedInfoWidget.cc \ src/ui/uas/QGCUnconnectedInfoWidget.cc \
src/ui/designer/QGCToolWidget.cc \ src/ui/designer/QGCToolWidget.cc \
src/ui/designer/QGCParamSlider.cc \ src/ui/designer/QGCParamSlider.cc \
src/ui/designer/QGCActionButton.cc \
src/ui/designer/QGCCommandButton.cc \ src/ui/designer/QGCCommandButton.cc \
src/ui/designer/QGCToolWidgetItem.cc \ src/ui/designer/QGCToolWidgetItem.cc \
src/ui/QGCMAVLinkLogPlayer.cc \ src/ui/QGCMAVLinkLogPlayer.cc \
......
...@@ -44,7 +44,6 @@ This file is part of the QGROUNDCONTROL project ...@@ -44,7 +44,6 @@ This file is part of the QGROUNDCONTROL project
#include "configuration.h" #include "configuration.h"
#include "QGC.h" #include "QGC.h"
#include "QGCCore.h" #include "QGCCore.h"
#include "MG.h"
#include "MainWindow.h" #include "MainWindow.h"
#include "GAudioOutput.h" #include "GAudioOutput.h"
......
...@@ -109,7 +109,8 @@ void Waypoint::setId(quint16 id) ...@@ -109,7 +109,8 @@ void Waypoint::setId(quint16 id)
void Waypoint::setX(double x) void Waypoint::setX(double x)
{ {
if (this->x != x && (this->frame == MAV_FRAME_LOCAL)) { if (!isinf(x) && !isnan(x) && ((this->frame == MAV_FRAME_LOCAL_NED) || (this->frame == MAV_FRAME_LOCAL_ENU)))
{
this->x = x; this->x = x;
emit changed(this); emit changed(this);
} }
...@@ -117,7 +118,8 @@ void Waypoint::setX(double x) ...@@ -117,7 +118,8 @@ void Waypoint::setX(double x)
void Waypoint::setY(double y) void Waypoint::setY(double y)
{ {
if (this->y != y && (this->frame == MAV_FRAME_LOCAL)) { if (!isinf(y) && !isnan(y) && ((this->frame == MAV_FRAME_LOCAL_NED) || (this->frame == MAV_FRAME_LOCAL_ENU)))
{
this->y = y; this->y = y;
emit changed(this); emit changed(this);
} }
...@@ -125,7 +127,8 @@ void Waypoint::setY(double y) ...@@ -125,7 +127,8 @@ void Waypoint::setY(double y)
void Waypoint::setZ(double z) void Waypoint::setZ(double z)
{ {
if (this->z != z && (this->frame == MAV_FRAME_LOCAL)) { if (!isinf(z) && !isnan(z) && ((this->frame == MAV_FRAME_LOCAL_NED) || (this->frame == MAV_FRAME_LOCAL_ENU)))
{
this->z = z; this->z = z;
emit changed(this); emit changed(this);
} }
...@@ -133,7 +136,8 @@ void Waypoint::setZ(double z) ...@@ -133,7 +136,8 @@ void Waypoint::setZ(double z)
void Waypoint::setLatitude(double lat) void Waypoint::setLatitude(double lat)
{ {
if (this->x != lat && ((this->frame == MAV_FRAME_GLOBAL) || (this->frame == MAV_FRAME_GLOBAL_RELATIVE_ALT))) { if (this->x != lat && ((this->frame == MAV_FRAME_GLOBAL) || (this->frame == MAV_FRAME_GLOBAL_RELATIVE_ALT)))
{
this->x = lat; this->x = lat;
emit changed(this); emit changed(this);
} }
...@@ -141,7 +145,8 @@ void Waypoint::setLatitude(double lat) ...@@ -141,7 +145,8 @@ void Waypoint::setLatitude(double lat)
void Waypoint::setLongitude(double lon) void Waypoint::setLongitude(double lon)
{ {
if (this->y != lon && ((this->frame == MAV_FRAME_GLOBAL) || (this->frame == MAV_FRAME_GLOBAL_RELATIVE_ALT))) { if (this->y != lon && ((this->frame == MAV_FRAME_GLOBAL) || (this->frame == MAV_FRAME_GLOBAL_RELATIVE_ALT)))
{
this->y = lon; this->y = lon;
emit changed(this); emit changed(this);
} }
...@@ -149,7 +154,8 @@ void Waypoint::setLongitude(double lon) ...@@ -149,7 +154,8 @@ void Waypoint::setLongitude(double lon)
void Waypoint::setAltitude(double altitude) void Waypoint::setAltitude(double altitude)
{ {
if (this->z != altitude && ((this->frame == MAV_FRAME_GLOBAL) || (this->frame == MAV_FRAME_GLOBAL_RELATIVE_ALT))) { if (this->z != altitude && ((this->frame == MAV_FRAME_GLOBAL) || (this->frame == MAV_FRAME_GLOBAL_RELATIVE_ALT)))
{
this->z = altitude; this->z = altitude;
emit changed(this); emit changed(this);
} }
...@@ -157,7 +163,8 @@ void Waypoint::setAltitude(double altitude) ...@@ -157,7 +163,8 @@ void Waypoint::setAltitude(double altitude)
void Waypoint::setYaw(int yaw) void Waypoint::setYaw(int yaw)
{ {
if (this->yaw != yaw) { if (this->yaw != yaw)
{
this->yaw = yaw; this->yaw = yaw;
emit changed(this); emit changed(this);
} }
...@@ -165,7 +172,8 @@ void Waypoint::setYaw(int yaw) ...@@ -165,7 +172,8 @@ void Waypoint::setYaw(int yaw)
void Waypoint::setYaw(double yaw) void Waypoint::setYaw(double yaw)
{ {
if (this->yaw != yaw) { if (this->yaw != yaw)
{
this->yaw = yaw; this->yaw = yaw;
emit changed(this); emit changed(this);
} }
...@@ -173,7 +181,8 @@ void Waypoint::setYaw(double yaw) ...@@ -173,7 +181,8 @@ void Waypoint::setYaw(double yaw)
void Waypoint::setAction(int action) void Waypoint::setAction(int action)
{ {
if (this->action != (MAV_CMD)action) { if (this->action != (MAV_CMD)action)
{
this->action = (MAV_CMD)action; this->action = (MAV_CMD)action;
emit changed(this); emit changed(this);
} }
...@@ -205,7 +214,8 @@ void Waypoint::setAutocontinue(bool autoContinue) ...@@ -205,7 +214,8 @@ void Waypoint::setAutocontinue(bool autoContinue)
void Waypoint::setCurrent(bool current) void Waypoint::setCurrent(bool current)
{ {
if (this->current != current) { if (this->current != current)
{
this->current = current; this->current = current;
emit changed(this); emit changed(this);
} }
...@@ -213,7 +223,8 @@ void Waypoint::setCurrent(bool current) ...@@ -213,7 +223,8 @@ void Waypoint::setCurrent(bool current)
void Waypoint::setAcceptanceRadius(double radius) void Waypoint::setAcceptanceRadius(double radius)
{ {
if (this->param2 != radius) { if (this->param2 != radius)
{
this->param2 = radius; this->param2 = radius;
emit changed(this); emit changed(this);
} }
...@@ -223,7 +234,8 @@ void Waypoint::setParam1(double param1) ...@@ -223,7 +234,8 @@ void Waypoint::setParam1(double param1)
{ {
//qDebug() << "SENDER:" << QObject::sender(); //qDebug() << "SENDER:" << QObject::sender();
//qDebug() << "PARAM1 SET REQ:" << param1; //qDebug() << "PARAM1 SET REQ:" << param1;
if (this->param1 != param1) { if (this->param1 != param1)
{
this->param1 = param1; this->param1 = param1;
emit changed(this); emit changed(this);
} }
...@@ -231,7 +243,8 @@ void Waypoint::setParam1(double param1) ...@@ -231,7 +243,8 @@ void Waypoint::setParam1(double param1)
void Waypoint::setParam2(double param2) void Waypoint::setParam2(double param2)
{ {
if (this->param2 != param2) { if (this->param2 != param2)
{
this->param2 = param2; this->param2 = param2;
emit changed(this); emit changed(this);
} }
......
This diff is collapsed.
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of class MAVLinkXMLParserV10
* @author Lorenz Meier <mail@qgroundcontrol.org>
*/
#ifndef MAVLINKXMLPARSERV10_H
#define MAVLINKXMLPARSERV10_H
#include <QObject>
#include <QDomDocument>
#include <QString>
/**
* @brief MAVLink micro air vehicle protocol generator
*
* MAVLink is a generic communication protocol for micro air vehicles.
* for more information, please see the official website.
* @ref http://pixhawk.ethz.ch/software/mavlink/
**/
class MAVLinkXMLParserV10 : public QObject
{
Q_OBJECT
public:
MAVLinkXMLParserV10(QDomDocument* document, QString outputDirectory, QObject* parent=0);
MAVLinkXMLParserV10(QString document, QString outputDirectory, QObject* parent=0);
~MAVLinkXMLParserV10();
public slots:
/** @brief Parse XML and generate C files */
bool generate();
signals:
/** @brief Status message on the parsing */
void parseState(QString message);
protected:
/** @brief Accumulate the X.25 CRC by adding one char at a time. */
void crcAccumulate(uint8_t data, uint16_t *crcAccum);
/** @brief Initialize the buffer for the X.25 CRC */
void crcInit(uint16_t* crcAccum);
QDomDocument* doc;
QString outputDirName;
QString fileName;
};
#endif // MAVLINKXMLPARSERV10_H
...@@ -29,6 +29,7 @@ FORMS += ui/XMLCommProtocolWidget.ui ...@@ -29,6 +29,7 @@ FORMS += ui/XMLCommProtocolWidget.ui
HEADERS += \ HEADERS += \
ui/XMLCommProtocolWidget.h \ ui/XMLCommProtocolWidget.h \
generator/MAVLinkXMLParser.h \ generator/MAVLinkXMLParser.h \
generator/MAVLinkXMLParserV10.h \
ui/DomItem.h \ ui/DomItem.h \
ui/DomModel.h \ ui/DomModel.h \
ui/QGCMAVLinkTextEdit.h ui/QGCMAVLinkTextEdit.h
...@@ -37,6 +38,7 @@ SOURCES += \ ...@@ -37,6 +38,7 @@ SOURCES += \
ui/DomItem.cc \ ui/DomItem.cc \
ui/DomModel.cc \ ui/DomModel.cc \
generator/MAVLinkXMLParser.cc \ generator/MAVLinkXMLParser.cc \
generator/MAVLinkXMLParserV10.cc \
ui/QGCMAVLinkTextEdit.cc ui/QGCMAVLinkTextEdit.cc
RESOURCES += mavlinkgen.qrc RESOURCES += mavlinkgen.qrc
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "XMLCommProtocolWidget.h" #include "XMLCommProtocolWidget.h"
#include "ui_XMLCommProtocolWidget.h" #include "ui_XMLCommProtocolWidget.h"
#include "MAVLinkXMLParser.h" #include "MAVLinkXMLParser.h"
#include "MAVLinkXMLParserV10.h"
#include <QDebug> #include <QDebug>
#include <iostream> #include <iostream>
...@@ -131,18 +132,37 @@ void XMLCommProtocolWidget::generate() ...@@ -131,18 +132,37 @@ void XMLCommProtocolWidget::generate()
// Syntax check already gives output // Syntax check already gives output
return; return;
} }
MAVLinkXMLParser* parser = new MAVLinkXMLParser(m_ui->fileNameLabel->text().trimmed(), m_ui->outputDirNameLabel->text().trimmed()); MAVLinkXMLParser* parser = NULL;
connect(parser, SIGNAL(parseState(QString)), m_ui->compileLog, SLOT(appendHtml(QString))); MAVLinkXMLParserV10* parserV10 = NULL;
bool result = parser->generate();
if (result) { bool result = false;
if (m_ui->versionComboBox->currentIndex() == 0)
{
MAVLinkXMLParser* parser = new MAVLinkXMLParser(m_ui->fileNameLabel->text().trimmed(), m_ui->outputDirNameLabel->text().trimmed());
connect(parser, SIGNAL(parseState(QString)), m_ui->compileLog, SLOT(appendHtml(QString)));
result = parser->generate();
}
else if (m_ui->versionComboBox->currentIndex() == 1)
{
MAVLinkXMLParserV10* parserV10 = new MAVLinkXMLParserV10(m_ui->fileNameLabel->text().trimmed(), m_ui->outputDirNameLabel->text().trimmed());
connect(parserV10, SIGNAL(parseState(QString)), m_ui->compileLog, SLOT(appendHtml(QString)));
result = parserV10->generate();
}
if (result)
{
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setText(QString("The C code / headers have been generated in folder\n%1").arg(m_ui->outputDirNameLabel->text().trimmed())); msgBox.setText(QString("The C code / headers have been generated in folder\n%1").arg(m_ui->outputDirNameLabel->text().trimmed()));
msgBox.exec(); msgBox.exec();
} else { }
else
{
QMessageBox::critical(this, tr("C code generation failed, please see the compile log for further information"), QString("The C code / headers could not be written to folder\n%1").arg(m_ui->outputDirNameLabel->text().trimmed()), QMessageBox::Ok); QMessageBox::critical(this, tr("C code generation failed, please see the compile log for further information"), QString("The C code / headers could not be written to folder\n%1").arg(m_ui->outputDirNameLabel->text().trimmed()), QMessageBox::Ok);
} }
delete parser; if (parser) delete parser;
if (parserV10) delete parserV10;
} }
void XMLCommProtocolWidget::save() void XMLCommProtocolWidget::save()
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout" rowstretch="1,1,100,1,1,1" columnstretch="1,1,1,100"> <layout class="QGridLayout" name="gridLayout" rowstretch="1,1,100,1,1,1,0" columnstretch="1,1,1,100">
<property name="topMargin"> <property name="topMargin">
<number>6</number> <number>6</number>
</property> </property>
...@@ -51,12 +51,12 @@ ...@@ -51,12 +51,12 @@
<string>Select input file</string> <string>Select input file</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../mavlinkgen.qrc"> <iconset resource="../../../../qgroundcontrol.qrc">
<normaloff>:/images/status/folder-open.svg</normaloff>:/images/status/folder-open.svg</iconset> <normaloff>:/images/status/folder-open.svg</normaloff>:/images/status/folder-open.svg</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3" rowspan="6"> <item row="0" column="3" rowspan="7">
<widget class="QGCMAVLinkTextEdit" name="xmlTextView"> <widget class="QGCMAVLinkTextEdit" name="xmlTextView">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
...@@ -97,49 +97,70 @@ ...@@ -97,49 +97,70 @@
<string>Select directory</string> <string>Select directory</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../mavlinkgen.qrc"> <iconset resource="../../../../qgroundcontrol.qrc">
<normaloff>:/images/status/folder-open.svg</normaloff>:/images/status/folder-open.svg</iconset> <normaloff>:/images/status/folder-open.svg</normaloff>:/images/status/folder-open.svg</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="3"> <item row="3" column="0" colspan="3">
<widget class="QTreeView" name="xmlTreeView"/> <widget class="QTreeView" name="xmlTreeView"/>
</item> </item>
<item row="3" column="0" colspan="2"> <item row="4" column="0" colspan="2">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Compile Output</string> <string>Compile Output</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0" colspan="3"> <item row="5" column="0" colspan="3">
<widget class="QPlainTextEdit" name="compileLog"/> <widget class="QPlainTextEdit" name="compileLog"/>
</item> </item>
<item row="5" column="0"> <item row="6" column="0">
<widget class="QLabel" name="validXMLLabel"> <widget class="QLabel" name="validXMLLabel">
<property name="text"> <property name="text">
<string>No file loaded</string> <string>No file loaded</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="6" column="1">
<widget class="QPushButton" name="saveButton"> <widget class="QPushButton" name="saveButton">
<property name="text"> <property name="text">
<string>Save file</string> <string>Save file</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2"> <item row="6" column="2">
<widget class="QPushButton" name="generateButton"> <widget class="QPushButton" name="generateButton">
<property name="text"> <property name="text">
<string>Save and generate</string> <string>Save and generate</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../mavlinkgen.qrc"> <iconset resource="../../../../qgroundcontrol.qrc">
<normaloff>:/images/categories/applications-system.svg</normaloff>:/images/categories/applications-system.svg</iconset> <normaloff>:/images/categories/applications-system.svg</normaloff>:/images/categories/applications-system.svg</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Select MAVLink Version</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QComboBox" name="versionComboBox">
<item>
<property name="text">
<string>MAVLink v0.9 (-Aug'10)</string>
</property>
</item>
<item>
<property name="text">
<string>MAVLink v1.0 (Sept'10+)</string>
</property>
</item>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
...@@ -150,7 +171,7 @@ ...@@ -150,7 +171,7 @@
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../mavlinkgen.qrc"/> <include location="../../../../qgroundcontrol.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Brief Description
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include <QDebug>
#include <QTime>
#include <MG.h>
#include <AS4Protocol.h>
#include <UASInterface.h>
#include <UASManager.h>
#include <UASInterface.h>
#include <UAS.h>
#include <configuration.h>
#include <LinkManager.h>
#include <inttypes.h>
#include <iostream>
#include "QGC.h"
AS4Protocol::AS4Protocol()
{
// Start heartbeat timer, emitting a heartbeat at the configured rate
heartbeatRate = 1; ///< SAE AS-4 has a fixed heartbeat rate of 1 hz.
// heartbeatTimer = new QTimer(this);
// connect(heartbeatTimer, SIGNAL(timeout()), this, SLOT());
// heartbeatTimer->start(1000/heartbeatRate);
/*
// Start the node manager
configData = new FileLoader("nodeManager.conf");
handler = new MyHandler();
try
{
nodeManager = new NodeManager(configData, handler);
qDebug() << "SAE AS-4 NODE MANAGER constructed";
}
catch(char *exceptionString)
{
printf("%s", exceptionString);
printf("Terminating Program...\n");
}
catch(...)
{
printf("Node Manager Construction Failed. Terminating Program...\n");
}
*/
}
AS4Protocol::~AS4Protocol()
{
// delete nodeManager;
// delete handler;
// delete configData;
}
void AS4Protocol::run()
{
forever {
QGC::SLEEP::msleep(5000);
}
}
/**
* @brief Receive bytes from a communication interface.
*
* The bytes copied by calling the LinkInterface::readBytes() method.
*
* @param link The interface to read from
* @see LinkInterface
**/
void AS4Protocol::receiveBytes(LinkInterface* link)
{
// receiveMutex.lock();
// Prepare buffer
//static const int maxlen = 4096 * 100;
//static char buffer[maxlen];
qint64 bytesToRead = link->bytesAvailable();
// Get all data at once, let link read the bytes in the buffer array
//link->readBytes(buffer, maxlen);
//
// /*
// // Debug output
// std::cerr << "receive buffer: ";
// for (int i = 0; i < bytesToRead; i++)
// {
// std::cerr << std::hex << static_cast<unsigned char>(buffer[i]);
// }
// std::cerr << std::dec << " length: " << bytesToRead;
// */
//
// qDebug() << __FILE__ << __LINE__ << ": buffer size:" << maxlen << "bytes:" << bytesToRead;
//
for (int position = 0; position < bytesToRead; position++) {
}
// receiveMutex.unlock();
}
/**
* @brief Get the human-readable name of this protocol.
*
* @return The name of this protocol
**/
QString AS4Protocol::getName()
{
return QString(tr("SAE AS-4"));
}
void AS4Protocol::setHeartbeatRate(int rate)
{
heartbeatRate = rate;
heartbeatTimer->setInterval(1000/heartbeatRate);
}
int AS4Protocol::getHeartbeatRate()
{
return heartbeatRate;
}
/*=====================================================================
PIXHAWK Micro Air Vehicle Flying Robotics Toolkit
(c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch>
This file is part of the PIXHAWK project
PIXHAWK is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PIXHAWK is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Brief Description
*
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef AS4PROTOCOL_H_
#define AS4PROTOCOL_H_
#include <QObject>
#include <QMutex>
#include <QString>
#include <QTimer>
#include <QByteArray>
#include <ProtocolInterface.h>
#include <LinkInterface.h>
#include <protocol.h>
/*#include <openJaus.h>
class MyHandler : public EventHandler
{
public:
~MyHandler()
{
}
void handleEvent(NodeManagerEvent *e)
{
SystemTreeEvent *treeEvent;
ErrorEvent *errorEvent;
JausMessageEvent *messageEvent;
DebugEvent *debugEvent;
ConfigurationEvent *configEvent;
switch(e->getType())
{
case NodeManagerEvent::SystemTreeEvent:
treeEvent = (SystemTreeEvent *)e;
printf("%s\n", treeEvent->toString().c_str());
delete e;
break;
case NodeManagerEvent::ErrorEvent:
errorEvent = (ErrorEvent *)e;
printf("%s\n", errorEvent->toString().c_str());
delete e;
break;
case NodeManagerEvent::JausMessageEvent:
messageEvent = (JausMessageEvent *)e;
// If you turn this on, the system gets spam-y this is very useful for debug purposes
if(messageEvent->getJausMessage()->commandCode != JAUS_REPORT_HEARTBEAT_PULSE)
{
//printf("%s\n", messageEvent->toString().c_str());
}
else
{
//printf("%s\n", messageEvent->toString().c_str());
}
delete e;
break;
case NodeManagerEvent::DebugEvent:
debugEvent = (DebugEvent *)e;
//printf("%s\n", debugEvent->toString().c_str());
delete e;
break;
case NodeManagerEvent::ConfigurationEvent:
configEvent = (ConfigurationEvent *)e;
printf("%s\n", configEvent->toString().c_str());
delete e;
break;
default:
delete e;
break;
}
}
};*/
/**
* SAE AS-4 Nodemanager
*
**/
class AS4Protocol : public ProtocolInterface
{
Q_OBJECT
public:
AS4Protocol();
~AS4Protocol();
void run();
QString getName();
int getHeartbeatRate();
public slots:
void receiveBytes(LinkInterface* link);
/**
* @brief Set the rate at which heartbeats are emitted
*
* The default rate is 1 Hertz.
*
* @param rate heartbeat rate in hertz (times per second)
*/
void setHeartbeatRate(int rate);
/**
* @brief Send an extra heartbeat to all connected units
*
* The heartbeat is sent out of order and does not reset the
* periodic heartbeat emission. It will be just sent in addition.
*/
// void sendHeartbeat();
protected:
QTimer* heartbeatTimer;
int heartbeatRate;
QMutex receiveMutex;
// NodeManager* nodeManager;
// MyHandler* handler;
// FileLoader* configData;
signals:
};
#endif // AS4PROTOCOL_H_
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <QSettings> #include <QSettings>
#include <QDesktopServices> #include <QDesktopServices>
//#include "MG.h"
#include "MAVLinkProtocol.h" #include "MAVLinkProtocol.h"
#include "UASInterface.h" #include "UASInterface.h"
#include "UASManager.h" #include "UASManager.h"
...@@ -28,11 +27,13 @@ ...@@ -28,11 +27,13 @@
#include "ArduPilotMegaMAV.h" #include "ArduPilotMegaMAV.h"
#include "configuration.h" #include "configuration.h"
#include "LinkManager.h" #include "LinkManager.h"
//#include "MainWindow.h"
#include "QGCMAVLink.h" #include "QGCMAVLink.h"
#include "QGCMAVLinkUASFactory.h" #include "QGCMAVLinkUASFactory.h"
#include "QGC.h" #include "QGC.h"
// Instantiate MAVLink data
#include "mavlink_data.h"
/** /**
* The default constructor will create a new MAVLink object sending heartbeats at * The default constructor will create a new MAVLink object sending heartbeats at
* the MAVLINK_HEARTBEAT_DEFAULT_RATE to all connected links. * the MAVLINK_HEARTBEAT_DEFAULT_RATE to all connected links.
...@@ -395,7 +396,7 @@ void MAVLinkProtocol::sendHeartbeat() ...@@ -395,7 +396,7 @@ void MAVLinkProtocol::sendHeartbeat()
{ {
if (m_heartbeatsEnabled) { if (m_heartbeatsEnabled) {
mavlink_message_t beat; mavlink_message_t beat;
mavlink_msg_heartbeat_pack(getSystemId(), getComponentId(),&beat, OCU, MAV_AUTOPILOT_GENERIC); mavlink_msg_heartbeat_pack(getSystemId(), getComponentId(),&beat, MAV_TYPE_OCU, MAV_CLASS_INVALID);
sendMessage(beat); sendMessage(beat);
} }
if (m_authEnabled) { if (m_authEnabled) {
......
...@@ -409,7 +409,7 @@ void MAVLinkSimulationLink::mainloop() ...@@ -409,7 +409,7 @@ void MAVLinkSimulationLink::mainloop()
// streampointer += bufferlength; // streampointer += bufferlength;
// GLOBAL POSITION // GLOBAL POSITION
mavlink_msg_global_position_int_pack(systemId, componentId, &ret, (473780.28137103+(x))*1E3, (85489.9892510421+(y))*1E3, (z+550.0)*1000.0, xSpeed, ySpeed, zSpeed); mavlink_msg_global_position_int_pack(systemId, componentId, &ret, (473780.28137103+(x))*1E3, (85489.9892510421+(y))*1E3, (z+550.0)*1000.0, xSpeed, ySpeed, zSpeed, yaw);
bufferlength = mavlink_msg_to_send_buffer(buffer, &ret); bufferlength = mavlink_msg_to_send_buffer(buffer, &ret);
//add data into datastream //add data into datastream
memcpy(stream+streampointer,buffer, bufferlength); memcpy(stream+streampointer,buffer, bufferlength);
...@@ -546,16 +546,17 @@ void MAVLinkSimulationLink::mainloop() ...@@ -546,16 +546,17 @@ void MAVLinkSimulationLink::mainloop()
static int typeCounter = 0; static int typeCounter = 0;
uint8_t mavType; uint8_t mavType;
if (typeCounter < 10) { if (typeCounter < 10) {
mavType = MAV_QUADROTOR; mavType = MAV_TYPE_QUADROTOR;
} else { } else {
mavType = typeCounter % (OCU); mavType = typeCounter % (MAV_TYPE_OCU);
} }
typeCounter++; typeCounter++;
// Pack message and get size of encoded byte string // Pack message and get size of encoded byte string
messageSize = mavlink_msg_heartbeat_pack(systemId, componentId, &msg, mavType, MAV_AUTOPILOT_PIXHAWK); messageSize = mavlink_msg_heartbeat_pack(systemId, componentId, &msg, mavType, MAV_CLASS_PIXHAWK);
// Allocate buffer with packet data // Allocate buffer with packet data
bufferlength = mavlink_msg_to_send_buffer(buffer, &msg); bufferlength = mavlink_msg_to_send_buffer(buffer, &msg);
qDebug() << "CRC:" << msg.ck_a << msg.ck_b;
//add data into datastream //add data into datastream
memcpy(stream+streampointer,buffer, bufferlength); memcpy(stream+streampointer,buffer, bufferlength);
streampointer += bufferlength; streampointer += bufferlength;
...@@ -716,37 +717,38 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) ...@@ -716,37 +717,38 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
} }
break; break;
// EXECUTE OPERATOR ACTIONS // EXECUTE OPERATOR ACTIONS
case MAVLINK_MSG_ID_ACTION: { case MAVLINK_MSG_ID_COMMAND: {
mavlink_action_t action; mavlink_command_t action;
mavlink_msg_action_decode(&msg, &action); mavlink_msg_command_decode(&msg, &action);
qDebug() << "SIM" << "received action" << action.action << "for system" << action.target; qDebug() << "SIM" << "received action" << action.command << "for system" << action.target_system;
switch (action.action) { // FIXME MAVLINKV10PORTINGNEEDED
case MAV_ACTION_LAUNCH: // switch (action.action) {
status.status = MAV_STATE_ACTIVE; // case MAV_ACTION_LAUNCH:
status.mode = MAV_MODE_AUTO; // status.status = MAV_STATE_ACTIVE;
break; // status.mode = MAV_MODE_AUTO;
case MAV_ACTION_RETURN: // break;
status.status = MAV_STATE_ACTIVE; // case MAV_ACTION_RETURN:
break; // status.status = MAV_STATE_ACTIVE;
case MAV_ACTION_MOTORS_START: // break;
status.status = MAV_STATE_ACTIVE; // case MAV_ACTION_MOTORS_START:
status.mode = MAV_MODE_LOCKED; // status.status = MAV_STATE_ACTIVE;
break; // status.mode = MAV_MODE_LOCKED;
case MAV_ACTION_MOTORS_STOP: // break;
status.status = MAV_STATE_STANDBY; // case MAV_ACTION_MOTORS_STOP:
status.mode = MAV_MODE_LOCKED; // status.status = MAV_STATE_STANDBY;
break; // status.mode = MAV_MODE_LOCKED;
case MAV_ACTION_EMCY_KILL: // break;
status.status = MAV_STATE_EMERGENCY; // case MAV_ACTION_EMCY_KILL:
status.mode = MAV_MODE_MANUAL; // status.status = MAV_STATE_EMERGENCY;
break; // status.mode = MAV_MODE_MANUAL;
case MAV_ACTION_SHUTDOWN: // break;
status.status = MAV_STATE_POWEROFF; // case MAV_ACTION_SHUTDOWN:
status.mode = MAV_MODE_LOCKED; // status.status = MAV_STATE_POWEROFF;
break; // status.mode = MAV_MODE_LOCKED;
} // break;
// }
} }
break; break;
#ifdef MAVLINK_ENABLED_PIXHAWK #ifdef MAVLINK_ENABLED_PIXHAWK
...@@ -771,7 +773,7 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) ...@@ -771,7 +773,7 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
for (i = onboardParams.begin(); i != onboardParams.end(); ++i) { for (i = onboardParams.begin(); i != onboardParams.end(); ++i) {
if (j != 5) { if (j != 5) {
// Pack message and get size of encoded byte string // Pack message and get size of encoded byte string
mavlink_msg_param_value_pack(read.target_system, componentId, &msg, (int8_t*)i.key().toStdString().c_str(), i.value(), onboardParams.size(), j); mavlink_msg_param_value_pack(read.target_system, componentId, &msg, i.key().toStdString().c_str(), i.value(), onboardParams.size(), j);
// Allocate buffer with packet data // Allocate buffer with packet data
bufferlength = mavlink_msg_to_send_buffer(buffer, &msg); bufferlength = mavlink_msg_to_send_buffer(buffer, &msg);
//add data into datastream //add data into datastream
...@@ -799,7 +801,7 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) ...@@ -799,7 +801,7 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
onboardParams.insert(key, set.param_value); onboardParams.insert(key, set.param_value);
// Pack message and get size of encoded byte string // Pack message and get size of encoded byte string
mavlink_msg_param_value_pack(set.target_system, componentId, &msg, (int8_t*)key.toStdString().c_str(), set.param_value, onboardParams.size(), onboardParams.keys().indexOf(key)); mavlink_msg_param_value_pack(set.target_system, componentId, &msg, key.toStdString().c_str(), set.param_value, onboardParams.size(), onboardParams.keys().indexOf(key));
// Allocate buffer with packet data // Allocate buffer with packet data
bufferlength = mavlink_msg_to_send_buffer(buffer, &msg); bufferlength = mavlink_msg_to_send_buffer(buffer, &msg);
//add data into datastream //add data into datastream
...@@ -820,7 +822,7 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) ...@@ -820,7 +822,7 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
float paramValue = onboardParams.value(key); float paramValue = onboardParams.value(key);
// Pack message and get size of encoded byte string // Pack message and get size of encoded byte string
mavlink_msg_param_value_pack(read.target_system, componentId, &msg, (int8_t*)key.toStdString().c_str(), paramValue, onboardParams.size(), onboardParams.keys().indexOf(key)); mavlink_msg_param_value_pack(read.target_system, componentId, &msg, key.toStdString().c_str(), paramValue, onboardParams.size(), onboardParams.keys().indexOf(key));
// Allocate buffer with packet data // Allocate buffer with packet data
bufferlength = mavlink_msg_to_send_buffer(buffer, &msg); bufferlength = mavlink_msg_to_send_buffer(buffer, &msg);
//add data into datastream //add data into datastream
...@@ -832,7 +834,7 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) ...@@ -832,7 +834,7 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
float paramValue = onboardParams.value(key); float paramValue = onboardParams.value(key);
// Pack message and get size of encoded byte string // Pack message and get size of encoded byte string
mavlink_msg_param_value_pack(read.target_system, componentId, &msg, (int8_t*)key.toStdString().c_str(), paramValue, onboardParams.size(), onboardParams.keys().indexOf(key)); mavlink_msg_param_value_pack(read.target_system, componentId, &msg, key.toStdString().c_str(), paramValue, onboardParams.size(), onboardParams.keys().indexOf(key));
// Allocate buffer with packet data // Allocate buffer with packet data
bufferlength = mavlink_msg_to_send_buffer(buffer, &msg); bufferlength = mavlink_msg_to_send_buffer(buffer, &msg);
//add data into datastream //add data into datastream
......
...@@ -68,7 +68,7 @@ void MAVLinkSimulationMAV::mainloop() ...@@ -68,7 +68,7 @@ void MAVLinkSimulationMAV::mainloop()
// 1 Hz execution // 1 Hz execution
if (timer1Hz <= 0) { if (timer1Hz <= 0) {
mavlink_message_t msg; mavlink_message_t msg;
mavlink_msg_heartbeat_pack_version_free(systemid, MAV_COMP_ID_IMU, &msg, MAV_FIXED_WING, MAV_AUTOPILOT_PIXHAWK, mavlink_version); mavlink_msg_heartbeat_pack(systemid, MAV_COMP_ID_IMU, &msg, MAV_TYPE_FIXED_WING, MAV_CLASS_PIXHAWK);
link->sendMAVLinkMessage(&msg); link->sendMAVLinkMessage(&msg);
planner.handleMessage(msg); planner.handleMessage(msg);
...@@ -306,30 +306,31 @@ void MAVLinkSimulationMAV::handleMessage(const mavlink_message_t& msg) ...@@ -306,30 +306,31 @@ void MAVLinkSimulationMAV::handleMessage(const mavlink_message_t& msg)
if (systemid == mode.target) sys_mode = mode.mode; if (systemid == mode.target) sys_mode = mode.mode;
} }
break; break;
case MAVLINK_MSG_ID_ACTION: { // FIXME MAVLINKV10PORTINGNEEDED
mavlink_action_t action; // case MAVLINK_MSG_ID_ACTION: {
mavlink_msg_action_decode(&msg, &action); // mavlink_action_t action;
if (systemid == action.target && (action.target_component == 0 || action.target_component == MAV_COMP_ID_IMU)) { // mavlink_msg_action_decode(&msg, &action);
mavlink_action_ack_t ack; // if (systemid == action.target && (action.target_component == 0 || action.target_component == MAV_COMP_ID_IMU)) {
ack.action = action.action; // mavlink_action_ack_t ack;
switch (action.action) { // ack.action = action.action;
case MAV_ACTION_TAKEOFF: //// switch (action.action) {
flying = true; //// case MAV_ACTION_TAKEOFF:
nav_mode = MAV_NAV_LIFTOFF; //// flying = true;
ack.result = 1; //// nav_mode = MAV_NAV_LIFTOFF;
break; //// ack.result = 1;
default: { //// break;
ack.result = 0; //// default: {
} //// ack.result = 0;
break; //// }
} //// break;
//// }
// Give feedback about action
mavlink_message_t r_msg; // // Give feedback about action
mavlink_msg_action_ack_encode(systemid, MAV_COMP_ID_IMU, &r_msg, &ack); // mavlink_message_t r_msg;
link->sendMAVLinkMessage(&r_msg); // mavlink_msg_action_ack_encode(systemid, MAV_COMP_ID_IMU, &r_msg, &ack);
} // link->sendMAVLinkMessage(&r_msg);
} // }
// }
break; break;
case MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET: { case MAVLINK_MSG_ID_LOCAL_POSITION_SETPOINT_SET: {
mavlink_local_position_setpoint_set_t sp; mavlink_local_position_setpoint_set_t sp;
......
...@@ -55,16 +55,17 @@ protected: ...@@ -55,16 +55,17 @@ protected:
bool flying; bool flying;
int mavlink_version; int mavlink_version;
static inline uint16_t mavlink_msg_heartbeat_pack_version_free(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t type, uint8_t autopilot, uint8_t version) { // FIXME MAVLINKV10PORTINGNEEDED
uint16_t i = 0; // static inline uint16_t mavlink_msg_heartbeat_pack_version_free(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t type, uint8_t autopilot, uint8_t version) {
msg->msgid = MAVLINK_MSG_ID_HEARTBEAT; // uint16_t i = 0;
// msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
i += put_uint8_t_by_index(type, i, msg->payload); // Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) // i += put_uint8_t_by_index(type, i, msg->payload); // Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM)
i += put_uint8_t_by_index(autopilot, i, msg->payload); // Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM // i += put_uint8_t_by_index(autopilot, i, msg->payload); // Type of the Autopilot: 0: Generic, 1: PIXHAWK, 2: SLUGS, 3: Ardupilot (up to 15 types), defined in MAV_AUTOPILOT_TYPE ENUM
i += put_uint8_t_by_index(version, i, msg->payload); // MAVLink version // i += put_uint8_t_by_index(version, i, msg->payload); // MAVLink version
return mavlink_finalize_message(msg, system_id, component_id, i); // return mavlink_finalize_message(msg, system_id, component_id, i);
} // }
}; };
......
...@@ -815,11 +815,11 @@ void MAVLinkSimulationWaypointPlanner::mavlink_handler (const mavlink_message_t* ...@@ -815,11 +815,11 @@ void MAVLinkSimulationWaypointPlanner::mavlink_handler (const mavlink_message_t*
break; break;
} }
case MAVLINK_MSG_ID_ACTION: { // special action from ground station case MAVLINK_MSG_ID_COMMAND: { // special action from ground station
mavlink_action_t action; mavlink_command_t action;
mavlink_msg_action_decode(msg, &action); mavlink_msg_command_decode(msg, &action);
if(action.target == systemid) { if(action.target_system == systemid) {
if (verbose) qDebug("Waypoint: received message with action %d\n", action.action); if (verbose) qDebug("Waypoint: received message with action %d\n", action.command);
// switch (action.action) { // switch (action.action) {
// case MAV_ACTION_LAUNCH: // case MAV_ACTION_LAUNCH:
// if (verbose) std::cerr << "Launch received" << std::endl; // if (verbose) std::cerr << "Launch received" << std::endl;
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2011 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief Definition of UDP connection (server) for unmanned vehicles
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#include <QTimer>
#include <QList>
#include <QDebug>
#include <QMutexLocker>
#include <iostream>
#include "QGCFlightGearLink.h"
#include "QGC.h"
#include <QHostInfo>
QGCFlightGearLink::QGCFlightGearLink(QString remoteHost, QHostAddress host, quint16 port)
{
this->host = host;
this->port = port;
this->connectState = false;
this->currentPort = 49000;
// Set unique ID and add link to the list of links
this->name = tr("FlightGear Link (port:%1)").arg(port);
setRemoteHost(remoteHost);
connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(sendUAVUpdate()));
refreshTimer.start(20); // 50 Hz UAV -> Simulation update rate
}
QGCFlightGearLink::~QGCFlightGearLink()
{
disconnect();
}
/**
* @brief Runs the thread
*
**/
void QGCFlightGearLink::run()
{
// forever
// {
// QGC::SLEEP::msleep(5000);
// }
exec();
}
void QGCFlightGearLink::setPort(int port)
{
this->port = port;
disconnectSimulation();
connectSimulation();
}
/**
* @param host Hostname in standard formatting, e.g. localhost:14551 or 192.168.1.1:14551
*/
void QGCFlightGearLink::setRemoteHost(const QString& host)
{
//qDebug() << "UDP:" << "ADDING HOST:" << host;
if (host.contains(":"))
{
//qDebug() << "HOST: " << host.split(":").first();
QHostInfo info = QHostInfo::fromName(host.split(":").first());
if (info.error() == QHostInfo::NoError)
{
// Add host
QList<QHostAddress> hostAddresses = info.addresses();
QHostAddress address;
for (int i = 0; i < hostAddresses.size(); i++)
{
// Exclude loopback IPv4 and all IPv6 addresses
if (!hostAddresses.at(i).toString().contains(":"))
{
address = hostAddresses.at(i);
}
}
currentHost = address;
//qDebug() << "Address:" << address.toString();
// Set port according to user input
currentPort = host.split(":").last().toInt();
}
}
else
{
QHostInfo info = QHostInfo::fromName(host);
if (info.error() == QHostInfo::NoError)
{
// Add host
currentHost = info.addresses().first();
}
}
}
void QGCFlightGearLink::updateGlobalPosition(quint64 time, double lat, double lon, double alt)
{
}
void QGCFlightGearLink::sendUAVUpdate()
{
// 37.613548,-122.357246,-9999.000000,0.000000,0.424000,297.899994,0.000000\n
// magnetos,aileron,elevator,rudder,throttle\n
float magnetos = 3.0f;
float aileron = 0.0f;
float elevator = 0.0f;
float rudder = 0.0f;
float throttle = 90.0f;
QString state("%1,%2,%3,%4,%5\n");
state = state.arg(magnetos).arg(aileron).arg(elevator).arg(rudder).arg(throttle);
writeBytes(state.toAscii().constData(), state.length());
}
void QGCFlightGearLink::writeBytes(const char* data, qint64 size)
{
//#define QGCFlightGearLink_DEBUG
#ifdef QGCFlightGearLink_DEBUG
QString bytes;
QString ascii;
for (int i=0; i<size; i++)
{
unsigned char v = data[i];
bytes.append(QString().sprintf("%02x ", v));
if (data[i] > 31 && data[i] < 127)
{
ascii.append(data[i]);
}
else
{
ascii.append(219);
}
}
qDebug() << "Sent" << size << "bytes to" << currentHost.toString() << ":" << currentPort << "data:";
qDebug() << bytes;
qDebug() << "ASCII:" << ascii;
#endif
socket->writeDatagram(data, size, currentHost, currentPort);
}
/**
* @brief Read a number of bytes from the interface.
*
* @param data Pointer to the data byte array to write the bytes to
* @param maxLength The maximum number of bytes to write
**/
void QGCFlightGearLink::readBytes()
{
const qint64 maxLength = 65536;
static char data[maxLength];
QHostAddress sender;
quint16 senderPort;
unsigned int s = socket->pendingDatagramSize();
if (s > maxLength) std::cerr << __FILE__ << __LINE__ << " UDP datagram overflow, allowed to read less bytes than datagram size" << std::endl;
socket->readDatagram(data, maxLength, &sender, &senderPort);
// FIXME TODO Check if this method is better than retrieving the data by individual processes
QByteArray b(data, s);
//emit bytesReceived(this, b);
// Print string
qDebug() << "FG LINK GOT:" << QString(b);
// // Echo data for debugging purposes
// std::cerr << __FILE__ << __LINE__ << "Received datagram:" << std::endl;
// int i;
// for (i=0; i<s; i++)
// {
// unsigned int v=data[i];
// fprintf(stderr,"%02x ", v);
// }
// std::cerr << std::endl;
}
/**
* @brief Get the number of bytes to read.
*
* @return The number of bytes to read
**/
qint64 QGCFlightGearLink::bytesAvailable()
{
return socket->pendingDatagramSize();
}
/**
* @brief Disconnect the connection.
*
* @return True if connection has been disconnected, false if connection couldn't be disconnected.
**/
bool QGCFlightGearLink::disconnectSimulation()
{
delete socket;
socket = NULL;
connectState = false;
emit flightGearDisconnected();
emit flightGearConnected(false);
return !connectState;
}
/**
* @brief Connect the connection.
*
* @return True if connection has been established, false if connection couldn't be established.
**/
bool QGCFlightGearLink::connectSimulation()
{
socket = new QUdpSocket(this);
//Check if we are using a multicast-address
// bool multicast = false;
// if (host.isInSubnet(QHostAddress("224.0.0.0"),4))
// {
// multicast = true;
// connectState = socket->bind(port, QUdpSocket::ShareAddress);
// }
// else
// {
connectState = socket->bind(host, port);
// }
//Provides Multicast functionality to UdpSocket
/* not working yet
if (multicast)
{
int sendingFd = socket->socketDescriptor();
if (sendingFd != -1)
{
// set up destination address
struct sockaddr_in sendAddr;
memset(&sendAddr,0,sizeof(sendAddr));
sendAddr.sin_family=AF_INET;
sendAddr.sin_addr.s_addr=inet_addr(HELLO_GROUP);
sendAddr.sin_port=htons(port);
// set TTL
unsigned int ttl = 1; // restricted to the same subnet
if (setsockopt(sendingFd, IPPROTO_IP, IP_MULTICAST_TTL, (unsigned int*)&ttl, sizeof(ttl) ) < 0)
{
std::cout << "TTL failed\n";
}
}
}
*/
//QObject::connect(socket, SIGNAL(readyRead()), this, SLOT(readPendingDatagrams()));
QObject::connect(socket, SIGNAL(readyRead()), this, SLOT(readBytes()));
emit flightGearConnected(connectState);
if (connectState) {
emit flightGearConnected();
connectionStartTime = QGC::groundTimeUsecs()/1000;
}
start(HighPriority);
return connectState;
}
/**
* @brief Check if connection is active.
*
* @return True if link is connected, false otherwise.
**/
bool QGCFlightGearLink::isConnected()
{
return connectState;
}
QString QGCFlightGearLink::getName()
{
return name;
}
void QGCFlightGearLink::setName(QString name)
{
this->name = name;
// emit nameChanged(this->name);
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2011 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief UDP connection (server) for unmanned vehicles
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
#ifndef QGCFLIGHTGEARLINK_H
#define QGCFLIGHTGEARLINK_H
#include <QString>
#include <QList>
#include <QMap>
#include <QMutex>
#include <QUdpSocket>
#include <QTimer>
#include <LinkInterface.h>
#include <configuration.h>
class QGCFlightGearLink : public QThread
{
Q_OBJECT
//Q_INTERFACES(QGCFlightGearLinkInterface:LinkInterface)
public:
QGCFlightGearLink(QString remoteHost=QString("127.0.0.1:49000"), QHostAddress host = QHostAddress::Any, quint16 port = 49005);
~QGCFlightGearLink();
bool isConnected();
qint64 bytesAvailable();
int getPort() const {
return port;
}
/**
* @brief The human readable port name
*/
QString getName();
void run();
public slots:
// void setAddress(QString address);
void setPort(int port);
/** @brief Add a new host to broadcast messages to */
void setRemoteHost(const QString& host);
void updateGlobalPosition(quint64 time, double lat, double lon, double alt);
void sendUAVUpdate();
// /** @brief Remove a host from broadcasting messages to */
// void removeHost(const QString& host);
// void readPendingDatagrams();
void readBytes();
/**
* @brief Write a number of bytes to the interface.
*
* @param data Pointer to the data byte array
* @param size The size of the bytes array
**/
void writeBytes(const char* data, qint64 length);
bool connectSimulation();
bool disconnectSimulation();
protected:
QString name;
QHostAddress host;
QHostAddress currentHost;
quint16 currentPort;
quint16 port;
int id;
QUdpSocket* socket;
bool connectState;
quint64 bitsSentTotal;
quint64 bitsSentCurrent;
quint64 bitsSentMax;
quint64 bitsReceivedTotal;
quint64 bitsReceivedCurrent;
quint64 bitsReceivedMax;
quint64 connectionStartTime;
QMutex statisticsMutex;
QMutex dataMutex;
QTimer refreshTimer;
void setName(QString name);
signals:
/**
* @brief This signal is emitted instantly when the link is connected
**/
void flightGearConnected();
/**
* @brief This signal is emitted instantly when the link is disconnected
**/
void flightGearDisconnected();
/**
* @brief This signal is emitted instantly when the link status changes
**/
void flightGearConnected(bool connected);
};
#endif // QGCFLIGHTGEARLINK_H
...@@ -86,7 +86,8 @@ void UDPLink::setPort(int port) ...@@ -86,7 +86,8 @@ void UDPLink::setPort(int port)
void UDPLink::addHost(const QString& host) void UDPLink::addHost(const QString& host)
{ {
//qDebug() << "UDP:" << "ADDING HOST:" << host; //qDebug() << "UDP:" << "ADDING HOST:" << host;
if (host.contains(":")) { if (host.contains(":"))
{
//qDebug() << "HOST: " << host.split(":").first(); //qDebug() << "HOST: " << host.split(":").first();
QHostInfo info = QHostInfo::fromName(host.split(":").first()); QHostInfo info = QHostInfo::fromName(host.split(":").first());
if (info.error() == QHostInfo::NoError) if (info.error() == QHostInfo::NoError)
...@@ -129,14 +130,18 @@ void UDPLink::removeHost(const QString& hostname) ...@@ -129,14 +130,18 @@ void UDPLink::removeHost(const QString& hostname)
QHostInfo info = QHostInfo::fromName(host); QHostInfo info = QHostInfo::fromName(host);
QHostAddress address; QHostAddress address;
QList<QHostAddress> hostAddresses = info.addresses(); QList<QHostAddress> hostAddresses = info.addresses();
for (int i = 0; i < hostAddresses.size(); i++) { for (int i = 0; i < hostAddresses.size(); i++)
{
// Exclude loopback IPv4 and all IPv6 addresses // Exclude loopback IPv4 and all IPv6 addresses
if (!hostAddresses.at(i).toString().contains(":")) { if (!hostAddresses.at(i).toString().contains(":"))
{
address = hostAddresses.at(i); address = hostAddresses.at(i);
} }
} }
for (int i = 0; i < hosts.count(); ++i) { for (int i = 0; i < hosts.count(); ++i)
if (hosts.at(i) == address) { {
if (hosts.at(i) == address)
{
hosts.removeAt(i); hosts.removeAt(i);
ports.removeAt(i); ports.removeAt(i);
} }
...@@ -154,7 +159,8 @@ void UDPLink::writeBytes(const char* data, qint64 size) ...@@ -154,7 +159,8 @@ void UDPLink::writeBytes(const char* data, qint64 size)
#ifdef UDPLINK_DEBUG #ifdef UDPLINK_DEBUG
QString bytes; QString bytes;
QString ascii; QString ascii;
for (int i=0; i<size; i++) { for (int i=0; i<size; i++)
{
unsigned char v = data[i]; unsigned char v = data[i];
bytes.append(QString().sprintf("%02x ", v)); bytes.append(QString().sprintf("%02x ", v));
if (data[i] > 31 && data[i] < 127) if (data[i] > 31 && data[i] < 127)
...@@ -183,7 +189,7 @@ void UDPLink::writeBytes(const char* data, qint64 size) ...@@ -183,7 +189,7 @@ void UDPLink::writeBytes(const char* data, qint64 size)
void UDPLink::readBytes() void UDPLink::readBytes()
{ {
const qint64 maxLength = 65536; const qint64 maxLength = 65536;
char data[maxLength]; static char data[maxLength];
QHostAddress sender; QHostAddress sender;
quint16 senderPort; quint16 senderPort;
...@@ -207,11 +213,14 @@ void UDPLink::readBytes() ...@@ -207,11 +213,14 @@ void UDPLink::readBytes()
// Add host to broadcast list if not yet present // Add host to broadcast list if not yet present
if (!hosts.contains(sender)) { if (!hosts.contains(sender))
{
hosts.append(sender); hosts.append(sender);
ports.append(senderPort); ports.append(senderPort);
// ports->insert(sender, senderPort); // ports->insert(sender, senderPort);
} else { }
else
{
int index = hosts.indexOf(sender); int index = hosts.indexOf(sender);
ports.replace(index, senderPort); ports.replace(index, senderPort);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
QGroundControl Open Source Ground Control Station QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> (c) 2009 - 2011 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project This file is part of the QGROUNDCONTROL project
......
...@@ -65,7 +65,7 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -65,7 +65,7 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
mavlink_msg_pattern_detected_decode(&message, &detected); mavlink_msg_pattern_detected_decode(&message, &detected);
QByteArray b; QByteArray b;
b.resize(256); b.resize(256);
mavlink_msg_pattern_detected_get_file(&message, (int8_t*)b.data()); mavlink_msg_pattern_detected_get_file(&message, b.data());
b.append('\0'); b.append('\0');
QString name = QString(b); QString name = QString(b);
if (detected.type == 0) if (detected.type == 0)
......
...@@ -10,16 +10,21 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte ...@@ -10,16 +10,21 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
{ {
QPointer<QObject> p; QPointer<QObject> p;
if (parent != NULL) { if (parent != NULL)
{
p = parent; p = parent;
} else { }
else
{
p = mavlink; p = mavlink;
} }
UASInterface* uas; UASInterface* uas;
switch (heartbeat->autopilot) { switch (heartbeat->autopilot)
case MAV_AUTOPILOT_GENERIC: { {
case MAV_CLASS_GENERIC:
{
UAS* mav = new UAS(mavlink, sysid); UAS* mav = new UAS(mavlink, sysid);
// Set the system type // Set the system type
mav->setSystemType((int)heartbeat->type); mav->setSystemType((int)heartbeat->type);
...@@ -28,7 +33,8 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte ...@@ -28,7 +33,8 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
uas = mav; uas = mav;
} }
break; break;
case MAV_AUTOPILOT_PIXHAWK: { case MAV_CLASS_PIXHAWK:
{
PxQuadMAV* mav = new PxQuadMAV(mavlink, sysid); PxQuadMAV* mav = new PxQuadMAV(mavlink, sysid);
// Set the system type // Set the system type
mav->setSystemType((int)heartbeat->type); mav->setSystemType((int)heartbeat->type);
...@@ -40,7 +46,8 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte ...@@ -40,7 +46,8 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
uas = mav; uas = mav;
} }
break; break;
case MAV_AUTOPILOT_SLUGS: { case MAV_CLASS_SLUGS:
{
SlugsMAV* mav = new SlugsMAV(mavlink, sysid); SlugsMAV* mav = new SlugsMAV(mavlink, sysid);
// Set the system type // Set the system type
mav->setSystemType((int)heartbeat->type); mav->setSystemType((int)heartbeat->type);
...@@ -52,7 +59,8 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte ...@@ -52,7 +59,8 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
uas = mav; uas = mav;
} }
break; break;
case MAV_AUTOPILOT_ARDUPILOTMEGA: { case MAV_CLASS_ARDUPILOTMEGA:
{
ArduPilotMegaMAV* mav = new ArduPilotMegaMAV(mavlink, sysid); ArduPilotMegaMAV* mav = new ArduPilotMegaMAV(mavlink, sysid);
// Set the system type // Set the system type
mav->setSystemType((int)heartbeat->type); mav->setSystemType((int)heartbeat->type);
...@@ -64,7 +72,8 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte ...@@ -64,7 +72,8 @@ UASInterface* QGCMAVLinkUASFactory::createUAS(MAVLinkProtocol* mavlink, LinkInte
uas = mav; uas = mav;
} }
break; break;
default: { default:
{
UAS* mav = new UAS(mavlink, sysid); UAS* mav = new UAS(mavlink, sysid);
mav->setSystemType((int)heartbeat->type); mav->setSystemType((int)heartbeat->type);
// Connect this robot to the UAS object // Connect this robot to the UAS object
......
This diff is collapsed.
...@@ -204,6 +204,8 @@ protected: //COMMENTS FOR TEST UNIT ...@@ -204,6 +204,8 @@ protected: //COMMENTS FOR TEST UNIT
QGCUASParamManager* paramManager; ///< Parameter manager class QGCUASParamManager* paramManager; ///< Parameter manager class
QString shortStateText; ///< Short textual state description QString shortStateText; ///< Short textual state description
QString shortModeText; ///< Short textual mode description QString shortModeText; ///< Short textual mode description
bool attitudeStamped; ///< Should arriving data be timestamped with the last attitude? This helps with broken system time clocks on the MAV
quint64 lastAttitude; ///< Timestamp of last attitude measurement
public: public:
/** @brief Set the current battery type */ /** @brief Set the current battery type */
...@@ -253,8 +255,6 @@ public slots: ...@@ -253,8 +255,6 @@ public slots:
} }
/** @brief Set a new name **/ /** @brief Set a new name **/
void setUASName(const QString& name); void setUASName(const QString& name);
/** @brief Executes an action **/
void setAction(MAV_ACTION action);
/** @brief Executes a command **/ /** @brief Executes a command **/
void executeCommand(MAV_CMD command); void executeCommand(MAV_CMD command);
/** @brief Executes a command **/ /** @brief Executes a command **/
...@@ -403,6 +403,8 @@ signals: ...@@ -403,6 +403,8 @@ signals:
protected: protected:
/** @brief Get the UNIX timestamp in milliseconds */ /** @brief Get the UNIX timestamp in milliseconds */
quint64 getUnixTime(quint64 time=0); quint64 getUnixTime(quint64 time=0);
/** @brief Get the UNIX timestamp in milliseconds, ignore attitudeStamped mode */
quint64 getUnixReferenceTime(quint64 time);
protected slots: protected slots:
/** @brief Write settings to disk */ /** @brief Write settings to disk */
......
...@@ -188,8 +188,6 @@ public slots: ...@@ -188,8 +188,6 @@ public slots:
/** @brief Set a new name for the system */ /** @brief Set a new name for the system */
virtual void setUASName(const QString& name) = 0; virtual void setUASName(const QString& name) = 0;
/** @brief Sets an action **/
virtual void setAction(MAV_ACTION action) = 0;
/** @brief Execute command immediately **/ /** @brief Execute command immediately **/
virtual void executeCommand(MAV_CMD command) = 0; virtual void executeCommand(MAV_CMD command) = 0;
/** @brief Executes a command **/ /** @brief Executes a command **/
......
...@@ -32,7 +32,6 @@ This file is part of the QGROUNDCONTROL project ...@@ -32,7 +32,6 @@ This file is part of the QGROUNDCONTROL project
#include "UASWaypointManager.h" #include "UASWaypointManager.h"
#include "UAS.h" #include "UAS.h"
#include "mavlink_types.h" #include "mavlink_types.h"
//#include "MainWindow.h"
#define PROTOCOL_TIMEOUT_MS 2000 ///< maximum time to wait for pending messages until timeout #define PROTOCOL_TIMEOUT_MS 2000 ///< maximum time to wait for pending messages until timeout
#define PROTOCOL_DELAY_MS 40 ///< minimum delay between sent messages #define PROTOCOL_DELAY_MS 40 ///< minimum delay between sent messages
...@@ -586,8 +585,10 @@ int UASWaypointManager::getLocalFrameCount() ...@@ -586,8 +585,10 @@ int UASWaypointManager::getLocalFrameCount()
// Search through all waypoints, // Search through all waypoints,
// counting only those in global frame // counting only those in global frame
int i = 0; int i = 0;
foreach (Waypoint* p, waypoints) { foreach (Waypoint* p, waypoints)
if (p->getFrame() == MAV_FRAME_GLOBAL) { {
if (p->getFrame() == MAV_FRAME_GLOBAL)
{
i++; i++;
} }
} }
...@@ -600,8 +601,10 @@ int UASWaypointManager::getLocalFrameIndexOf(Waypoint* wp) ...@@ -600,8 +601,10 @@ int UASWaypointManager::getLocalFrameIndexOf(Waypoint* wp)
// Search through all waypoints, // Search through all waypoints,
// counting only those in local frame // counting only those in local frame
int i = 0; int i = 0;
foreach (Waypoint* p, waypoints) { foreach (Waypoint* p, waypoints)
if (p->getFrame() == MAV_FRAME_LOCAL) { {
if (p->getFrame() == MAV_FRAME_LOCAL_NED || p->getFrame() == MAV_FRAME_LOCAL_ENU)
{
if (p == wp) { if (p == wp) {
return i; return i;
} }
...@@ -617,7 +620,8 @@ int UASWaypointManager::getMissionFrameIndexOf(Waypoint* wp) ...@@ -617,7 +620,8 @@ int UASWaypointManager::getMissionFrameIndexOf(Waypoint* wp)
// Search through all waypoints, // Search through all waypoints,
// counting only those in mission frame // counting only those in mission frame
int i = 0; int i = 0;
foreach (Waypoint* p, waypoints) { foreach (Waypoint* p, waypoints)
{
if (p->getFrame() == MAV_FRAME_MISSION) { if (p->getFrame() == MAV_FRAME_MISSION) {
if (p == wp) { if (p == wp) {
return i; return i;
......
...@@ -355,7 +355,7 @@ void DebugConsole::receiveBytes(LinkInterface* link, QByteArray bytes) ...@@ -355,7 +355,7 @@ void DebugConsole::receiveBytes(LinkInterface* link, QByteArray bytes)
for (int j = 0; j < len; j++) for (int j = 0; j < len; j++)
{ {
unsigned char byte = bytes.at(j); unsigned char byte = bytes.at(j);
// Filter MAVLink (http://pixhawk.ethz.ch/wiki/mavlink/) messages out of the stream. // Filter MAVLink (http://qgroundcontrol.org/mavlink/) messages out of the stream.
if (filterMAVLINK) if (filterMAVLINK)
{ {
if (this->bytesToIgnore > 0) if (this->bytesToIgnore > 0)
......
...@@ -792,7 +792,8 @@ void HSIDisplay::drawWaypoints(QPainter& painter) ...@@ -792,7 +792,8 @@ void HSIDisplay::drawWaypoints(QPainter& painter)
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
QPointF in; QPointF in;
if (list.at(i)->getFrame() == MAV_FRAME_LOCAL) { if (list.at(i)->getFrame() == MAV_FRAME_LOCAL_NED)
{
// Do not transform // Do not transform
in = QPointF(list.at(i)->getX(), list.at(i)->getY()); in = QPointF(list.at(i)->getX(), list.at(i)->getY());
} else { } else {
......
...@@ -157,6 +157,11 @@ MainWindow::MainWindow(QWidget *parent): ...@@ -157,6 +157,11 @@ MainWindow::MainWindow(QWidget *parent):
joystickWidget = 0; joystickWidget = 0;
joystick = new JoystickInput(); joystick = new JoystickInput();
// Connect flighgear test link
// FIXME MOVE INTO UAV OBJECT
fgLink = new QGCFlightGearLink();
fgLink->connectSimulation();
// Load Toolbar // Load Toolbar
toolBar = new QGCToolBar(this); toolBar = new QGCToolBar(this);
this->addToolBar(toolBar); this->addToolBar(toolBar);
...@@ -1629,7 +1634,7 @@ void MainWindow::UASCreated(UASInterface* uas) ...@@ -1629,7 +1634,7 @@ void MainWindow::UASCreated(UASInterface* uas)
} }
switch (uas->getAutopilotType()) { switch (uas->getAutopilotType()) {
case (MAV_AUTOPILOT_SLUGS): { case (MAV_CLASS_SLUGS): {
// Build Slugs Widgets // Build Slugs Widgets
buildSlugsWidgets(); buildSlugsWidgets();
...@@ -1667,9 +1672,9 @@ void MainWindow::UASCreated(UASInterface* uas) ...@@ -1667,9 +1672,9 @@ void MainWindow::UASCreated(UASInterface* uas)
} }
break; break;
default: default:
case (MAV_AUTOPILOT_GENERIC): case (MAV_CLASS_GENERIC):
case (MAV_AUTOPILOT_ARDUPILOTMEGA): case (MAV_CLASS_ARDUPILOTMEGA):
case (MAV_AUTOPILOT_PIXHAWK): { case (MAV_CLASS_PIXHAWK): {
// Build Pixhawk Widgets // Build Pixhawk Widgets
buildPxWidgets(); buildPxWidgets();
...@@ -2005,4 +2010,4 @@ void MainWindow::loadDataView(QString fileName) ...@@ -2005,4 +2010,4 @@ void MainWindow::loadDataView(QString fileName)
QList<QAction*> MainWindow::listLinkMenuActions(void) QList<QAction*> MainWindow::listLinkMenuActions(void)
{ {
return ui.menuNetwork->actions(); return ui.menuNetwork->actions();
} }
\ No newline at end of file
...@@ -50,7 +50,6 @@ This file is part of the QGROUNDCONTROL project ...@@ -50,7 +50,6 @@ This file is part of the QGROUNDCONTROL project
#include "UASListWidget.h" #include "UASListWidget.h"
#include "MAVLinkProtocol.h" #include "MAVLinkProtocol.h"
#include "MAVLinkSimulationLink.h" #include "MAVLinkSimulationLink.h"
#include "AS4Protocol.h"
#include "ObjectDetectionView.h" #include "ObjectDetectionView.h"
#include "HUD.h" #include "HUD.h"
#include "JoystickWidget.h" #include "JoystickWidget.h"
...@@ -76,6 +75,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -76,6 +75,7 @@ This file is part of the QGROUNDCONTROL project
#include "SlugsPadCameraControl.h" #include "SlugsPadCameraControl.h"
#include "UASControlParameters.h" #include "UASControlParameters.h"
#include "QGCFlightGearLink.h"
class QGCMapTool; class QGCMapTool;
...@@ -372,7 +372,6 @@ protected: ...@@ -372,7 +372,6 @@ protected:
// TODO Should be moved elsewhere, as the protocol does not belong to the UI // TODO Should be moved elsewhere, as the protocol does not belong to the UI
MAVLinkProtocol* mavlink; MAVLinkProtocol* mavlink;
AS4Protocol* as4link;
MAVLinkSimulationLink* simulationLink; MAVLinkSimulationLink* simulationLink;
LinkInterface* udpLink; LinkInterface* udpLink;
...@@ -449,6 +448,7 @@ protected: ...@@ -449,6 +448,7 @@ protected:
QGC_MAINWINDOW_STYLE currentStyle; QGC_MAINWINDOW_STYLE currentStyle;
Qt::WindowStates windowStateVal; Qt::WindowStates windowStateVal;
bool lowPowerMode; ///< If enabled, QGC reduces the update rates of all widgets bool lowPowerMode; ///< If enabled, QGC reduces the update rates of all widgets
QGCFlightGearLink* fgLink;
private: private:
Ui::MainWindow ui; Ui::MainWindow ui;
......
...@@ -270,13 +270,14 @@ void RadioCalibrationWindow::send() ...@@ -270,13 +270,14 @@ void RadioCalibrationWindow::send()
void RadioCalibrationWindow::request() void RadioCalibrationWindow::request()
{ {
qDebug() << __FILE__ << __LINE__ << "READ FROM UAV"; // FIXME MAVLINKV10PORTINGNEEDED
UAS *uas = dynamic_cast<UAS*>(UASManager::instance()->getUASForId(uasId)); // qDebug() << __FILE__ << __LINE__ << "READ FROM UAV";
if (uas) { // UAS *uas = dynamic_cast<UAS*>(UASManager::instance()->getUASForId(uasId));
mavlink_message_t msg; // if (uas) {
mavlink_msg_action_pack(uasId, 0, &msg, 0, 0, ::MAV_ACTION_CALIBRATE_RC); // mavlink_message_t msg;
uas->sendMessage(msg); // mavlink_msg_action_pack(uasId, 0, &msg, 0, 0, ::MAV_ACTION_CALIBRATE_RC);
} // uas->sendMessage(msg);
// }
} }
void RadioCalibrationWindow::receive(const QPointer<RadioCalibrationData>& radio) void RadioCalibrationWindow::receive(const QPointer<RadioCalibrationData>& radio)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -82,8 +82,6 @@ protected: ...@@ -82,8 +82,6 @@ protected:
protected slots: protected slots:
void addParam(); void addParam();
/** @deprecated */
void addAction();
void addCommand(); void addCommand();
void setTitle(); void setTitle();
void setTitle(QString title); void setTitle(QString title);
......
This diff is collapsed.
This diff is collapsed.
*~ *~
doc/html doc/html
doc/*.log doc/*.log
missionlib/testing/*.xcodeproj/*
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment