From 95aaa6a169e34ffe2f155b9848b8fc81a1fc7f9d Mon Sep 17 00:00:00 2001 From: pixhawk Date: Sun, 24 Oct 2010 12:10:32 +0200 Subject: [PATCH] Major MAVLink cleanup --- qgroundcontrol.pro | 3 +- src/comm/MAVLinkLightProtocol.h | 2 +- src/comm/MAVLinkProtocol.cc | 2 +- src/comm/MAVLinkProtocol.h | 2 +- src/comm/MAVLinkSimulationLink.cc | 2 +- src/comm/MAVLinkSimulationLink.h | 2 +- src/comm/OpalLink.h | 3 +- src/comm/QGCMAVlink.h | 51 +++++++++++++++++++++++++++++++ src/comm/QGCParamID.h | 2 +- src/comm/SerialLink.h | 26 ++++++++-------- src/comm/SerialLinkInterface.h | 26 ++++++++-------- src/comm/SerialSimulationLink.h | 26 ++++++++-------- src/comm/UDPLink.h | 12 ++++---- src/uas/UAS.cc | 2 +- src/uas/UAS.h | 2 +- src/uas/UASWaypointManager.h | 2 +- src/ui/map3D/QMap3DWidget.cc | 1 - src/ui/uas/UASControlWidget.cc | 1 - user_config.pri.dist | 17 +++++++++-- 19 files changed, 122 insertions(+), 62 deletions(-) create mode 100644 src/comm/QGCMAVlink.h diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 3cb307351..46942b65a 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -200,7 +200,8 @@ HEADERS += src/MG.h \ src/ui/map3D/TextureCache.h \ src/ui/map3D/WebImage.h \ src/ui/map3D/WebImageCache.h \ - src/ui/map3D/Imagery.h + src/ui/map3D/Imagery.h \ + src/comm/QGCMAVlink.h SOURCES += src/main.cc \ src/Core.cc \ src/uas/UASManager.cc \ diff --git a/src/comm/MAVLinkLightProtocol.h b/src/comm/MAVLinkLightProtocol.h index 60253fbbd..12db0a3c4 100644 --- a/src/comm/MAVLinkLightProtocol.h +++ b/src/comm/MAVLinkLightProtocol.h @@ -2,7 +2,7 @@ QGroundControl Open Source Ground Control Station -(c) 2009, 2010 QGROUNDCONTROL PROJECT +(c) 2009 - 2011 QGROUNDCONTROL PROJECT This file is part of the QGROUNDCONTROL project diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index e2184f3bf..5cedb4d88 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -45,7 +45,7 @@ This file is part of the QGROUNDCONTROL project #include "ArduPilotMAV.h" #include "configuration.h" #include "LinkManager.h" -#include +#include #include "QGC.h" /** diff --git a/src/comm/MAVLinkProtocol.h b/src/comm/MAVLinkProtocol.h index 73bd6cd61..b885cdedf 100644 --- a/src/comm/MAVLinkProtocol.h +++ b/src/comm/MAVLinkProtocol.h @@ -40,7 +40,7 @@ This file is part of the QGROUNDCONTROL project #include "ProtocolInterface.h" #include "LinkInterface.h" #include "protocol.h" -#include "mavlink.h" +#include "QGCMAVlink.h" /** * @brief MAVLink micro air vehicle protocol reference implementation. diff --git a/src/comm/MAVLinkSimulationLink.cc b/src/comm/MAVLinkSimulationLink.cc index 334773c5f..b5e2096a5 100644 --- a/src/comm/MAVLinkSimulationLink.cc +++ b/src/comm/MAVLinkSimulationLink.cc @@ -41,7 +41,7 @@ This file is part of the QGROUNDCONTROL project #include "MAVLinkProtocol.h" #include "MAVLinkSimulationLink.h" // MAVLINK includes -#include +#include #include "QGC.h" /** diff --git a/src/comm/MAVLinkSimulationLink.h b/src/comm/MAVLinkSimulationLink.h index 63574b3ad..49cc4d5c0 100644 --- a/src/comm/MAVLinkSimulationLink.h +++ b/src/comm/MAVLinkSimulationLink.h @@ -39,7 +39,7 @@ This file is part of the QGROUNDCONTROL project #include #include #include -#include +#include "QGCMAVLink.h" #include "LinkInterface.h" diff --git a/src/comm/OpalLink.h b/src/comm/OpalLink.h index f72ba9d23..27fe685df 100644 --- a/src/comm/OpalLink.h +++ b/src/comm/OpalLink.h @@ -43,8 +43,7 @@ This file is part of the QGROUNDCONTROL project #include "LinkInterface.h" #include "LinkManager.h" #include "MG.h" -#include "mavlink.h" -#include "mavlink_types.h" +#include "QGCMAVLink.h" #include "configuration.h" #include "OpalRT.h" #include "ParameterList.h" diff --git a/src/comm/QGCMAVlink.h b/src/comm/QGCMAVlink.h new file mode 100644 index 000000000..171a6ebf6 --- /dev/null +++ b/src/comm/QGCMAVlink.h @@ -0,0 +1,51 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009 - 2011 QGROUNDCONTROL PROJECT + +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 . + +======================================================================*/ + +/** + * @file + * @brief MAVLink header file for QGroundControl + * @author Lorenz Meier + */ + +#ifndef QGCMAVLINK_H +#define QGCMAVLINK_H + +#include + +#ifdef QGC_USE_PIXHAWK_MESSAGES +#include +#endif + +#ifdef QGC_USE_SLUGS_MESSAGES +#include +#endif + +#ifdef QGC_USE_UALBERTA_MESSAGES +#include +#endif + +#ifdef QGC_USE_ARDUPILOT_MESSAGES +#include +#endif + +#endif // QGCMAVLINK_H diff --git a/src/comm/QGCParamID.h b/src/comm/QGCParamID.h index 90cf2fcff..2710cef0f 100644 --- a/src/comm/QGCParamID.h +++ b/src/comm/QGCParamID.h @@ -2,7 +2,7 @@ QGroundControl Open Source Ground Control Station -(c) 2009, 2010 QGROUNDCONTROL PROJECT +(c) 2009 - 2011 QGROUNDCONTROL PROJECT This file is part of the QGROUNDCONTROL project diff --git a/src/comm/SerialLink.h b/src/comm/SerialLink.h index b20f6d3ce..dce2386e0 100644 --- a/src/comm/SerialLink.h +++ b/src/comm/SerialLink.h @@ -1,24 +1,24 @@ /*===================================================================== - -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit - -(c) 2009 PIXHAWK PROJECT - -This file is part of the PIXHAWK project - - PIXHAWK is free software: you can redistribute it and/or modify + +QGroundControl Open Source Ground Control Station + +(c) 2009 - 2011 QGROUNDCONTROL PROJECT + +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. - - PIXHAWK is distributed in the hope that it will be useful, + + 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 PIXHAWK. If not, see . - + along with QGROUNDCONTROL. If not, see . + ======================================================================*/ /** diff --git a/src/comm/SerialLinkInterface.h b/src/comm/SerialLinkInterface.h index 5538f1d96..22e00a861 100644 --- a/src/comm/SerialLinkInterface.h +++ b/src/comm/SerialLinkInterface.h @@ -1,24 +1,24 @@ /*===================================================================== - -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit - -(c) 2009 PIXHAWK PROJECT - -This file is part of the PIXHAWK project - - PIXHAWK is free software: you can redistribute it and/or modify + +QGroundControl Open Source Ground Control Station + +(c) 2009 - 2011 QGROUNDCONTROL PROJECT + +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. - - PIXHAWK is distributed in the hope that it will be useful, + + 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 PIXHAWK. If not, see . - + along with QGROUNDCONTROL. If not, see . + ======================================================================*/ /** diff --git a/src/comm/SerialSimulationLink.h b/src/comm/SerialSimulationLink.h index 4a95a4757..35f295200 100644 --- a/src/comm/SerialSimulationLink.h +++ b/src/comm/SerialSimulationLink.h @@ -1,24 +1,24 @@ /*===================================================================== - -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit - -(c) 2009 PIXHAWK PROJECT - -This file is part of the PIXHAWK project - - PIXHAWK is free software: you can redistribute it and/or modify + +QGroundControl Open Source Ground Control Station + +(c) 2009 - 2011 QGROUNDCONTROL PROJECT + +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. - - PIXHAWK is distributed in the hope that it will be useful, + + 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 PIXHAWK. If not, see . - + along with QGROUNDCONTROL. If not, see . + ======================================================================*/ /** diff --git a/src/comm/UDPLink.h b/src/comm/UDPLink.h index 704020e88..6682aae00 100644 --- a/src/comm/UDPLink.h +++ b/src/comm/UDPLink.h @@ -1,23 +1,23 @@ /*===================================================================== -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit +QGroundControl Open Source Ground Control Station -(c) 2009 PIXHAWK PROJECT +(c) 2009 - 2011 QGROUNDCONTROL PROJECT -This file is part of the PIXHAWK project +This file is part of the QGROUNDCONTROL project - PIXHAWK is free software: you can redistribute it and/or modify + 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. - PIXHAWK is distributed in the hope that it will be useful, + 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 PIXHAWK. If not, see . + along with QGROUNDCONTROL. If not, see . ======================================================================*/ diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 9e61d2c5c..5c23d739e 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -42,7 +42,7 @@ This file is part of the QGROUNDCONTROL project #include "QGC.h" #include "GAudioOutput.h" #include "MAVLinkProtocol.h" -#include +#include "QGCMAVLink.h" UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(), uasId(id), diff --git a/src/uas/UAS.h b/src/uas/UAS.h index 08694ce1c..9c2ef9a3b 100644 --- a/src/uas/UAS.h +++ b/src/uas/UAS.h @@ -35,7 +35,7 @@ This file is part of the QGROUNDCONTROL project #include "UASInterface.h" #include "MG.h" #include -#include +#include "QGCMAVLink.h" /** * @brief A generic MAVLINK-connected MAV/UAV diff --git a/src/uas/UASWaypointManager.h b/src/uas/UASWaypointManager.h index b0e4e3ee8..a16c8d3fe 100644 --- a/src/uas/UASWaypointManager.h +++ b/src/uas/UASWaypointManager.h @@ -36,7 +36,7 @@ This file is part of the QGROUNDCONTROL project #include #include #include "Waypoint.h" -#include +#include "QGCMAVLink.h" class UAS; /** diff --git a/src/ui/map3D/QMap3DWidget.cc b/src/ui/map3D/QMap3DWidget.cc index de3d32e83..e8b7b679e 100644 --- a/src/ui/map3D/QMap3DWidget.cc +++ b/src/ui/map3D/QMap3DWidget.cc @@ -273,7 +273,6 @@ QMap3DWidget::displayHandler(void) 5, &painter); painter.end(); - repaint(); } void QMap3DWidget::drawWaypoints(void) const diff --git a/src/ui/uas/UASControlWidget.cc b/src/ui/uas/UASControlWidget.cc index 3ca8f294c..647b6831f 100644 --- a/src/ui/uas/UASControlWidget.cc +++ b/src/ui/uas/UASControlWidget.cc @@ -41,7 +41,6 @@ This file is part of the PIXHAWK project #include "UASControlWidget.h" #include #include -//#include #define CONTROL_MODE_LOCKED "MODE LOCKED" #define CONTROL_MODE_MANUAL "MODE MANUAL" diff --git a/user_config.pri.dist b/user_config.pri.dist index 54de63c45..c4c046dd4 100644 --- a/user_config.pri.dist +++ b/user_config.pri.dist @@ -27,7 +27,18 @@ # Several message sets can be also enabled in parallel, as long as function names # and message ids do not conflict. -INCLUDEPATH += $$BASEDIR/../mavlink/include/pixhawk -#INCLUDEPATH += $$BASEDIR/../mavlink/include/slugs -#INCLUDEPATH += $$BASEDIR/../mavlink/include/ualberta +# Remove the default set - it is included anyway INCLUDEPATH -= $$BASEDIR/../mavlink/include/common + +# PIXHAWK SPECIAL MESSAGES +INCLUDEPATH += $$BASEDIR/../mavlink/include/pixhawk +DEFINES += QGC_USE_PIXHAWK_MESSAGES + +# SLUGS SPECIAL MESSAGES +INCLUDEPATH += $$BASEDIR/../mavlink/include/slugs +DEFINES += QGC_USE_SLUGS_MESSAGES + +# UALBERTA SPECIAL MESSAGES +INCLUDEPATH += $$BASEDIR/../mavlink/include/ualberta +DEFINES += QGC_USE_UALBERTA_MESSAGES + -- 2.22.0