Browse Source

Merge branch 'master' of github.com:mavlink/qgroundcontrol

QGC4.4
LM 13 years ago
parent
commit
ec6036477a
  1. 43
      README
  2. 12
      READMEvc2010.txt
  3. 81
      qgcunittest.pro
  4. 670
      qgroundcontrol.pri
  5. 62
      qgroundcontrol.pro
  6. 45
      src/uas/UAS.cc
  7. 75
      src/uas/UAS.h
  8. 23
      src/uas/UASInterface.h
  9. 427
      src/ui/map3D/GLOverlayGeode.cc
  10. 49
      src/ui/map3D/GLOverlayGeode.h
  11. 65
      src/ui/map3D/Pixhawk3DWidget.cc
  12. 5
      src/ui/map3D/Pixhawk3DWidget.h
  13. 6
      src/ui/map3D/SystemContainer.cc
  14. 3
      src/ui/map3D/SystemContainer.h
  15. 23
      src/ui/map3D/SystemViewParams.cc
  16. 6
      src/ui/map3D/SystemViewParams.h
  17. 34
      src/ui/map3D/ViewParamWidget.cc
  18. 6
      src/ui/map3D/ViewParamWidget.h
  19. 32
      thirdParty/mavlink/include/mavlink_protobuf_manager.hpp
  20. 3579
      thirdParty/mavlink/include/pixhawk/pixhawk.pb.h
  21. 155
      thirdParty/mavlink/message_definitions/pixhawk.proto
  22. 83
      thirdParty/mavlink/message_definitions/sensesoar.xml
  23. 5429
      thirdParty/mavlink/src/pixhawk/pixhawk.pb.cc

43
README

@ -78,52 +78,25 @@ Done.
Windows Windows
======= =======
DETAILED STEPS BELOW THE VISUAL STUDIO 2010 NOTES.
GNU GCC / MINGW IS UNTESTED, COULD WORK GNU GCC / MINGW IS UNTESTED, COULD WORK
VISUAL STUDIO 2008 / 2010 EXPRESS EDITION IS FREE! VISUAL STUDIO 2008 / 2010 EXPRESS EDITION IS FREE!
------------------------------------------------------------------------------------- Steps for Visual Studio 2008 / 2010:
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) OR download Qt source and compile with VS 2010 1) Download and install the Qt libraries for Windows from https://qt.nokia.com/downloads/ (the Visual Studio 2008 or 2010 version as appropriate)
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
4) Build the library. See win32.README 2) Download and install Visual Studio 2008 or 2010 Express Edition (free) from https://www.microsoft.com/visualstudio
5) Go to the source folder of QGroundControl with the Qt 4.7.x Command Prompt tool (from the applications menu) 3) Go to the QGroundControl folder and then to thirdParty/libxbee and build it following the instructions in win32.README
6) Create the Visual Studio project by typing: 4) Open the Qt Command Prompt program (should be in the Start Menu), navigate to the source folder of QGroundControl and create the Visual Studio project by typing:
qmake -tp vc qgroundcontrol.pro `qmake -tp vc qgroundcontrol.pro`
7) Now start Visual Studio and load the qgroundcontrol.vcproj file 5) Now start Visual Studio and load the qgroundcontrol.vcproj if using Visual Studio 2008 or qgroundcontrol.vcxproj if using Visual Studio 2010
8) Compile and edit in Visual Studio. If you need to add new files, add them to qgroundcontrol.pro and re-run "quake -tp vc qgroundcontrol.pro" 6) Compile and edit in Visual Studio. If you need to add new files, add them to qgroundcontrol.pro and re-run `qmake -tp vc qgroundcontrol.pro`

12
READMEvc2010.txt

@ -1,12 +0,0 @@
For use of qt 4x and visual studio2010 and add in.
The Visual studio adds automatically certain defines
In the projects properties -> C/C++ ->preprocessor change:
in DEBUG:
delete QT_NO_DEBUG
Both:
delete QT_NO_DYNAMIC_CAST

81
qgcunittest.pro

@ -4,10 +4,10 @@
# #
#------------------------------------------------- #-------------------------------------------------
QT += network \ QT += network \
phonon \ phonon \
testlib \ testlib \
svg svg
TEMPLATE = app TEMPLATE = app
@ -99,49 +99,46 @@ INCLUDEPATH += . \
$$BASEDIR/src/ui/ \ $$BASEDIR/src/ui/ \
SOURCES += src/uas/UAS.cc \ SOURCES += src/uas/UAS.cc \
src/comm/MAVLinkProtocol.cc \ src/comm/MAVLinkProtocol.cc \
src/uas/UASWaypointManager.cc \ src/uas/UASWaypointManager.cc \
src/Waypoint.cc \ src/Waypoint.cc \
src/ui/RadioCalibration/RadioCalibrationData.cc \ src/ui/RadioCalibration/RadioCalibrationData.cc \
src/uas/SlugsMAV.cc \ src/uas/SlugsMAV.cc \
src/uas/PxQuadMAV.cc \ src/uas/PxQuadMAV.cc \
src/uas/ArduPilotMegaMAV.cc \ src/uas/ArduPilotMegaMAV.cc \
src/GAudioOutput.cc \ src/GAudioOutput.cc \
src/uas/UASManager.cc \ src/uas/UASManager.cc \
src/comm/LinkManager.cc \ src/comm/LinkManager.cc \
src/QGC.cc \ src/QGC.cc \
src/comm/SerialLink.cc \ src/comm/SerialLink.cc \
$$TESTDIR/SlugsMavUnitTest.cc \ $$TESTDIR/SlugsMavUnitTest.cc \
$$TESTDIR/testSuite.cc \ $$TESTDIR/testSuite.cc \
$$TESTDIR/UASUnitTest.cc \ $$TESTDIR/UASUnitTest.cc \
src/uas/QGCMAVLinkUASFactory.cc src/uas/QGCMAVLinkUASFactory.cc
HEADERS += src/uas/UASInterface.h \ HEADERS += src/uas/UASInterface.h \
src/uas/UAS.h \ src/uas/UAS.h \
src/comm/MAVLinkProtocol.h \ src/comm/MAVLinkProtocol.h \
src/comm/ProtocolInterface.h \ src/comm/ProtocolInterface.h \
src/uas/UASWaypointManager.h \ src/uas/UASWaypointManager.h \
src/Waypoint.h \ src/Waypoint.h \
src/ui/RadioCalibration/RadioCalibrationData.h \ src/ui/RadioCalibration/RadioCalibrationData.h \
src/uas/SlugsMAV.h \ src/uas/SlugsMAV.h \
src/uas/PxQuadMAV.h \ src/uas/PxQuadMAV.h \
src/uas/ArduPilotMegaMAV.h \ src/uas/ArduPilotMegaMAV.h \
src/GAudioOutput.h \ src/GAudioOutput.h \
src/uas/UASManager.h \ src/uas/UASManager.h \
src/comm/LinkManager.h \ src/comm/LinkManager.h \
src/comm/LinkInterface.h \ src/comm/LinkInterface.h \
src/QGC.h \ src/QGC.h \
src/comm/SerialLinkInterface.h \ src/comm/SerialLinkInterface.h \
src/comm/SerialLink.h \ src/comm/SerialLink.h \
$$TESTDIR//SlugsMavUnitTest.h \ $$TESTDIR//SlugsMavUnitTest.h \
$$TESTDIR/AutoTest.h \ $$TESTDIR/AutoTest.h \
$$TESTDIR/UASUnitTest.h \ $$TESTDIR/UASUnitTest.h \
src/uas/QGCMAVLinkUASFactory.h src/uas/QGCMAVLinkUASFactory.h
DEFINES += SRCDIR=\\\"$$PWD/\\\" DEFINES += SRCDIR=\\\"$$PWD/\\\"

670
qgroundcontrol.pri

@ -20,17 +20,10 @@
message(Qt version $$[QT_VERSION]) message(Qt version $$[QT_VERSION])
message(Using Qt from $$(QTDIR)) message(Using Qt from $$(QTDIR))
release {
# DEFINES += QT_NO_DEBUG_OUTPUT
# DEFINES += QT_NO_WARNING_OUTPUT
}
win32-msvc2008|win32-msvc2010 { win32-msvc2008|win32-msvc2010 {
QMAKE_POST_LINK += $$quote(echo "Copying files"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(echo "Copying files"$$escape_expand(\\n))
} else { } else {
QMAKE_POST_LINK += $$quote(echo "Copying files") QMAKE_POST_LINK += $$quote(echo "Copying files")
} }
# Turn off serial port warnings # Turn off serial port warnings
@ -39,328 +32,287 @@ DEFINES += _TTY_NOWARN_
# MAC OS X # MAC OS X
macx|macx-g++42|macx-g++: { macx|macx-g++42|macx-g++: {
# COMPILER_VERSION = $$system(gcc -v) CONFIG += x86_64 cocoa phonon
#message(Using compiler $$COMPILER_VERSION) CONFIG -= x86
CONFIG += x86_64 cocoa phonon QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
CONFIG -= x86
INCLUDEPATH += -framework SDL
#HARDWARE_PLATFORM = $$system(uname -a)
#contains( $$HARDWARE_PLATFORM, "9.6.0" ) || contains( $$HARDWARE_PLATFORM, "9.7.0" ) || contains( $$HARDWARE_PLATFORM, "9.8.0" ) || contains( $$HARDWARE_PLATFORM, "9.9.0" ) { LIBS += -framework IOKit \
# x86 Mac OS X Leopard 10.5 and earlier -framework SDL \
-framework CoreFoundation \
#message(Building for Mac OS X 32bit/Leopard 10.5 and earlier) -framework ApplicationServices \
-lm
# Enable function-profiling with the OS X saturn tool
#debug { ICON = $$BASEDIR/images/icons/macx.icns
#QMAKE_CXXFLAGS += -finstrument-functions
#LIBS += -lSaturn # Copy contributed files
# CONFIG += console QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
#} # Copy google earth starter file
#} else { QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
# x64 Mac OS X Snow Leopard 10.6 and later # Copy CSS stylesheets
# CONFIG += x86_64 x86 cocoa phonon QMAKE_POST_LINK += && cp -f $$BASEDIR/images/style-mission.css $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/style-indoor.css
#CONFIG -= x86 # phonon QMAKE_POST_LINK += && cp -f $$BASEDIR/images/style-outdoor.css $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
#message(Building for Mac OS X 64bit/Snow Leopard 10.6 and later) # Copy parameter tooltip files
# debug { QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
#QMAKE_CXXFLAGS += -finstrument-functions # Copy libraries
#LIBS += -lSaturn QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/qgroundcontrol.app/Contents/libs
# } QMAKE_POST_LINK += && cp -rf $$BASEDIR/lib/mac64/lib/* $$TARGETDIR/qgroundcontrol.app/Contents/libs
#}
# Fix library paths inside executable
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
#DESTDIR = $$BASEDIR/bin/mac QMAKE_POST_LINK += && install_name_tool -change libosgViewer.dylib "@executable_path/../libs/libosgViewer.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
INCLUDEPATH += -framework SDL QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
LIBS += -framework IOKit \ QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
-framework SDL \ QMAKE_POST_LINK += && install_name_tool -change libosgWidget.dylib "@executable_path/../libs/libosgWidget.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
-framework CoreFoundation \
-framework ApplicationServices \ # Fix library paths within libraries (inter-library dependencies)
-lm
# OSG GA LIBRARY
ICON = $$BASEDIR/images/icons/macx.icns QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib
# Copy contributed files QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/qgroundcontrol.app/Contents/MacOS QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib
# Copy google earth starter file QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/earth.html $$TARGETDIR/qgroundcontrol.app/Contents/MacOS
# Copy CSS stylesheets # OSG DB LIBRARY
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/style-mission.css $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/style-indoor.css QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/style-outdoor.css $$TARGETDIR/qgroundcontrol.app/Contents/MacOS QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib
# Copy parameter tooltip files QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR/qgroundcontrol.app/Contents/MacOS QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib
# Copy libraries
QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/qgroundcontrol.app/Contents/libs # OSG TEXT LIBRARY
QMAKE_POST_LINK += && cp -rf $$BASEDIR/lib/mac64/lib/* $$TARGETDIR/qgroundcontrol.app/Contents/libs QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib
# Fix library paths inside executable QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib
QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgViewer.dylib "@executable_path/../libs/libosgViewer.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol # OSG UTIL LIBRARY
QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgUtil.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgUtil.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgWidget.dylib "@executable_path/../libs/libosgWidget.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/MacOS/qgroundcontrol
# Fix library paths within libraries (inter-library dependencies) # OSG VIEWER LIBRARY
QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
# OSG GA LIBRARY QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgGA.dylib
# OSG WIDGET LIBRARY
# OSG DB LIBRARY QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgDB.dylib QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
# OSG TEXT LIBRARY QMAKE_POST_LINK += && install_name_tool -change libosgViewer.dylib "@executable_path/../libs/libosgViewer.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib # CORE OSG LIBRARY
QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosg.dylib
QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgText.dylib # No check for GLUT.framework since it's a MAC default
message("Building support for OpenSceneGraph")
# OSG UTIL LIBRARY DEPENDENCIES_PRESENT += osg
QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgUtil.dylib DEFINES += QGC_OSG_ENABLED
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgUtil.dylib # Include OpenSceneGraph libraries
INCLUDEPATH += -framework GLUT \
-framework Cocoa \
# OSG VIEWER LIBRARY $$BASEDIR/lib/mac64/include
QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib
QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib LIBS += -framework GLUT \
QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib -framework Cocoa \
QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib -L$$BASEDIR/lib/mac64/lib \
QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib -lOpenThreads \
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgViewer.dylib -losg \
-losgViewer \
# OSG WIDGET LIBRARY -losgGA \
QMAKE_POST_LINK += && install_name_tool -change libosgGA.dylib "@executable_path/../libs/libosgGA.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib -losgDB \
QMAKE_POST_LINK += && install_name_tool -change libosgText.dylib "@executable_path/../libs/libosgText.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib -losgText \
QMAKE_POST_LINK += && install_name_tool -change libosgDB.dylib "@executable_path/../libs/libosgDB.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib -losgWidget
QMAKE_POST_LINK += && install_name_tool -change libosgUtil.dylib "@executable_path/../libs/libosgUtil.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib
QMAKE_POST_LINK += && install_name_tool -change libosg.dylib "@executable_path/../libs/libosg.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib exists(/usr/local/include/google/protobuf) {
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib message("Building support for Protocol Buffers")
QMAKE_POST_LINK += && install_name_tool -change libosgViewer.dylib "@executable_path/../libs/libosgViewer.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosgWidget.dylib DEPENDENCIES_PRESENT += protobuf
# Include Protocol Buffers libraries
# CORE OSG LIBRARY LIBS += -L/usr/local/lib \
QMAKE_POST_LINK += && install_name_tool -change libOpenThreads.dylib "@executable_path/../libs/libOpenThreads.dylib" $$TARGETDIR/qgroundcontrol.app/Contents/libs/libosg.dylib
# Copy model files
#QMAKE_POST_LINK += && cp -f $$BASEDIR/models/*.dae $$TARGETDIR/qgroundcontrol.app/Contents/MacOs
#exists(/Library/Frameworks/osg.framework):exists(/Library/Frameworks/OpenThreads.framework) {
# No check for GLUT.framework since it's a MAC default
message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg
DEFINES += QGC_OSG_ENABLED
# Include OpenSceneGraph libraries
INCLUDEPATH += -framework GLUT \
-framework Cocoa \
$$BASEDIR/lib/mac64/include
LIBS += -framework GLUT \
-framework Cocoa \
-L$$BASEDIR/lib/mac64/lib \
-lOpenThreads \
-losg \
-losgViewer \
-losgGA \
-losgDB \
-losgText \
-losgWidget
#}
exists(/usr/local/include/google/protobuf) {
message("Building support for Protocol Buffers")
DEPENDENCIES_PRESENT += protobuf
# Include Protocol Buffers libraries
LIBS += -L/usr/local/lib \
-lprotobuf \ -lprotobuf \
-lprotobuf-lite \ -lprotobuf-lite \
-lprotoc -lprotoc
DEFINES += QGC_PROTOBUF_ENABLED DEFINES += QGC_PROTOBUF_ENABLED
} }
exists(/opt/local/include/libfreenect)|exists(/usr/local/include/libfreenect) { exists(/opt/local/include/libfreenect)|exists(/usr/local/include/libfreenect) {
message("Building support for libfreenect") message("Building support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect DEPENDENCIES_PRESENT += libfreenect
# Include libfreenect libraries # Include libfreenect libraries
LIBS += -lfreenect LIBS += -lfreenect
DEFINES += QGC_LIBFREENECT_ENABLED DEFINES += QGC_LIBFREENECT_ENABLED
} }
} }
# GNU/Linux # GNU/Linux
linux-g++|linux-g++-64{ linux-g++|linux-g++-64{
CONFIG -= console CONFIG -= console
debug { release {
#CONFIG += debug console DEFINES += QT_NO_DEBUG
} }
release { INCLUDEPATH += /usr/include \
DEFINES += QT_NO_DEBUG /usr/local/include \
#CONFIG -= console /usr/include/qt4/phonon
}
LIBS += \
#QMAKE_POST_LINK += cp -rf $$BASEDIR/audio $$DESTDIR/. -L/usr/lib \
-L/usr/local/lib64 \
INCLUDEPATH += /usr/include \ -lm \
/usr/local/include \ -lflite_cmu_us_kal \
/usr/include/qt4/phonon -lflite_usenglish \
-lflite_cmulex \
LIBS += \ -lflite \
-L/usr/lib \ -lSDL \
-L/usr/local/lib64 \ -lSDLmain
-lm \
-lflite_cmu_us_kal \ exists(/usr/include/osg) | exists(/usr/local/include/osg) {
-lflite_usenglish \ message("Building support for OpenSceneGraph")
-lflite_cmulex \ DEPENDENCIES_PRESENT += osg
-lflite \ # Include OpenSceneGraph libraries
-lSDL \ LIBS += -losg \
-lSDLmain
exists(/usr/include/osg) | exists(/usr/local/include/osg) {
message("Building support for OpenSceneGraph")
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph libraries
LIBS += -losg \
-losgViewer \ -losgViewer \
-losgGA \ -losgGA \
-losgDB \ -losgDB \
-losgText \ -losgText \
-lOpenThreads -lOpenThreads
DEFINES += QGC_OSG_ENABLED DEFINES += QGC_OSG_ENABLED
} }
exists(/usr/include/osg/osgQt) | exists(/usr/include/osgQt) | exists(/usr/include/osg/osgQt) | exists(/usr/include/osgQt) |
exists(/usr/local/include/osg/osgQt) | exists(/usr/local/include/osgQt) { exists(/usr/local/include/osg/osgQt) | exists(/usr/local/include/osgQt) {
message("Building support for OpenSceneGraph Qt") message("Building support for OpenSceneGraph Qt")
# Include OpenSceneGraph Qt libraries # Include OpenSceneGraph Qt libraries
LIBS += -losgQt LIBS += -losgQt
DEFINES += QGC_OSG_QT_ENABLED DEFINES += QGC_OSG_QT_ENABLED
} }
exists(/usr/local/include/google/protobuf) { exists(/usr/local/include/google/protobuf) {
message("Building support for Protocol Buffers") message("Building support for Protocol Buffers")
DEPENDENCIES_PRESENT += protobuf DEPENDENCIES_PRESENT += protobuf
# Include Protocol Buffers libraries # Include Protocol Buffers libraries
LIBS += -lprotobuf \ LIBS += -lprotobuf \
-lprotobuf-lite \ -lprotobuf-lite \
-lprotoc -lprotoc
DEFINES += QGC_PROTOBUF_ENABLED DEFINES += QGC_PROTOBUF_ENABLED
} }
exists(/usr/local/include/libfreenect/libfreenect.h) { exists(/usr/local/include/libfreenect/libfreenect.h) {
message("Building support for libfreenect") message("Building support for libfreenect")
DEPENDENCIES_PRESENT += libfreenect DEPENDENCIES_PRESENT += libfreenect
INCLUDEPATH += /usr/include/libusb-1.0 INCLUDEPATH += /usr/include/libusb-1.0
# Include libfreenect libraries # Include libfreenect libraries
LIBS += -lfreenect LIBS += -lfreenect
DEFINES += QGC_LIBFREENECT_ENABLED DEFINES += QGC_LIBFREENECT_ENABLED
} }
# Validated copy commands # Validated copy commands
!exists($$TARGETDIR){ !exists($$TARGETDIR){
QMAKE_POST_LINK += && mkdir -p $$TARGETDIR QMAKE_POST_LINK += && mkdir -p $$TARGETDIR
} }
DESTDIR = $$TARGETDIR DESTDIR = $$TARGETDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR QMAKE_POST_LINK += && cp -rf $$BASEDIR/files $$TARGETDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$TARGETDIR
QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/images QMAKE_POST_LINK += && mkdir -p $$TARGETDIR/images
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$TARGETDIR/images/Vera.ttf QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$TARGETDIR/images/Vera.ttf
# osg/osgEarth dynamic casts might fail without this compiler option. # osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details. # see http://osgearth.org/wiki/FAQ for details.
QMAKE_CXXFLAGS += -Wl,-E QMAKE_CXXFLAGS += -Wl,-E
} }
linux-g++ { linux-g++ {
message("Building for GNU/Linux 32bit/i386") message("Building for GNU/Linux 32bit/i386")
} }
linux-g++-64 { linux-g++-64 {
message("Building for GNU/Linux 64bit/x64 (g++-64)") message("Building for GNU/Linux 64bit/x64 (g++-64)")
exists(/usr/local/lib64) { exists(/usr/local/lib64) {
LIBS += -L/usr/local/lib64 LIBS += -L/usr/local/lib64
} }
} }
# Windows (32bit) # Windows (32bit), Visual Studio
win32-msvc2008|win32-msvc2010 { win32-msvc2008|win32-msvc2010 {
win32-msvc2008 { win32-msvc2008 {
message(Building for Windows Visual Studio 2008 (32bit)) message(Building for Windows Visual Studio 2008 (32bit))
} }
win32-msvc2010 { win32-msvc2010 {
message(Building for Windows Visual Studio 2010 (32bit)) message(Building for Windows Visual Studio 2010 (32bit))
} }
# QAxContainer support is needed for the Internet Control # QAxContainer support is needed for the Internet Control
# element showing the Google Earth window # element showing the Google Earth window
CONFIG += qaxcontainer CONFIG += qaxcontainer
# The EIGEN library needs this define # The EIGEN library needs this define
# to make the internal min/max functions work # to make the internal min/max functions work
DEFINES += NOMINMAX DEFINES += NOMINMAX
# QWebkit is not needed on MS-Windows compilation environment # QWebkit is not needed on MS-Windows compilation environment
CONFIG -= webkit CONFIG -= webkit
release { # For release builds remove support for various Qt debugging macros.
CONFIG -= console CONFIG(release, debug|release) {
DEFINES += QT_NO_DEBUG DEFINES += QT_NO_DEBUG
} }
debug { # For debug releases we just want the debugging console.
CONFIG(debug, debug|release) {
CONFIG += console CONFIG += console
} }
INCLUDEPATH += $$BASEDIR/lib/sdl/msvc/include \ INCLUDEPATH += $$BASEDIR/lib/sdl/msvc/include \
$$BASEDIR/lib/opal/include \ $$BASEDIR/lib/opal/include \
$$BASEDIR/lib/msinttypes $$BASEDIR/lib/msinttypes
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include"
LIBS += -L$$BASEDIR/lib/sdl/msvc/lib \
LIBS += -L$$BASEDIR/lib/sdl/msvc/lib \ -lSDLmain -lSDL \
-lSDLmain -lSDL \ -lsetupapi
-lsetupapi
exists($$BASEDIR/lib/osg123) {
exists($$BASEDIR/lib/osg123) { message("Building support for OSG")
message("Building support for OSG") DEPENDENCIES_PRESENT += osg
DEPENDENCIES_PRESENT += osg
# Include OpenSceneGraph
# Include OpenSceneGraph INCLUDEPATH += $$BASEDIR/lib/osgEarth/win32/include \
INCLUDEPATH += $$BASEDIR/lib/osgEarth/win32/include \ $$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/include
$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/include LIBS += -L$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib \
LIBS += -L$$BASEDIR/lib/osgEarth_3rdparty/win32/OpenSceneGraph-2.8.2/lib \ -losg \
-losg \ -losgViewer \
-losgViewer \ -losgGA \
-losgGA \ -losgDB \
-losgDB \ -losgText \
-losgText \ -lOpenThreads
-lOpenThreads DEFINES += QGC_OSG_ENABLED
DEFINES += QGC_OSG_ENABLED }
}
RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies RC_FILE = $$BASEDIR/qgroundcontrol.rc
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
# Copy dependencies
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\files" "$$TARGETDIR_WIN\\debug\\files" /E /I $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\files" "$$TARGETDIR_WIN\\debug\\files" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\debug\\models" /E /I $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\debug\\models" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\thirdParty\\libxbee\\lib\\libxbee.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\thirdParty\\libxbee\\lib\\libxbee.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
@ -376,11 +328,11 @@ DEFINES += QGC_OSG_ENABLED
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtWebKitd4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtWebKitd4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtXmld4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtXmld4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtXmlPatternsd4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtXmlPatternsd4.dll" "$$TARGETDIR_WIN\\debug"$$escape_expand(\\n))
} }
CONFIG(release, debug|release) { CONFIG(release, debug|release) {
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\files" "$$TARGETDIR_WIN\\release\\files" /E /I $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\files" "$$TARGETDIR_WIN\\release\\files" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\release\\models" /E /I $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\models" "$$TARGETDIR_WIN\\release\\models" /E /I $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\release\\earth.html" $$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\images\\earth.html" "$$TARGETDIR_WIN\\release\\earth.html" $$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\thirdParty\\libxbee\\lib\\libxbee.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$BASEDIR_WIN\\thirdParty\\libxbee\\lib\\libxbee.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
@ -398,88 +350,84 @@ DEFINES += QGC_OSG_ENABLED
QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtXmlPatterns4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(xcopy /D /Y "$$(QTDIR)\\bin\\QtXmlPatterns4.dll" "$$TARGETDIR_WIN\\release"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(del /F "$$TARGETDIR_WIN\\release\\qgroundcontrol.exp"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(del /F "$$TARGETDIR_WIN\\release\\qgroundcontrol.exp"$$escape_expand(\\n))
QMAKE_POST_LINK += $$quote(del /F "$$TARGETDIR_WIN\\release\\qgroundcontrol.lib"$$escape_expand(\\n)) QMAKE_POST_LINK += $$quote(del /F "$$TARGETDIR_WIN\\release\\qgroundcontrol.lib"$$escape_expand(\\n))
} }
} }
# Windows (32bit) # Windows (32bit)
win32-g++ { win32-g++ {
message(Building for Windows Platform (32bit)) message(Building for Windows Platform (32bit))
# Special settings for debug
CONFIG += CONSOLE
OUTPUT += CONSOLE
# The EIGEN library needs this define # Special settings for debug
# to make the internal min/max functions work CONFIG += CONSOLE
DEFINES += NOMINMAX OUTPUT += CONSOLE
INCLUDEPATH += $$BASEDIR/lib/sdl/include \ # The EIGEN library needs this define
$$BASEDIR/lib/opal/include #\ #\ # to make the internal min/max functions work
#"C:\Program Files\Microsoft SDKs\Windows\v7.0\Include" DEFINES += NOMINMAX
LIBS += -L$$BASEDIR/lib/sdl/win32 \ INCLUDEPATH += $$BASEDIR/lib/sdl/include \
-lmingw32 -lSDLmain -lSDL -mwindows \ $$BASEDIR/lib/opal/include
-lsetupapi
CONFIG += windows LIBS += -L$$BASEDIR/lib/sdl/win32 \
-lmingw32 -lSDLmain -lSDL -mwindows \
-lsetupapi
CONFIG += windows
debug {
#DESTDIR = $$BUILDDIR/debug
CONFIG += console
}
release { debug {
CONFIG -= console CONFIG += console
DEFINES += QT_NO_DEBUG }
#DESTDIR = $$BUILDDIR/release
}
RC_FILE = $$BASEDIR/qgroundcontrol.rc
# Copy dependencies
system(cp): {
# CP command is available, use it instead of copy / xcopy
message("Using cp to copy image and audio files to executable")
debug {
QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/debug/SDL.dll
QMAKE_POST_LINK += && cp -r $$BASEDIR/files $$TARGETDIR/debug/files
QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/debug/models
}
release {
QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/release/SDL.dll
QMAKE_POST_LINK += && cp -r $$BASEDIR/files $$TARGETDIR/release/files
QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/release/models
}
} else {
# No cp command available, go for copy / xcopy
# Copy dependencies
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
exists($$TARGETDIR/debug) { release {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\" CONFIG -= console
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\files\" \"$$TARGETDIR_WIN\\debug\\files\\\" /S /E /Y DEFINES += QT_NO_DEBUG
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\debug\\models\\\" /S /E /Y }
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\debug\\earth.html\"
}
exists($$TARGETDIR/release) { RC_FILE = $$BASEDIR/qgroundcontrol.rc
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\release\\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\files\" \"$$TARGETDIR_WIN\\release\\files\\\" /S /E /Y # Copy dependencies
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\release\\models\\\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\release\\earth.html\" system(cp): {
} # CP command is available, use it instead of copy / xcopy
message("Using cp to copy image and audio files to executable")
debug {
QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/debug/SDL.dll
QMAKE_POST_LINK += && cp -r $$BASEDIR/files $$TARGETDIR/debug/files
QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/debug/models
}
release {
QMAKE_POST_LINK += && cp $$BASEDIR/lib/sdl/win32/SDL.dll $$TARGETDIR/release/SDL.dll
QMAKE_POST_LINK += && cp -r $$BASEDIR/files $$TARGETDIR/release/files
QMAKE_POST_LINK += && cp -r $$BASEDIR/models $$TARGETDIR/release/models
}
} else {
# No cp command available, go for copy / xcopy
# Copy dependencies
BASEDIR_WIN = $$replace(BASEDIR,"/","\\")
TARGETDIR_WIN = $$replace(TARGETDIR,"/","\\")
exists($$TARGETDIR/debug) {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\debug\\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\files\" \"$$TARGETDIR_WIN\\debug\\files\\\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\debug\\models\\\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\debug\\earth.html\"
}
exists($$TARGETDIR/release) {
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\lib\\sdl\\win32\\SDL.dll\" \"$$TARGETDIR_WIN\\release\\SDL.dll\"
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\files\" \"$$TARGETDIR_WIN\\release\\files\\\" /S /E /Y
QMAKE_POST_LINK += && xcopy \"$$BASEDIR_WIN\\models\" \"$$TARGETDIR_WIN\\release\\models\\\" /S /E /Y
QMAKE_POST_LINK += && copy /Y \"$$BASEDIR_WIN\\images\\earth.html\" \"$$TARGETDIR_WIN\\release\\earth.html\"
}
} }
# osg/osgEarth dynamic casts might fail without this compiler option. # osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details. # see http://osgearth.org/wiki/FAQ for details.
QMAKE_CXXFLAGS += -Wl,-E QMAKE_CXXFLAGS += -Wl,-E
} }
# vim:ts=4:sw=4:expandtab

62
qgroundcontrol.pro

@ -20,7 +20,7 @@
# Qt configuration # Qt configuration
CONFIG += qt \ CONFIG += qt \
thread thread
QT += network \ QT += network \
opengl \ opengl \
svg \ svg \
@ -33,14 +33,14 @@ TEMPLATE = app
TARGET = qgroundcontrol TARGET = qgroundcontrol
BASEDIR = $${IN_PWD} BASEDIR = $${IN_PWD}
linux-g++|linux-g++-64{ linux-g++|linux-g++-64{
debug { debug {
TARGETDIR = $${OUT_PWD}/debug TARGETDIR = $${OUT_PWD}/debug
BUILDDIR = $${OUT_PWD}/build-debug BUILDDIR = $${OUT_PWD}/build-debug
} }
release { release {
TARGETDIR = $${OUT_PWD}/release TARGETDIR = $${OUT_PWD}/release
BUILDDIR = $${OUT_PWD}/build-release BUILDDIR = $${OUT_PWD}/build-release
} }
} else { } else {
TARGETDIR = $${OUT_PWD} TARGETDIR = $${OUT_PWD}
BUILDDIR = $${OUT_PWD}/build BUILDDIR = $${OUT_PWD}/build
@ -55,12 +55,12 @@ MAVLINKPATH = $$BASEDIR/thirdParty/mavlink/include
DEFINES += MAVLINK_NO_DATA DEFINES += MAVLINK_NO_DATA
win32 { win32 {
QMAKE_INCDIR_QT = $$(QTDIR)/include QMAKE_INCDIR_QT = $$(QTDIR)/include
QMAKE_LIBDIR_QT = $$(QTDIR)/lib QMAKE_LIBDIR_QT = $$(QTDIR)/lib
QMAKE_UIC = "$$(QTDIR)/bin/uic.exe" QMAKE_UIC = "$$(QTDIR)/bin/uic.exe"
QMAKE_MOC = "$$(QTDIR)/bin/moc.exe" QMAKE_MOC = "$$(QTDIR)/bin/moc.exe"
QMAKE_RCC = "$$(QTDIR)/bin/rcc.exe" QMAKE_RCC = "$$(QTDIR)/bin/rcc.exe"
QMAKE_QMAKE = "$$(QTDIR)/bin/qmake.exe" QMAKE_QMAKE = "$$(QTDIR)/bin/qmake.exe"
} }
@ -391,14 +391,15 @@ contains(DEPENDENCIES_PRESENT, osg) {
src/ui/map3D/Imagery.h \ src/ui/map3D/Imagery.h \
src/ui/map3D/HUDScaleGeode.h \ src/ui/map3D/HUDScaleGeode.h \
src/ui/map3D/WaypointGroupNode.h \ src/ui/map3D/WaypointGroupNode.h \
src/ui/map3D/TerrainParamDialog.h src/ui/map3D/TerrainParamDialog.h
} }
contains(DEPENDENCIES_PRESENT, protobuf):contains(MAVLINK_CONF, pixhawk) { contains(DEPENDENCIES_PRESENT, protobuf):contains(MAVLINK_CONF, pixhawk) {
message("Including headers for Protocol Buffers") message("Including headers for Protocol Buffers")
# Enable only if protobuf is available # Enable only if protobuf is available
HEADERS += thirdParty/mavlink/include/pixhawk/pixhawk.pb.h \ HEADERS += thirdParty/mavlink/include/pixhawk/pixhawk.pb.h \
src/ui/map3D/ObstacleGroupNode.h src/ui/map3D/ObstacleGroupNode.h \
src/ui/map3D/GLOverlayGeode.h
} }
contains(DEPENDENCIES_PRESENT, libfreenect) { contains(DEPENDENCIES_PRESENT, libfreenect) {
message("Including headers for libfreenect") message("Including headers for libfreenect")
@ -534,7 +535,8 @@ contains(DEPENDENCIES_PRESENT, osg) {
src/ui/map3D/Imagery.cc \ src/ui/map3D/Imagery.cc \
src/ui/map3D/HUDScaleGeode.cc \ src/ui/map3D/HUDScaleGeode.cc \
src/ui/map3D/WaypointGroupNode.cc \ src/ui/map3D/WaypointGroupNode.cc \
src/ui/map3D/TerrainParamDialog.cc src/ui/map3D/TerrainParamDialog.cc
contains(DEPENDENCIES_PRESENT, osgearth) { contains(DEPENDENCIES_PRESENT, osgearth) {
message("Including sources for osgEarth") message("Including sources for osgEarth")
@ -547,7 +549,8 @@ contains(DEPENDENCIES_PRESENT, protobuf):contains(MAVLINK_CONF, pixhawk) {
# Enable only if protobuf is available # Enable only if protobuf is available
SOURCES += thirdParty/mavlink/src/pixhawk/pixhawk.pb.cc \ SOURCES += thirdParty/mavlink/src/pixhawk/pixhawk.pb.cc \
src/ui/map3D/ObstacleGroupNode.cc src/ui/map3D/ObstacleGroupNode.cc \
src/ui/map3D/GLOverlayGeode.cc
} }
contains(DEPENDENCIES_PRESENT, libfreenect) { contains(DEPENDENCIES_PRESENT, libfreenect) {
message("Including sources for libfreenect") message("Including sources for libfreenect")
@ -585,19 +588,18 @@ TRANSLATIONS += es-MX.ts \
# xbee support # xbee support
# libxbee only supported by linux and windows systems # libxbee only supported by linux and windows systems
win32-msvc2008|win32-msvc2010|linux{ win32-msvc2008|win32-msvc2010|linux {
HEADERS += src/comm/XbeeLinkInterface.h \ HEADERS += src/comm/XbeeLinkInterface.h \
src/comm/XbeeLink.h \ src/comm/XbeeLink.h \
src/comm/HexSpinBox.h \ src/comm/HexSpinBox.h \
src/ui/XbeeConfigurationWindow.h \ src/ui/XbeeConfigurationWindow.h \
src/comm/CallConv.h src/comm/CallConv.h
SOURCES += src/comm/XbeeLink.cpp \ SOURCES += src/comm/XbeeLink.cpp \
src/comm/HexSpinBox.cpp \ src/comm/HexSpinBox.cpp \
src/ui/XbeeConfigurationWindow.cpp src/ui/XbeeConfigurationWindow.cpp
DEFINES += XBEELINK DEFINES += XBEELINK
INCLUDEPATH += thirdParty/libxbee INCLUDEPATH += thirdParty/libxbee
# TO DO: build library when it does not exists already # TO DO: build library when it does not exist already
LIBS += -LthirdParty/libxbee/lib \ LIBS += -LthirdParty/libxbee/lib \
-llibxbee -llibxbee
}
}

45
src/uas/UAS.cc

@ -79,10 +79,11 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
yaw(0.0), yaw(0.0),
statusTimeout(new QTimer(this)), statusTimeout(new QTimer(this)),
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES) #if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
receivedPointCloudTimestamp(0.0), receivedOverlayTimestamp(0.0),
receivedRGBDImageTimestamp(0.0),
receivedObstacleListTimestamp(0.0), receivedObstacleListTimestamp(0.0),
receivedPathTimestamp(0.0), receivedPathTimestamp(0.0),
receivedPointCloudTimestamp(0.0),
receivedRGBDImageTimestamp(0.0),
#endif #endif
paramsOnceRequested(false), paramsOnceRequested(false),
airframe(QGC_AIRFRAME_EASYSTAR), airframe(QGC_AIRFRAME_EASYSTAR),
@ -1146,21 +1147,13 @@ void UAS::receiveExtendedMessage(LinkInterface* link, std::tr1::shared_ptr<googl
} }
#ifdef QGC_USE_PIXHAWK_MESSAGES #ifdef QGC_USE_PIXHAWK_MESSAGES
if (message->GetTypeName() == pointCloud.GetTypeName()) if (message->GetTypeName() == overlay.GetTypeName())
{ {
receivedPointCloudTimestamp = QGC::groundTimeSeconds(); receivedOverlayTimestamp = QGC::groundTimeSeconds();
pointCloudMutex.lock(); overlayMutex.lock();
pointCloud.CopyFrom(*message); overlay.CopyFrom(*message);
pointCloudMutex.unlock(); overlayMutex.unlock();
emit pointCloudChanged(this); emit overlayChanged(this);
}
else if (message->GetTypeName() == rgbdImage.GetTypeName())
{
receivedRGBDImageTimestamp = QGC::groundTimeSeconds();
rgbdImageMutex.lock();
rgbdImage.CopyFrom(*message);
rgbdImageMutex.unlock();
emit rgbdImageChanged(this);
} }
else if (message->GetTypeName() == obstacleList.GetTypeName()) else if (message->GetTypeName() == obstacleList.GetTypeName())
{ {
@ -1178,6 +1171,22 @@ void UAS::receiveExtendedMessage(LinkInterface* link, std::tr1::shared_ptr<googl
pathMutex.unlock(); pathMutex.unlock();
emit pathChanged(this); emit pathChanged(this);
} }
else if (message->GetTypeName() == pointCloud.GetTypeName())
{
receivedPointCloudTimestamp = QGC::groundTimeSeconds();
pointCloudMutex.lock();
pointCloud.CopyFrom(*message);
pointCloudMutex.unlock();
emit pointCloudChanged(this);
}
else if (message->GetTypeName() == rgbdImage.GetTypeName())
{
receivedRGBDImageTimestamp = QGC::groundTimeSeconds();
rgbdImageMutex.lock();
rgbdImage.CopyFrom(*message);
rgbdImageMutex.unlock();
emit rgbdImageChanged(this);
}
#endif #endif
} }
@ -2350,9 +2359,7 @@ void UAS::shutdown()
void UAS::setTargetPosition(float x, float y, float z, float yaw) void UAS::setTargetPosition(float x, float y, float z, float yaw)
{ {
mavlink_message_t msg; mavlink_message_t msg;
mavlink_msg_command_long_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, uasId, MAV_COMP_ID_ALL, MAV_CMD_NAV_PATHPLANNING, 1, 1, 0, 0, yaw, x, y, z); mavlink_msg_command_long_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, uasId, MAV_COMP_ID_ALL, MAV_CMD_NAV_PATHPLANNING, 1, 1, 1, 0, yaw, x, y, z);
sendMessage(msg);
mavlink_msg_command_long_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, uasId, MAV_COMP_ID_ALL, MAV_CMD_NAV_PATHPLANNING, 1, 0, 1, 0, yaw, x, y, z);
sendMessage(msg); sendMessage(msg);
} }

75
src/uas/UAS.h

@ -137,26 +137,15 @@ public:
bool getSelected() const; bool getSelected() const;
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES) #if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
px::PointCloudXYZRGB getPointCloud() { px::GLOverlay getOverlay() {
QMutexLocker locker(&pointCloudMutex); QMutexLocker locker(&overlayMutex);
return pointCloud; return overlay;
} }
px::PointCloudXYZRGB getPointCloud(qreal& receivedTimestamp) { px::GLOverlay getOverlay(qreal& receivedTimestamp) {
receivedTimestamp = receivedPointCloudTimestamp; receivedTimestamp = receivedOverlayTimestamp;
QMutexLocker locker(&pointCloudMutex); QMutexLocker locker(&overlayMutex);
return pointCloud; return overlay;
}
px::RGBDImage getRGBDImage() {
QMutexLocker locker(&rgbdImageMutex);
return rgbdImage;
}
px::RGBDImage getRGBDImage(qreal& receivedTimestamp) {
receivedTimestamp = receivedRGBDImageTimestamp;
QMutexLocker locker(&rgbdImageMutex);
return rgbdImage;
} }
px::ObstacleList getObstacleList() { px::ObstacleList getObstacleList() {
@ -180,6 +169,28 @@ public:
QMutexLocker locker(&pathMutex); QMutexLocker locker(&pathMutex);
return path; return path;
} }
px::PointCloudXYZRGB getPointCloud() {
QMutexLocker locker(&pointCloudMutex);
return pointCloud;
}
px::PointCloudXYZRGB getPointCloud(qreal& receivedTimestamp) {
receivedTimestamp = receivedPointCloudTimestamp;
QMutexLocker locker(&pointCloudMutex);
return pointCloud;
}
px::RGBDImage getRGBDImage() {
QMutexLocker locker(&rgbdImageMutex);
return rgbdImage;
}
px::RGBDImage getRGBDImage(qreal& receivedTimestamp) {
receivedTimestamp = receivedRGBDImageTimestamp;
QMutexLocker locker(&rgbdImageMutex);
return rgbdImage;
}
#endif #endif
friend class UASWaypointManager; friend class UASWaypointManager;
@ -270,13 +281,9 @@ protected: //COMMENTS FOR TEST UNIT
quint64 imageStart; quint64 imageStart;
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES) #if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
px::PointCloudXYZRGB pointCloud; px::GLOverlay overlay;
QMutex pointCloudMutex; QMutex overlayMutex;
qreal receivedPointCloudTimestamp; qreal receivedOverlayTimestamp;
px::RGBDImage rgbdImage;
QMutex rgbdImageMutex;
qreal receivedRGBDImageTimestamp;
px::ObstacleList obstacleList; px::ObstacleList obstacleList;
QMutex obstacleListMutex; QMutex obstacleListMutex;
@ -285,6 +292,14 @@ protected: //COMMENTS FOR TEST UNIT
px::Path path; px::Path path;
QMutex pathMutex; QMutex pathMutex;
qreal receivedPathTimestamp; qreal receivedPathTimestamp;
px::PointCloudXYZRGB pointCloud;
QMutex pointCloudMutex;
qreal receivedPointCloudTimestamp;
px::RGBDImage rgbdImage;
QMutex rgbdImageMutex;
qreal receivedRGBDImageTimestamp;
#endif #endif
QMap<int, QMap<QString, QVariant>* > parameters; ///< All parameters QMap<int, QMap<QString, QVariant>* > parameters; ///< All parameters
@ -616,16 +631,6 @@ signals:
void imageStarted(quint64 timestamp); void imageStarted(quint64 timestamp);
/** @brief A new camera image has arrived */ /** @brief A new camera image has arrived */
void imageReady(UASInterface* uas); void imageReady(UASInterface* uas);
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
/** @brief Point cloud data has been changed */
void pointCloudChanged(UASInterface* uas);
/** @brief RGBD image data has been changed */
void rgbdImageChanged(UASInterface* uas);
/** @brief Obstacle list data has been changed */
void obstacleListChanged(UASInterface* uas);
/** @brief Path data has been changed */
void pathChanged(UASInterface* uas);
#endif
/** @brief HIL controls have changed */ /** @brief HIL controls have changed */
void hilControlsChanged(uint64_t time, float rollAilerons, float pitchElevator, float yawRudder, float throttle, uint8_t systemMode, uint8_t navMode); void hilControlsChanged(uint64_t time, float rollAilerons, float pitchElevator, float yawRudder, float throttle, uint8_t systemMode, uint8_t navMode);

23
src/uas/UASInterface.h

@ -97,14 +97,16 @@ public:
virtual bool getSelected() const = 0; virtual bool getSelected() const = 0;
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES) #if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
virtual px::PointCloudXYZRGB getPointCloud() = 0; virtual px::GLOverlay getOverlay() = 0;
virtual px::PointCloudXYZRGB getPointCloud(qreal& receivedTimestamp) = 0; virtual px::GLOverlay getOverlay(qreal& receivedTimestamp) = 0;
virtual px::RGBDImage getRGBDImage() = 0;
virtual px::RGBDImage getRGBDImage(qreal& receivedTimestamp) = 0;
virtual px::ObstacleList getObstacleList() = 0; virtual px::ObstacleList getObstacleList() = 0;
virtual px::ObstacleList getObstacleList(qreal& receivedTimestamp) = 0; virtual px::ObstacleList getObstacleList(qreal& receivedTimestamp) = 0;
virtual px::Path getPath() = 0; virtual px::Path getPath() = 0;
virtual px::Path getPath(qreal& receivedTimestamp) = 0; virtual px::Path getPath(qreal& receivedTimestamp) = 0;
virtual px::PointCloudXYZRGB getPointCloud() = 0;
virtual px::PointCloudXYZRGB getPointCloud(qreal& receivedTimestamp) = 0;
virtual px::RGBDImage getRGBDImage() = 0;
virtual px::RGBDImage getRGBDImage(qreal& receivedTimestamp) = 0;
#endif #endif
virtual bool isArmed() const = 0; virtual bool isArmed() const = 0;
@ -489,6 +491,19 @@ signals:
/** @brief Radio Calibration Data has been received from the MAV*/ /** @brief Radio Calibration Data has been received from the MAV*/
void radioCalibrationReceived(const QPointer<RadioCalibrationData>&); void radioCalibrationReceived(const QPointer<RadioCalibrationData>&);
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
/** @brief Overlay data has been changed */
void overlayChanged(UASInterface* uas);
/** @brief Obstacle list data has been changed */
void obstacleListChanged(UASInterface* uas);
/** @brief Path data has been changed */
void pathChanged(UASInterface* uas);
/** @brief Point cloud data has been changed */
void pointCloudChanged(UASInterface* uas);
/** @brief RGBD image data has been changed */
void rgbdImageChanged(UASInterface* uas);
#endif
/** /**
* @brief Localization quality changed * @brief Localization quality changed
* @param fix 0: lost, 1: 2D local position hold, 2: 2D localization, 3: 3D localization * @param fix 0: lost, 1: 2D local position hold, 2: 2D localization, 3: 3D localization

427
src/ui/map3D/GLOverlayGeode.cc

@ -0,0 +1,427 @@
#include "GLOverlayGeode.h"
GLOverlayGeode::GLOverlayGeode()
: mDrawable(new GLOverlayDrawable)
, mMessageTimestamp(0.0)
{
addDrawable(mDrawable);
}
void
GLOverlayGeode::setOverlay(px::GLOverlay &overlay)
{
mDrawable->setOverlay(overlay);
mCoordinateFrameType = overlay.coordinateframetype();
dirtyBound();
}
px::GLOverlay::CoordinateFrameType
GLOverlayGeode::coordinateFrameType(void) const
{
return mCoordinateFrameType;
}
void
GLOverlayGeode::setMessageTimestamp(qreal timestamp)
{
mMessageTimestamp = timestamp;
}
qreal
GLOverlayGeode::messageTimestamp(void) const
{
return mMessageTimestamp;
}
GLOverlayGeode::GLOverlayDrawable::GLOverlayDrawable()
{
setUseDisplayList(true);
}
GLOverlayGeode::GLOverlayDrawable::GLOverlayDrawable(const GLOverlayDrawable& drawable,
const osg::CopyOp& copyop)
: osg::Drawable(drawable,copyop)
{
setUseDisplayList(true);
}
void
GLOverlayGeode::GLOverlayDrawable::setOverlay(px::GLOverlay &overlay)
{
if (!overlay.IsInitialized())
{
return;
}
mOverlay = overlay;
mBBox.init();
const std::string& data = mOverlay.data();
for (size_t i = 0; i < data.size(); ++i)
{
switch (data.at(i)) {
case px::GLOverlay::POINTS:
break;
case px::GLOverlay::LINES:
break;
case px::GLOverlay::LINE_STRIP:
break;
case px::GLOverlay::LINE_LOOP:
break;
case px::GLOverlay::TRIANGLES:
break;
case px::GLOverlay::TRIANGLE_STRIP:
break;
case px::GLOverlay::TRIANGLE_FAN:
break;
case px::GLOverlay::QUADS:
break;
case px::GLOverlay::QUAD_STRIP:
break;
case px::GLOverlay::POLYGON:
break;
case px::GLOverlay::WIRE_CIRCLE:
i += sizeof(float) * 4;
break;
case px::GLOverlay::SOLID_CIRCLE:
i += sizeof(float) * 4;
break;
case px::GLOverlay::SOLID_CUBE:
i += sizeof(float) * 5;
break;
case px::GLOverlay::WIRE_CUBE:
i += sizeof(float) * 5;
break;
case px::GLOverlay::END:
break;
case px::GLOverlay::VERTEX2F:
i += sizeof(float) * 2;
break;
case px::GLOverlay::VERTEX3F:
{
float x = getFloatValue(data, i);
float y = getFloatValue(data, i);
float z = getFloatValue(data, i);
mBBox.expandBy(x, y, z);
}
break;
case px::GLOverlay::ROTATEF:
i += sizeof(float) * 4;
break;
case px::GLOverlay::TRANSLATEF:
i += sizeof(float) * 3;
break;
case px::GLOverlay::SCALEF:
i += sizeof(float) * 3;
break;
case px::GLOverlay::PUSH_MATRIX:
break;
case px::GLOverlay::POP_MATRIX:
break;
case px::GLOverlay::COLOR3F:
i += sizeof(float) * 3;
break;
case px::GLOverlay::COLOR4F:
i += sizeof(float) * 4;
break;
case px::GLOverlay::POINTSIZE:
i += sizeof(float);
break;
case px::GLOverlay::LINEWIDTH:
i += sizeof(float);
break;
}
}
dirtyDisplayList();
}
void
GLOverlayGeode::GLOverlayDrawable::drawImplementation(osg::RenderInfo&) const
{
if (!mOverlay.IsInitialized())
{
return;
}
glPushMatrix();
glScalef(-1.0f, 1.0f, 1.0f);
glRotatef(90.0f, 0.0f, 0.0f, 1.0f);
const std::string& data = mOverlay.data();
for (size_t i = 0; i < data.size(); ++i)
{
switch (data.at(i)) {
case px::GLOverlay::POINTS:
glBegin(GL_POINTS);
break;
case px::GLOverlay::LINES:
glBegin(GL_LINES);
break;
case px::GLOverlay::LINE_STRIP:
glBegin(GL_LINE_STRIP);
break;
case px::GLOverlay::LINE_LOOP:
glBegin(GL_LINE_LOOP);
break;
case px::GLOverlay::TRIANGLES:
glBegin(GL_TRIANGLES);
break;
case px::GLOverlay::TRIANGLE_STRIP:
glBegin(GL_TRIANGLE_STRIP);
break;
case px::GLOverlay::TRIANGLE_FAN:
glBegin(GL_TRIANGLE_FAN);
break;
case px::GLOverlay::QUADS:
glBegin(GL_QUADS);
break;
case px::GLOverlay::QUAD_STRIP:
glBegin(GL_QUAD_STRIP);
break;
case px::GLOverlay::POLYGON:
glBegin(GL_POLYGON);
break;
case px::GLOverlay::WIRE_CIRCLE:
{
float x = getFloatValue(data, i);
float y = getFloatValue(data, i);
float z = getFloatValue(data, i);
float r = getFloatValue(data, i);
glBegin(GL_LINE_LOOP);
for (int i = 0; i < 20; i++)
{
float angle = i / 20.0f * M_PI * 2.0f;
glVertex3f(x + r * cosf(angle), y + r * sinf(angle), z);
}
glEnd();
}
break;
case px::GLOverlay::SOLID_CIRCLE:
{
float x = getFloatValue(data, i);
float y = getFloatValue(data, i);
float z = getFloatValue(data, i);
float r = getFloatValue(data, i);
glBegin(GL_POLYGON);
for (int i = 0; i < 20; i++)
{
float angle = i / 20.0f * M_PI * 2.0f;
glVertex3f(x + r * cosf(angle), y + r * sinf(angle), z);
}
glEnd();
}
break;
case px::GLOverlay::SOLID_CUBE:
{
float x = getFloatValue(data, i);
float y = getFloatValue(data, i);
float z = getFloatValue(data, i);
float w = getFloatValue(data, i);
float h = getFloatValue(data, i);
float w_2 = w / 2.0f;
float h_2 = h / 2.0f;
glBegin(GL_QUADS);
// face 1
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(x + w_2, y - w_2, z + h_2);
glVertex3f(x + w_2, y - w_2, z - h_2);
glVertex3f(x + w_2, y + w_2, z - h_2);
glVertex3f(x + w_2, y + w_2, z + h_2);
// face 2
glNormal3f(0.0f, 1.0f, 0.0f);
glVertex3f(x + w_2, y + w_2, z + h_2);
glVertex3f(x + w_2, y + w_2, z - h_2);
glVertex3f(x - w_2, y + w_2, z - h_2);
glVertex3f(x - w_2, y + w_2, z + h_2);
// face 3
glNormal3f(0.0f, 0.0f, 1.0f);
glVertex3f(x + w_2, y + w_2, z + h_2);
glVertex3f(x - w_2, y + w_2, z + h_2);
glVertex3f(x - w_2, y - w_2, z + h_2);
glVertex3f(x + w_2, y - w_2, z + h_2);
// face 4
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(x - w_2, y - w_2, z + h_2);
glVertex3f(x - w_2, y + w_2, z + h_2);
glVertex3f(x - w_2, y + w_2, z - h_2);
glVertex3f(x - w_2, y - w_2, z - h_2);
// face 5
glNormal3f(0.0f, -1.0f, 0.0f);
glVertex3f(x - w_2, y - w_2, z + h_2);
glVertex3f(x - w_2, y - w_2, z - h_2);
glVertex3f(x + w_2, y - w_2, z - h_2);
glVertex3f(x + w_2, y - w_2, z + h_2);
// face 6
glNormal3f(0.0f, 0.0f, -1.0f);
glVertex3f(x - w_2, y - w_2, z - h_2);
glVertex3f(x - w_2, y + w_2, z - h_2);
glVertex3f(x + w_2, y + w_2, z - h_2);
glVertex3f(x + w_2, y - w_2, z - h_2);
glEnd();
}
break;
case px::GLOverlay::WIRE_CUBE:
{
float x = getFloatValue(data, i);
float y = getFloatValue(data, i);
float z = getFloatValue(data, i);
float w = getFloatValue(data, i);
float h = getFloatValue(data, i);
float w_2 = w / 2.0f;
float h_2 = h / 2.0f;
// face 1
glBegin(GL_LINE_LOOP);
glVertex3f(x + w_2, y - w_2, z + h_2);
glVertex3f(x + w_2, y - w_2, z - h_2);
glVertex3f(x + w_2, y + w_2, z - h_2);
glVertex3f(x + w_2, y + w_2, z + h_2);
glEnd();
// face 2
glBegin(GL_LINE_LOOP);
glVertex3f(x + w_2, y + w_2, z + h_2);
glVertex3f(x + w_2, y + w_2, z - h_2);
glVertex3f(x - w_2, y + w_2, z - h_2);
glVertex3f(x - w_2, y + w_2, z + h_2);
glEnd();
// face 3
glBegin(GL_LINE_LOOP);
glVertex3f(x + w_2, y + w_2, z + h_2);
glVertex3f(x - w_2, y + w_2, z + h_2);
glVertex3f(x - w_2, y - w_2, z + h_2);
glVertex3f(x + w_2, y - w_2, z + h_2);
glEnd();
// face 4
glBegin(GL_LINE_LOOP);
glVertex3f(x - w_2, y - w_2, z + h_2);
glVertex3f(x - w_2, y + w_2, z + h_2);
glVertex3f(x - w_2, y + w_2, z - h_2);
glVertex3f(x - w_2, y - w_2, z - h_2);
glEnd();
// face 5
glBegin(GL_LINE_LOOP);
glVertex3f(x - w_2, y - w_2, z + h_2);
glVertex3f(x - w_2, y - w_2, z - h_2);
glVertex3f(x + w_2, y - w_2, z - h_2);
glVertex3f(x + w_2, y - w_2, z + h_2);
glEnd();
// face 6
glBegin(GL_LINE_LOOP);
glVertex3f(x - w_2, y - w_2, z - h_2);
glVertex3f(x - w_2, y + w_2, z - h_2);
glVertex3f(x + w_2, y + w_2, z - h_2);
glVertex3f(x + w_2, y - w_2, z - h_2);
glEnd();
}
break;
case px::GLOverlay::END:
glEnd();
break;
case px::GLOverlay::VERTEX2F:
{
float x = getFloatValue(data, i);
float y = getFloatValue(data, i);
glVertex2f(x, y);
}
break;
case px::GLOverlay::VERTEX3F:
{
float x = getFloatValue(data, i);
float y = getFloatValue(data, i);
float z = getFloatValue(data, i);
glVertex3f(x, y, z);
}
break;
case px::GLOverlay::ROTATEF:
{
float angle = getFloatValue(data, i);
float x = getFloatValue(data, i);
float y = getFloatValue(data, i);
float z = getFloatValue(data, i);
glRotatef(angle, x, y, z);
}
break;
case px::GLOverlay::TRANSLATEF:
{
float x = getFloatValue(data, i);
float y = getFloatValue(data, i);
float z = getFloatValue(data, i);
glTranslatef(x, y, z);
}
break;
case px::GLOverlay::SCALEF:
{
float x = getFloatValue(data, i);
float y = getFloatValue(data, i);
float z = getFloatValue(data, i);
glScalef(x, y, z);
}
break;
case px::GLOverlay::PUSH_MATRIX:
glPushMatrix();
break;
case px::GLOverlay::POP_MATRIX:
glPopMatrix();
break;
case px::GLOverlay::COLOR3F:
{
float red = getFloatValue(data, i);
float green = getFloatValue(data, i);
float blue = getFloatValue(data, i);
glColor3f(red, green, blue);
}
break;
case px::GLOverlay::COLOR4F:
{
float red = getFloatValue(data, i);
float green = getFloatValue(data, i);
float blue = getFloatValue(data, i);
float alpha = getFloatValue(data, i);
glColor4f(red, green, blue, alpha);
}
break;
case px::GLOverlay::POINTSIZE:
glPointSize(getFloatValue(data, i));
break;
case px::GLOverlay::LINEWIDTH:
glLineWidth(getFloatValue(data, i));
break;
}
}
glPopMatrix();
}
osg::BoundingBox
GLOverlayGeode::GLOverlayDrawable::computeBound() const
{
return mBBox;
}
float
GLOverlayGeode::GLOverlayDrawable::getFloatValue(const std::string& data,
size_t& mark) const
{
char temp[4];
for (int i = 0; i < 4; ++i)
{
++mark;
temp[i] = data.at(mark);
}
char *cp = &(temp[0]);
float *fp = reinterpret_cast<float *>(cp);
return *fp;
}

49
src/ui/map3D/GLOverlayGeode.h

@ -0,0 +1,49 @@
#ifndef GLOVERLAYGEODE_H
#define GLOVERLAYGEODE_H
#include <mavlink_protobuf_manager.hpp>
#include <osg/Geode>
#include <QtGlobal>
class GLOverlayGeode : public osg::Geode
{
public:
GLOverlayGeode();
void setOverlay(px::GLOverlay& overlay);
px::GLOverlay::CoordinateFrameType coordinateFrameType(void) const;
void setMessageTimestamp(qreal timestamp);
qreal messageTimestamp(void) const;
private:
class GLOverlayDrawable : public osg::Drawable
{
public:
GLOverlayDrawable();
GLOverlayDrawable(const GLOverlayDrawable& drawable,
const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
void setOverlay(px::GLOverlay& overlay);
META_Object(GLOverlayDrawableApp, GLOverlayDrawable)
virtual void drawImplementation(osg::RenderInfo&) const;
virtual osg::BoundingBox computeBound() const;
private:
float getFloatValue(const std::string& data, size_t& mark) const;
px::GLOverlay mOverlay;
osg::BoundingBox mBBox;
};
osg::ref_ptr<GLOverlayDrawable> mDrawable;
px::GLOverlay::CoordinateFrameType mCoordinateFrameType;
qreal mMessageTimestamp;
};
#endif // GLOVERLAYGEODE_H

65
src/ui/map3D/Pixhawk3DWidget.cc

@ -139,6 +139,10 @@ Pixhawk3DWidget::systemCreated(UASInterface *uas)
this, SLOT(attitudeChanged(UASInterface*,double,double,double,quint64))); this, SLOT(attitudeChanged(UASInterface*,double,double,double,quint64)));
connect(uas, SIGNAL(userPositionSetPointsChanged(int,float,float,float,float)), connect(uas, SIGNAL(userPositionSetPointsChanged(int,float,float,float,float)),
this, SLOT(setpointChanged(int,float,float,float,float))); this, SLOT(setpointChanged(int,float,float,float,float)));
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
connect(uas, SIGNAL(overlayChanged(UASInterface*)),
this, SLOT(addOverlay(UASInterface*)));
#endif
initializeSystem(systemId, uas->getColor()); initializeSystem(systemId, uas->getColor());
@ -546,6 +550,43 @@ Pixhawk3DWidget::loadTerrainModel(void)
} }
} }
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
void
Pixhawk3DWidget::addOverlay(UASInterface *uas)
{
int systemId = uas->getUASID();
if (!mSystemContainerMap.contains(systemId))
{
return;
}
SystemContainer& systemData = mSystemContainerMap[systemId];
qreal receivedTimestamp;
px::GLOverlay overlay = uas->getOverlay(receivedTimestamp);
QString overlayName = QString::fromStdString(overlay.name());
osg::ref_ptr<SystemGroupNode>& systemNode = m3DWidget->systemGroup(systemId);
if (!systemData.overlayNodeMap().contains(overlayName))
{
osg::ref_ptr<GLOverlayGeode> overlayNode = new GLOverlayGeode;
systemData.overlayNodeMap().insert(overlayName, overlayNode);
systemNode->allocentricMap()->addChild(overlayNode, false);
systemNode->rollingMap()->addChild(overlayNode, false);
emit overlayCreatedSignal(systemId, overlayName);
}
osg::ref_ptr<GLOverlayGeode>& overlayNode = systemData.overlayNodeMap()[overlayName];
overlayNode->setOverlay(overlay);
overlayNode->setMessageTimestamp(receivedTimestamp);
}
#endif
void void
Pixhawk3DWidget::selectTargetHeading(void) Pixhawk3DWidget::selectTargetHeading(void)
{ {
@ -904,6 +945,30 @@ Pixhawk3DWidget::update(void)
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES) #if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
rollingMap->setChildValue(systemData.obstacleGroupNode(), rollingMap->setChildValue(systemData.obstacleGroupNode(),
systemViewParams->displayObstacleList()); systemViewParams->displayObstacleList());
QMutableMapIterator<QString, osg::ref_ptr<GLOverlayGeode> > itOverlay(systemData.overlayNodeMap());
while (itOverlay.hasNext())
{
itOverlay.next();
osg::ref_ptr<GLOverlayGeode>& overlayNode = itOverlay.value();
bool displayOverlay = systemViewParams->displayOverlay().value(itOverlay.key());
bool visible;
visible = (overlayNode->coordinateFrameType() == px::GLOverlay::GLOBAL) &&
displayOverlay &&
(QGC::groundTimeSeconds() - overlayNode->messageTimestamp() < kMessageTimeout);
allocentricMap->setChildValue(overlayNode, visible);
visible = (overlayNode->coordinateFrameType() == px::GLOverlay::LOCAL) &&
displayOverlay &&
(QGC::groundTimeSeconds() - overlayNode->messageTimestamp() < kMessageTimeout);;
rollingMap->setChildValue(overlayNode, visible);
}
rollingMap->setChildValue(systemData.plannedPathNode(), rollingMap->setChildValue(systemData.plannedPathNode(),
systemViewParams->displayPlannedPath()); systemViewParams->displayPlannedPath());

5
src/ui/map3D/Pixhawk3DWidget.h

@ -64,6 +64,7 @@ public slots:
signals: signals:
void systemCreatedSignal(UASInterface* uas); void systemCreatedSignal(UASInterface* uas);
void overlayCreatedSignal(int systemId, const QString& name);
private slots: private slots:
void clearData(void); void clearData(void);
@ -75,6 +76,10 @@ private slots:
void setBirdEyeView(void); void setBirdEyeView(void);
void loadTerrainModel(void); void loadTerrainModel(void);
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
void addOverlay(UASInterface* uas);
#endif
void selectTargetHeading(void); void selectTargetHeading(void);
void selectTarget(void); void selectTarget(void);
void setTarget(void); void setTarget(void);

6
src/ui/map3D/SystemContainer.cc

@ -99,6 +99,12 @@ SystemContainer::obstacleGroupNode(void)
return mObstacleGroupNode; return mObstacleGroupNode;
} }
QMap<QString,osg::ref_ptr<GLOverlayGeode> >&
SystemContainer::overlayNodeMap(void)
{
return mOverlayNodeMap;
}
osg::ref_ptr<osg::Geode>& osg::ref_ptr<osg::Geode>&
SystemContainer::plannedPathNode(void) SystemContainer::plannedPathNode(void)
{ {

3
src/ui/map3D/SystemContainer.h

@ -10,6 +10,7 @@
#include "WaypointGroupNode.h" #include "WaypointGroupNode.h"
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES) #if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
#include "GLOverlayGeode.h"
#include "ObstacleGroupNode.h" #include "ObstacleGroupNode.h"
#endif #endif
@ -37,6 +38,7 @@ public:
osg::ref_ptr<WaypointGroupNode>& waypointGroupNode(void); osg::ref_ptr<WaypointGroupNode>& waypointGroupNode(void);
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES) #if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
osg::ref_ptr<ObstacleGroupNode>& obstacleGroupNode(void); osg::ref_ptr<ObstacleGroupNode>& obstacleGroupNode(void);
QMap<QString,osg::ref_ptr<GLOverlayGeode> >& overlayNodeMap(void);
osg::ref_ptr<osg::Geode>& plannedPathNode(void); osg::ref_ptr<osg::Geode>& plannedPathNode(void);
#endif #endif
@ -62,6 +64,7 @@ private:
osg::ref_ptr<WaypointGroupNode> mWaypointGroupNode; osg::ref_ptr<WaypointGroupNode> mWaypointGroupNode;
#if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES) #if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES)
osg::ref_ptr<ObstacleGroupNode> mObstacleGroupNode; osg::ref_ptr<ObstacleGroupNode> mObstacleGroupNode;
QMap<QString,osg::ref_ptr<GLOverlayGeode> > mOverlayNodeMap;
osg::ref_ptr<osg::Geode> mPlannedPathNode; osg::ref_ptr<osg::Geode> mPlannedPathNode;
#endif #endif
}; };

23
src/ui/map3D/SystemViewParams.cc

@ -54,6 +54,18 @@ SystemViewParams::displayObstacleList(void) const
return mDisplayObstacleList; return mDisplayObstacleList;
} }
QMap<QString,bool>&
SystemViewParams::displayOverlay(void)
{
return mDisplayOverlay;
}
QMap<QString,bool>
SystemViewParams::displayOverlay(void) const
{
return mDisplayOverlay;
}
bool& bool&
SystemViewParams::displayPlannedPath(void) SystemViewParams::displayPlannedPath(void)
{ {
@ -228,6 +240,17 @@ SystemViewParams::toggleObstacleList(int state)
} }
void void
SystemViewParams::toggleOverlay(const QString& name)
{
if (!mDisplayOverlay.contains(name))
{
return;
}
mDisplayOverlay[name] = !mDisplayOverlay[name];
}
void
SystemViewParams::togglePlannedPath(int state) SystemViewParams::togglePlannedPath(int state)
{ {
if (state == Qt::Checked) if (state == Qt::Checked)

6
src/ui/map3D/SystemViewParams.h

@ -1,6 +1,7 @@
#ifndef SYSTEMVIEWPARAMS_H #ifndef SYSTEMVIEWPARAMS_H
#define SYSTEMVIEWPARAMS_H #define SYSTEMVIEWPARAMS_H
#include <QMap>
#include <QObject> #include <QObject>
#include <QSharedPointer> #include <QSharedPointer>
#include <QVector> #include <QVector>
@ -21,6 +22,9 @@ public:
bool& displayObstacleList(void); bool& displayObstacleList(void);
bool displayObstacleList(void) const; bool displayObstacleList(void) const;
QMap<QString,bool>& displayOverlay(void);
QMap<QString,bool> displayOverlay(void) const;
bool& displayPlannedPath(void); bool& displayPlannedPath(void);
bool displayPlannedPath(void) const; bool displayPlannedPath(void) const;
@ -57,6 +61,7 @@ public slots:
void toggleColorPointCloud(int state); void toggleColorPointCloud(int state);
void toggleLocalGrid(int state); void toggleLocalGrid(int state);
void toggleObstacleList(int state); void toggleObstacleList(int state);
void toggleOverlay(const QString& name);
void togglePlannedPath(int state); void togglePlannedPath(int state);
void togglePointCloud(int state); void togglePointCloud(int state);
void toggleRGBD(int state); void toggleRGBD(int state);
@ -74,6 +79,7 @@ private:
bool mColorPointCloudByDistance; bool mColorPointCloudByDistance;
bool mDisplayLocalGrid; bool mDisplayLocalGrid;
bool mDisplayObstacleList; bool mDisplayObstacleList;
QMap<QString,bool> mDisplayOverlay;
bool mDisplayPlannedPath; bool mDisplayPlannedPath;
bool mDisplayPointCloud; bool mDisplayPointCloud;
bool mDisplayRGBD; bool mDisplayRGBD;

34
src/ui/map3D/ViewParamWidget.cc

@ -2,7 +2,7 @@
#include <osg/LineWidth> #include <osg/LineWidth>
#include <QCheckBox> #include <QCheckBox>
#include <QFormLayout> #include <QGroupBox>
#include <QLabel> #include <QLabel>
#include <QPushButton> #include <QPushButton>
@ -28,8 +28,13 @@ ViewParamWidget::ViewParamWidget(GlobalViewParamsPtr& globalViewParams,
mTabWidget->setFocusPolicy(Qt::NoFocus); mTabWidget->setFocusPolicy(Qt::NoFocus);
mOverlaySignalMapper = new QSignalMapper(this);
connect(parent, SIGNAL(systemCreatedSignal(UASInterface*)), connect(parent, SIGNAL(systemCreatedSignal(UASInterface*)),
this, SLOT(systemCreated(UASInterface*))); this, SLOT(systemCreated(UASInterface*)));
connect(parent, SIGNAL(overlayCreatedSignal(int,QString)),
this, SLOT(overlayCreated(int,QString)));
} }
void void
@ -48,6 +53,28 @@ ViewParamWidget::setFollowCameraId(int id)
} }
void void
ViewParamWidget::overlayCreated(int systemId, const QString& name)
{
if (!mOverlayLayout.contains(systemId))
{
return;
}
SystemViewParamsPtr systemViewParams = mSystemViewParamMap[systemId];
systemViewParams->displayOverlay().insert(name, true);
QCheckBox* checkbox = new QCheckBox(this);
checkbox->setChecked(systemViewParams->displayOverlay().value(name));
mOverlayLayout[systemId]->addRow(name, checkbox);
mOverlaySignalMapper->setMapping(checkbox, name);
connect(checkbox, SIGNAL(clicked()),
mOverlaySignalMapper, SLOT(map()));
connect(mOverlaySignalMapper, SIGNAL(mapped(QString)),
systemViewParams.data(), SLOT(toggleOverlay(QString)));
}
void
ViewParamWidget::systemCreated(UASInterface *uas) ViewParamWidget::systemCreated(UASInterface *uas)
{ {
addTab(uas->getUASID()); addTab(uas->getUASID());
@ -173,6 +200,10 @@ ViewParamWidget::addTab(int systemId)
QCheckBox* waypointsCheckBox = new QCheckBox(this); QCheckBox* waypointsCheckBox = new QCheckBox(this);
waypointsCheckBox->setChecked(systemViewParams->displayWaypoints()); waypointsCheckBox->setChecked(systemViewParams->displayWaypoints());
QGroupBox* overlayGroupBox = new QGroupBox(tr("Overlays"), this);
mOverlayLayout[systemId] = new QFormLayout;
overlayGroupBox->setLayout(mOverlayLayout[systemId]);
QFormLayout* formLayout = new QFormLayout; QFormLayout* formLayout = new QFormLayout;
page->setLayout(formLayout); page->setLayout(formLayout);
@ -188,6 +219,7 @@ ViewParamWidget::addTab(int systemId)
formLayout->addRow(tr("Target"), targetCheckBox); formLayout->addRow(tr("Target"), targetCheckBox);
formLayout->addRow(tr("Trails"), trailsCheckBox); formLayout->addRow(tr("Trails"), trailsCheckBox);
formLayout->addRow(tr("Waypoints"), waypointsCheckBox); formLayout->addRow(tr("Waypoints"), waypointsCheckBox);
formLayout->addRow(overlayGroupBox);
QString label("MAV "); QString label("MAV ");
label += QString::number(systemId); label += QString::number(systemId);

6
src/ui/map3D/ViewParamWidget.h

@ -3,6 +3,8 @@
#include <QComboBox> #include <QComboBox>
#include <QDockWidget> #include <QDockWidget>
#include <QFormLayout>
#include <QSignalMapper>
#include <QSpinBox> #include <QSpinBox>
#include <QTabWidget> #include <QTabWidget>
#include <QVBoxLayout> #include <QVBoxLayout>
@ -26,6 +28,7 @@ public:
signals: signals:
private slots: private slots:
void overlayCreated(int systemId, const QString& name);
void systemCreated(UASInterface* uas); void systemCreated(UASInterface* uas);
void setpointsCheckBoxToggled(int state); void setpointsCheckBoxToggled(int state);
@ -43,7 +46,10 @@ private:
// child widgets // child widgets
QComboBox* mFollowCameraComboBox; QComboBox* mFollowCameraComboBox;
QSpinBox* mSetpointHistoryLengthSpinBox; QSpinBox* mSetpointHistoryLengthSpinBox;
QMap<int, QFormLayout*> mOverlayLayout;
QTabWidget* mTabWidget; QTabWidget* mTabWidget;
QSignalMapper* mOverlaySignalMapper;
}; };
#endif // VIEWPARAMWIDGET_H #endif // VIEWPARAMWIDGET_H

32
thirdParty/mavlink/include/mavlink_protobuf_manager.hpp vendored

@ -24,40 +24,46 @@ public:
, kExtendedHeaderSize(MAVLINK_EXTENDED_HEADER_LEN) , kExtendedHeaderSize(MAVLINK_EXTENDED_HEADER_LEN)
, kExtendedPayloadMaxSize(MAVLINK_MAX_EXTENDED_PAYLOAD_LEN) , kExtendedPayloadMaxSize(MAVLINK_MAX_EXTENDED_PAYLOAD_LEN)
{ {
// register PointCloudXYZI // register GLOverlay
{ {
std::tr1::shared_ptr<px::PointCloudXYZI> msg(new px::PointCloudXYZI); std::tr1::shared_ptr<px::GLOverlay> msg(new px::GLOverlay);
registerType(msg); registerType(msg);
} }
// register PointCloudXYZRGB // register ObstacleList
{ {
std::tr1::shared_ptr<px::PointCloudXYZRGB> msg(new px::PointCloudXYZRGB); std::tr1::shared_ptr<px::ObstacleList> msg(new px::ObstacleList);
registerType(msg); registerType(msg);
} }
// register RGBDImage // register ObstacleMap
{ {
std::tr1::shared_ptr<px::RGBDImage> msg(new px::RGBDImage); std::tr1::shared_ptr<px::ObstacleMap> msg(new px::ObstacleMap);
registerType(msg); registerType(msg);
} }
// register ObstacleList // register Path
{ {
std::tr1::shared_ptr<px::ObstacleList> msg(new px::ObstacleList); std::tr1::shared_ptr<px::Path> msg(new px::Path);
registerType(msg);
}
// register PointCloudXYZI
{
std::tr1::shared_ptr<px::PointCloudXYZI> msg(new px::PointCloudXYZI);
registerType(msg); registerType(msg);
} }
// register ObstacleMap // register PointCloudXYZRGB
{ {
std::tr1::shared_ptr<px::ObstacleMap> msg(new px::ObstacleMap); std::tr1::shared_ptr<px::PointCloudXYZRGB> msg(new px::PointCloudXYZRGB);
registerType(msg); registerType(msg);
} }
// register Path // register RGBDImage
{ {
std::tr1::shared_ptr<px::Path> msg(new px::Path); std::tr1::shared_ptr<px::RGBDImage> msg(new px::RGBDImage);
registerType(msg); registerType(msg);
} }
srand(time(NULL)); srand(time(NULL));

3579
thirdParty/mavlink/include/pixhawk/pixhawk.pb.h vendored

File diff suppressed because it is too large Load Diff

155
thirdParty/mavlink/message_definitions/pixhawk.proto vendored

@ -1,11 +1,107 @@
package px; package px;
message HeaderInfo { message HeaderInfo
{
required int32 source_sysid = 1; required int32 source_sysid = 1;
required int32 source_compid = 2; required int32 source_compid = 2;
required double timestamp = 3; // in seconds required double timestamp = 3; // in seconds
} }
message GLOverlay
{
required HeaderInfo header = 1;
optional string name = 2;
enum CoordinateFrameType
{
GLOBAL = 0;
LOCAL = 1;
}
optional CoordinateFrameType coordinateFrameType = 3;
optional double origin_x = 4;
optional double origin_y = 5;
optional double origin_z = 6;
optional bytes data = 7;
enum Mode
{
POINTS = 0;
LINES = 1;
LINE_STRIP = 2;
LINE_LOOP = 3;
TRIANGLES = 4;
TRIANGLE_STRIP = 5;
TRIANGLE_FAN = 6;
QUADS = 7;
QUAD_STRIP = 8;
POLYGON = 9;
SOLID_CIRCLE = 10;
WIRE_CIRCLE = 11;
SOLID_CUBE = 12;
WIRE_CUBE = 13;
}
enum Identifier
{
END = 14;
VERTEX2F = 15;
VERTEX3F = 16;
ROTATEF = 17;
TRANSLATEF = 18;
SCALEF = 19;
PUSH_MATRIX = 20;
POP_MATRIX = 21;
COLOR3F = 22;
COLOR4F = 23;
POINTSIZE = 24;
LINEWIDTH = 25;
}
}
message Obstacle
{
optional float x = 1;
optional float y = 2;
optional float z = 3;
optional float length = 4;
optional float width = 5;
optional float height = 6;
}
message ObstacleList
{
required HeaderInfo header = 1;
repeated Obstacle obstacles = 2;
}
message ObstacleMap
{
required HeaderInfo header = 1;
required int32 type = 2;
optional float resolution = 3;
optional int32 rows = 4;
optional int32 cols = 5;
optional int32 mapR0 = 6;
optional int32 mapC0 = 7;
optional int32 arrayR0 = 8;
optional int32 arrayC0 = 9;
optional bytes data = 10;
}
message Path
{
required HeaderInfo header = 1;
repeated Waypoint waypoints = 2;
}
message PointCloudXYZI { message PointCloudXYZI {
message PointXYZI { message PointXYZI {
required float x = 1; required float x = 1;
@ -34,16 +130,16 @@ message RGBDImage
{ {
required HeaderInfo header = 1; required HeaderInfo header = 1;
required uint32 cols = 2; ///< Number of columns in image(s) required uint32 cols = 2; ///< Number of columns in image(s)
required uint32 rows = 3; ///< Number of rows in image(s) required uint32 rows = 3; ///< Number of rows in image(s)
required uint32 step1 = 4; ///< Step (stride) of image 1 required uint32 step1 = 4; ///< Step (stride) of image 1
required uint32 type1 = 5; ///< Type of image 1 required uint32 type1 = 5; ///< Type of image 1
required bytes imageData1 = 6; required bytes imageData1 = 6;
required uint32 step2 = 7; ///< Step (stride) of image 2 required uint32 step2 = 7; ///< Step (stride) of image 2
required uint32 type2 = 8; ///< Type of image 2 required uint32 type2 = 8; ///< Type of image 2
required bytes imageData2 = 9; required bytes imageData2 = 9;
optional uint32 camera_config = 10; ///< PxSHM::Camera enumeration optional uint32 camera_config = 10; ///< PxSHM::Camera enumeration
optional uint32 camera_type = 11; ///< PxSHM::CameraType enumeration optional uint32 camera_type = 11; ///< PxSHM::CameraType enumeration
optional float roll = 12; optional float roll = 12;
optional float pitch = 13; optional float pitch = 13;
optional float yaw = 14; optional float yaw = 14;
@ -56,40 +152,6 @@ message RGBDImage
repeated float camera_matrix = 21; repeated float camera_matrix = 21;
} }
message Obstacle
{
optional float x = 1;
optional float y = 2;
optional float z = 3;
optional float length = 4;
optional float width = 5;
optional float height = 6;
}
message ObstacleList
{
required HeaderInfo header = 1;
repeated Obstacle obstacles = 2;
}
message ObstacleMap
{
required HeaderInfo header = 1;
required int32 type = 2;
optional float resolution = 3;
optional int32 rows = 4;
optional int32 cols = 5;
optional int32 mapR0 = 6;
optional int32 mapC0 = 7;
optional int32 arrayR0 = 8;
optional int32 arrayC0 = 9;
optional bytes data = 10;
}
message Waypoint message Waypoint
{ {
required double x = 1; required double x = 1;
@ -99,10 +161,3 @@ message Waypoint
optional double pitch = 5; optional double pitch = 5;
optional double yaw = 6; optional double yaw = 6;
} }
message Path
{
required HeaderInfo header = 1;
repeated Waypoint waypoints = 2;
}

83
thirdParty/mavlink/message_definitions/sensesoar.xml vendored

@ -0,0 +1,83 @@
<?xml version='1.0'?>
<mavlink>
<include>common.xml</include>
<enums>
<enum name="SENSESOAR_MODE">
<description> Different flight modes </description>
<entry name="SENSESOAR_MODE_GLIDING"> Gliding mode with motors off</entry>
<entry name="SENSESOAR_MODE_AUTONOMOUS"> Autonomous flight</entry>
<entry name="SENSESOAR_MODE_MANUAL"> RC controlled</entry>
</enum>
</enums>
<messages>
<message id="170" name="OBS_POSITION">
Position estimate of the observer in global frame
<field type="int32_t" name="lon">Longitude expressed in 1E7</field>
<field type="int32_t" name="lat">Latitude expressed in 1E7</field>
<field type="int32_t" name="alt">Altitude expressed in milimeters</field>
</message>
<message id="172" name="OBS_VELOCITY">
velocity estimate of the observer in NED inertial frame
<field type="float[3]" name="vel">Velocity</field>
</message>
<message id="174" name="OBS_ATTITUDE">
attitude estimate of the observer
<field type="double[4]" name="quat">Quaternion re;im</field>
</message>
<message id="176" name="OBS_WIND">
Wind estimate in NED inertial frame
<field type="float[3]" name="wind">Wind</field>
</message>
<message id="178" name="OBS_AIR_VELOCITY">
Estimate of the air velocity
<field type="float" name="magnitude">Air speed</field>
<field type="float" name="aoa">angle of attack</field>
<field type="float" name="slip">slip angle</field>
</message>
<message id="180" name="OBS_BIAS">
IMU biases
<field type="float[3]" name="accBias">accelerometer bias</field>
<field type="float[3]" name="gyroBias">gyroscope bias</field>
</message>
<message id="182" name="OBS_QFF">
estimate of the pressure at sea level
<field type="float" name="qff">Wind</field>
</message>
<message id="183" name="OBS_AIR_TEMP">
ambient air temperature
<field type="float" name="airT">Air Temperatur</field>
</message>
<message id="184" name="FILT_ROT_VEL">
filtered rotational velocity
<field type="float[3]" name="rotVel">rotational velocity</field>
</message>
<message id="186" name="LLC_OUT">
low level control output
<field type="int16_t[4]" name="servoOut">Servo signal</field>
<field type="int16_t[2]" name="MotorOut">motor signal</field>
</message>
<message id="188" name="PM_ELEC">
Power managment
<field type="float" name="PwCons">current power consumption</field>
<field type="float" name="BatStat">battery status</field>
<field type="float[3]" name="PwGen">Power generation from each module</field>
</message>
<message id="190" name="SYS_Stat">
system status
<field type="uint8_t" name="gps">gps status</field>
<field type="uint8_t" name="act">actuator status</field>
<field type="uint8_t" name="mod">module status</field>
<field type="uint8_t" name="commRssi">module status</field>
</message>
<message id="192" name="CMD_AIRSPEED_CHNG">
change commanded air speed
<field type="uint8_t" name="target">Target ID</field>
<field type="float" name="spCmd">commanded airspeed</field>
</message>
<message id="194" name="CMD_AIRSPEED_ACK">
accept change of airspeed
<field type="float" name="spCmd">commanded airspeed</field>
<field type="uint8_t" name="ack">0:ack, 1:nack</field>
</message>
</messages>
</mavlink>

5429
thirdParty/mavlink/src/pixhawk/pixhawk.pb.cc vendored

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save