From 821f9597c3629acf5f45f55b9e8869065df674bc Mon Sep 17 00:00:00 2001
From: Paul Beuchat <beuchatp@control.ee.ethz.ch>
Date: Tue, 4 Jun 2019 12:56:08 +0200
Subject: [PATCH] Finished updating the CMakeList so the GUI is compiled only
 when the necessary Qt packages are available. Also added comment to
 agent.launch file giving example of how to launch without the GUI

---
 dfall_ws/src/dfall_pkg/CMakeLists.txt      | 390 +++++++++++----------
 dfall_ws/src/dfall_pkg/launch/agent.launch |   3 +
 2 files changed, 216 insertions(+), 177 deletions(-)

diff --git a/dfall_ws/src/dfall_pkg/CMakeLists.txt b/dfall_ws/src/dfall_pkg/CMakeLists.txt
index 256b9f0c..9b97c231 100755
--- a/dfall_ws/src/dfall_pkg/CMakeLists.txt
+++ b/dfall_ws/src/dfall_pkg/CMakeLists.txt
@@ -24,9 +24,11 @@ find_package (Eigen3 3.3 NO_MODULE)
 
 
 
-# CHECK IF THE QT PACKAGE IS AVAILABLE
-find_package (Qt5Core CONFIG)
-find_package (Qt5Svg  CONFIG)
+# CHECK IF THE QT PACKAGES ARE AVAILABLE
+find_package(Qt5Widgets CONFIG)
+find_package(Qt5Core CONFIG)
+find_package(Qt5Gui CONFIG)
+find_package(Qt5Svg CONFIG)
 
 
 
@@ -59,56 +61,71 @@ endif()
 
 
 # LET THE USER KNOW IF THE QT PACKAGES WERE FOUND OR NOT
+if(Qt5Widgets_FOUND)
+  message(STATUS "NOTE: the Qt5 Widgets package was found")
+else()
+  message(STATUS "NOTE: the Qt5 Widgets package was NOT found")
+endif()
 if(Qt5Core_FOUND)
-	message(STATUS "NOTE: the Qt Core package was found")
+	message(STATUS "NOTE: the Qt5 Core package was found")
+else()
+	message(STATUS "NOTE: the Qt5 Core package was NOT found")
+endif()
+if(Qt5Gui_FOUND)
+  message(STATUS "NOTE: the Qt5 Gui package was found")
 else()
-	message(STATUS "NOTE: the Qt Core package was NOT found")
+  message(STATUS "NOTE: the Qt5 Gui package was NOT found")
 endif()
 if(Qt5Svg_FOUND)
-	message(STATUS "NOTE: the Qt Svg package was found")
+	message(STATUS "NOTE: the Qt5 Svg package was found")
 else()
-	message(STATUS "NOTE: the Qt Svg package was NOT found")
+	message(STATUS "NOTE: the Qt5 Svg package was NOT found")
 endif()
-if(Qt5Core_FOUND AND Qt5Svg_FOUND)
-	message(STATUS "NOTE: hence compiling Qt GUIs")
+
+
+if(Qt5Widgets_FOUND AND Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Svg_FOUND)
+	set(Qt5_FOUND TRUE)
 else()
-	message(STATUS "NOTE: hence NOT compiling Qt GUIs")
+	set(Qt5_FOUND FALSE)
 endif()
+if(Qt5_FOUND)
+  message(STATUS "NOTE: hence compiling Qt GUIs")
+else()
+  message(STATUS "NOTE: hence NOT compiling Qt GUIs")
+endif()
+
 
+if(Qt5_FOUND)
+  # GUI -- Add precompiler definitions to include ROS things in GUI compilation
+  add_definitions(-DCATKIN_MAKE)
 
+  # GUI -- Things needed for Qt wrapper build process
+  set(CMAKE_INCLUDE_CURRENT_DIR ON)
+  set(CMAKE_AUTOMOC ON)
+endif()
 
-# GUI -- Add precompiler definitions to include ROS things in GUI compilation
-add_definitions(-DCATKIN_MAKE)
 
-# GUI -- Things needed for Qt wrapper build process
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-set(CMAKE_AUTOMOC ON)
 
 ## System dependencies are found with CMake's conventions
 # find_package(Boost REQUIRED COMPONENTS system)
 
-# GUI -- Add Qt support
-find_package(Qt5Widgets REQUIRED)
-find_package(Qt5Core REQUIRED)
-find_package(Qt5Gui REQUIRED)
-find_package(Qt5Svg REQUIRED)
 
 
+if(Qt5_FOUND)
+  # GUI -- Add src, includes, and resources
+  set(SYSTEM_CONFIG_GUI_LIB_PATH_SRC   ${PROJECT_SOURCE_DIR}/GUI_Qt/systemConfigGUI/src)
+  set(SYSTEM_CONFIG_GUI_LIB_PATH_INC   ${PROJECT_SOURCE_DIR}/GUI_Qt/systemConfigGUI/include)
+  set(SYSTEM_CONFIG_GUI_LIB_PATH_FORMS ${PROJECT_SOURCE_DIR}/GUI_Qt/systemConfigGUI/forms)
+  set(SYSTEM_CONFIG_GUI_RESOURCE_FILE_QRC  ${PROJECT_SOURCE_DIR}/GUI_Qt/systemConfigGUI/systemconfiggui.qrc)
 
-# GUI -- Add src, includes, and resources
-set(SYSTEM_CONFIG_GUI_LIB_PATH_SRC   ${PROJECT_SOURCE_DIR}/GUI_Qt/systemConfigGUI/src)
-set(SYSTEM_CONFIG_GUI_LIB_PATH_INC   ${PROJECT_SOURCE_DIR}/GUI_Qt/systemConfigGUI/include)
-set(SYSTEM_CONFIG_GUI_LIB_PATH_FORMS ${PROJECT_SOURCE_DIR}/GUI_Qt/systemConfigGUI/forms)
-set(SYSTEM_CONFIG_GUI_RESOURCE_FILE_QRC  ${PROJECT_SOURCE_DIR}/GUI_Qt/systemConfigGUI/systemconfiggui.qrc)
 
 
-
-# Flying Agent GUI -- Add src, includes, forms, and resources
-set(FLYING_AGENT_GUI_LIB_PATH_SRC      ${PROJECT_SOURCE_DIR}/GUI_Qt/flyingAgentGUI/src)
-set(FLYING_AGENT_GUI_LIB_PATH_INC      ${PROJECT_SOURCE_DIR}/GUI_Qt/flyingAgentGUI/include)
-set(FLYING_AGENT_GUI_LIB_PATH_FORMS    ${PROJECT_SOURCE_DIR}/GUI_Qt/flyingAgentGUI/forms)
-set(FLYING_AGENT_GUI_RESOURCE_FILE_QRC ${PROJECT_SOURCE_DIR}/GUI_Qt/flyingAgentGUI/flyingagentgui.qrc)
-
+  # Flying Agent GUI -- Add src, includes, forms, and resources
+  set(FLYING_AGENT_GUI_LIB_PATH_SRC      ${PROJECT_SOURCE_DIR}/GUI_Qt/flyingAgentGUI/src)
+  set(FLYING_AGENT_GUI_LIB_PATH_INC      ${PROJECT_SOURCE_DIR}/GUI_Qt/flyingAgentGUI/include)
+  set(FLYING_AGENT_GUI_LIB_PATH_FORMS    ${PROJECT_SOURCE_DIR}/GUI_Qt/flyingAgentGUI/forms)
+  set(FLYING_AGENT_GUI_RESOURCE_FILE_QRC ${PROJECT_SOURCE_DIR}/GUI_Qt/flyingAgentGUI/flyingagentgui.qrc)
+endif()
 
 
 # #set the default path for built executables to the "bin" directory
@@ -116,72 +133,72 @@ set(FLYING_AGENT_GUI_RESOURCE_FILE_QRC ${PROJECT_SOURCE_DIR}/GUI_Qt/flyingAgentG
 # #set the default path for built libraries to the "lib" directory
 # set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
 
-# GUI -- need c++11 for some things
+# Need c++11 for some things - mainly for the GUI
 add_definitions(-std=c++11)
 
 
-
-# GUI -- Special Qt sources that need to be wrapped before being compiled
-# they have the Qt macro QOBJECT inside, the MOC cpp file needs to be done manually
-set(SRC_HDRS_QOBJECT_GUI
-  ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/crazyFlyZoneTab.h
-  ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/myGraphicsScene.h
-  ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/myGraphicsView.h
-  ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/mainguiwindow.h
-  ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/rosNodeThread_for_systemConfigGUI.h
-  ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/CFLinker.h
-  )
-# GUI -- wrap UI file and QOBJECT files
-qt5_wrap_ui(UIS_HDRS_GUI ${SYSTEM_CONFIG_GUI_LIB_PATH_FORMS}/mainguiwindow.ui)
-qt5_wrap_cpp(SRC_MOC_HDRS_GUI ${SRC_HDRS_QOBJECT_GUI})
-# GUI -- wrap resource file qrc->rcc
-qt5_add_resources(SYSTEM_CONFIG_GUI_RESOURCE_FILE_RRC ${SYSTEM_CONFIG_GUI_RESOURCE_FILE_QRC})
-
-
-
-
-# Flying Agent GUI
-# - Special Qt sources that need to be wrapped before being compiled
-#   they have the Qt macro QOBJECT inside, the MOC cpp file needs to
-#   be done manually
-set(SRC_HDRS_QOBJECT_FLYING_AGENT_GUI
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/connectstartstopbar.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/controllertabs.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/coordinator.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/coordinatorrow.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/defaultcontrollertab.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/enablecontrollerloadyamlbar.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/mainwindow.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/pickercontrollertab.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/remotecontrollertab.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/rosNodeThread_for_flyingAgentGUI.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/safecontrollertab.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/studentcontrollertab.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/templatecontrollertab.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/topbanner.h
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}/tuningcontrollertab.h
-  )
-# Flying Agent GUI -- wrap UI file and QOBJECT files
-qt5_wrap_ui(UIS_HDRS_FLYING_AGENT_GUI
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/connectstartstopbar.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/controllertabs.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/coordinator.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/coordinatorrow.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/defaultcontrollertab.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/enablecontrollerloadyamlbar.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/mainwindow.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/pickercontrollertab.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/remotecontrollertab.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/safecontrollertab.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/studentcontrollertab.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/templatecontrollertab.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/topbanner.ui
-  ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/tuningcontrollertab.ui
-  )
-qt5_wrap_cpp(SRC_MOC_HDRS_FLYING_AGENT_GUI ${SRC_HDRS_QOBJECT_FLYING_AGENT_GUI})
-# Flying Agent GUI -- wrap resource file qrc->rcc
-qt5_add_resources(FLYING_AGENT_GUI_RESOURCE_FILE_RCC ${FLYING_AGENT_GUI_RESOURCE_FILE_QRC})
-
+if(Qt5_FOUND)
+  # GUI -- Special Qt sources that need to be wrapped before being compiled
+  # they have the Qt macro QOBJECT inside, the MOC cpp file needs to be done manually
+  set(SRC_HDRS_QOBJECT_GUI
+    ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/crazyFlyZoneTab.h
+    ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/myGraphicsScene.h
+    ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/myGraphicsView.h
+    ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/mainguiwindow.h
+    ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/rosNodeThread_for_systemConfigGUI.h
+    ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}/CFLinker.h
+    )
+  # GUI -- wrap UI file and QOBJECT files
+  qt5_wrap_ui(UIS_HDRS_GUI ${SYSTEM_CONFIG_GUI_LIB_PATH_FORMS}/mainguiwindow.ui)
+  qt5_wrap_cpp(SRC_MOC_HDRS_GUI ${SRC_HDRS_QOBJECT_GUI})
+  # GUI -- wrap resource file qrc->rcc
+  qt5_add_resources(SYSTEM_CONFIG_GUI_RESOURCE_FILE_RRC ${SYSTEM_CONFIG_GUI_RESOURCE_FILE_QRC})
+
+
+
+
+  # Flying Agent GUI
+  # - Special Qt sources that need to be wrapped before being compiled
+  #   they have the Qt macro QOBJECT inside, the MOC cpp file needs to
+  #   be done manually
+  set(SRC_HDRS_QOBJECT_FLYING_AGENT_GUI
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/connectstartstopbar.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/controllertabs.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/coordinator.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/coordinatorrow.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/defaultcontrollertab.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/enablecontrollerloadyamlbar.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/mainwindow.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/pickercontrollertab.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/remotecontrollertab.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/rosNodeThread_for_flyingAgentGUI.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/safecontrollertab.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/studentcontrollertab.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/templatecontrollertab.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/topbanner.h
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}/tuningcontrollertab.h
+    )
+  # Flying Agent GUI -- wrap UI file and QOBJECT files
+  qt5_wrap_ui(UIS_HDRS_FLYING_AGENT_GUI
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/connectstartstopbar.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/controllertabs.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/coordinator.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/coordinatorrow.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/defaultcontrollertab.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/enablecontrollerloadyamlbar.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/mainwindow.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/pickercontrollertab.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/remotecontrollertab.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/safecontrollertab.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/studentcontrollertab.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/templatecontrollertab.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/topbanner.ui
+    ${FLYING_AGENT_GUI_LIB_PATH_FORMS}/tuningcontrollertab.ui
+    )
+  qt5_wrap_cpp(SRC_MOC_HDRS_FLYING_AGENT_GUI ${SRC_HDRS_QOBJECT_FLYING_AGENT_GUI})
+  # Flying Agent GUI -- wrap resource file qrc->rcc
+  qt5_add_resources(FLYING_AGENT_GUI_RESOURCE_FILE_RCC ${FLYING_AGENT_GUI_RESOURCE_FILE_QRC})
+endif()
 
 
 ## Uncomment this if the package has a setup.py. This macro ensures
@@ -308,13 +325,21 @@ generate_messages(
 ## LIBRARIES: libraries you create in this project that dependent projects also need
 ## CATKIN_DEPENDS: catkin_packages dependent projects also need
 ## DEPENDS: system dependencies of this project that dependent projects also need
-catkin_package(
-  INCLUDE_DIRS include ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}   # SystemConfigGUI -- include headers from GUI in package
-  INCLUDE_DIRS include ${FLYING_AGENT_GUI_LIB_PATH_INC}    # FlyingAgentGUI  -- include headers from GUI in package
-  LIBRARIES
-  CATKIN_DEPENDS roscpp rospy std_msgs rosbag roslib
-  DEPENDS
-)
+if(Qt5_FOUND)
+  catkin_package(
+    INCLUDE_DIRS include ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}   # SystemConfigGUI -- include headers from GUI in package
+    INCLUDE_DIRS include ${FLYING_AGENT_GUI_LIB_PATH_INC}    # FlyingAgentGUI  -- include headers from GUI in package
+    LIBRARIES
+    CATKIN_DEPENDS roscpp rospy std_msgs rosbag roslib
+    DEPENDS
+  )
+else()
+  catkin_package(
+    LIBRARIES
+    CATKIN_DEPENDS roscpp rospy std_msgs rosbag roslib
+    DEPENDS
+  )
+endif()
 
 ###########
 ## Build ##
@@ -323,13 +348,21 @@ catkin_package(
 ## Specify additional locations of header files
 ## Your package locations should be listed before other locations
 # include_directories(include)
-include_directories(
-  ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}    # SystemConfigGUI -- include directory inside GUI folder
-  ${FLYING_AGENT_GUI_LIB_PATH_INC}     # FlyingAgentGUI  -- include directory inside GUI folder
-  ${catkin_INCLUDE_DIRS}
-  include
-  include/nodes
-)
+if(Qt5_FOUND)
+  include_directories(
+    ${SYSTEM_CONFIG_GUI_LIB_PATH_INC}    # SystemConfigGUI -- include directory inside GUI folder
+    ${FLYING_AGENT_GUI_LIB_PATH_INC}     # FlyingAgentGUI  -- include directory inside GUI folder
+    ${catkin_INCLUDE_DIRS}
+    include
+    include/nodes
+  )
+else()
+  include_directories(
+    ${catkin_INCLUDE_DIRS}
+    include
+    include/nodes
+  )
+endif()
 
 ## Declare a C++ library
 ##add_library(${PROJECT_NAME}
@@ -377,59 +410,61 @@ add_executable(ParameterService          src/nodes/ParameterService.cpp)
 
 
 
-# GUI -- Add sources here
-set(SYSTEM_CONFIG_GUI_CPP_SOURCES              # compilation of sources
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/mainguiwindow.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/main.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/cornergrabber.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/crazyFlyZone.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/crazyFlyZoneTab.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/myGraphicsRectItem.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/myGraphicsScene.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/myGraphicsView.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/tablePiece.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/marker.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/rosNodeThread_for_systemConfigGUI.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/crazyFly.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/CFLinker.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/channelLUT.cpp
-    ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/centerMarker.cpp
-    )
-
-
-
-
-# FLYING AGENT GUI -- Add sources here
-set(FLYING_AGENT_GUI_CPP_SOURCES         # compilation of sources
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/mainwindow.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/main.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/rosNodeThread_for_flyingAgentGUI.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/connectstartstopbar.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/controllertabs.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/coordinator.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/coordinatorrow.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/defaultcontrollertab.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/enablecontrollerloadyamlbar.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/pickercontrollertab.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/remotecontrollertab.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/safecontrollertab.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/studentcontrollertab.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/templatecontrollertab.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/topbanner.cpp
-    ${FLYING_AGENT_GUI_LIB_PATH_SRC}/tuningcontrollertab.cpp
-    )
-
-
-
-# GUI -- Add executables here
-add_executable(SystemConfigGUI ${SYSTEM_CONFIG_GUI_CPP_SOURCES} ${UIS_HDRS_GUI} ${SRC_MOC_HDRS_GUI} ${SYSTEM_CONFIG_GUI_RESOURCE_FILE_RRC})
-qt5_use_modules(SystemConfigGUI Widgets)
-
-
-
-# FLYING AGENT GUI -- Add executables here
-add_executable(FlyingAgentGUI ${FLYING_AGENT_GUI_CPP_SOURCES} ${UIS_HDRS_FLYING_AGENT_GUI} ${SRC_MOC_HDRS_FLYING_AGENT_GUI} ${FLYING_AGENT_GUI_RESOURCE_FILE_RCC})
-qt5_use_modules(FlyingAgentGUI Widgets)
+if(Qt5_FOUND)
+  # GUI -- Add sources here
+  set(SYSTEM_CONFIG_GUI_CPP_SOURCES              # compilation of sources
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/mainguiwindow.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/main.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/cornergrabber.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/crazyFlyZone.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/crazyFlyZoneTab.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/myGraphicsRectItem.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/myGraphicsScene.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/myGraphicsView.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/tablePiece.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/marker.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/rosNodeThread_for_systemConfigGUI.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/crazyFly.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/CFLinker.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/channelLUT.cpp
+      ${SYSTEM_CONFIG_GUI_LIB_PATH_SRC}/centerMarker.cpp
+      )
+
+
+
+
+  # FLYING AGENT GUI -- Add sources here
+  set(FLYING_AGENT_GUI_CPP_SOURCES         # compilation of sources
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/mainwindow.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/main.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/rosNodeThread_for_flyingAgentGUI.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/connectstartstopbar.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/controllertabs.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/coordinator.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/coordinatorrow.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/defaultcontrollertab.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/enablecontrollerloadyamlbar.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/pickercontrollertab.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/remotecontrollertab.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/safecontrollertab.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/studentcontrollertab.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/templatecontrollertab.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/topbanner.cpp
+      ${FLYING_AGENT_GUI_LIB_PATH_SRC}/tuningcontrollertab.cpp
+      )
+
+
+
+  # GUI -- Add executables here
+  add_executable(SystemConfigGUI ${SYSTEM_CONFIG_GUI_CPP_SOURCES} ${UIS_HDRS_GUI} ${SRC_MOC_HDRS_GUI} ${SYSTEM_CONFIG_GUI_RESOURCE_FILE_RRC})
+  qt5_use_modules(SystemConfigGUI Widgets)
+
+
+
+  # FLYING AGENT GUI -- Add executables here
+  add_executable(FlyingAgentGUI ${FLYING_AGENT_GUI_CPP_SOURCES} ${UIS_HDRS_FLYING_AGENT_GUI} ${SRC_MOC_HDRS_FLYING_AGENT_GUI} ${FLYING_AGENT_GUI_RESOURCE_FILE_RCC})
+  qt5_use_modules(FlyingAgentGUI Widgets)
+endif()
 
 
 
@@ -454,14 +489,15 @@ add_dependencies(ParameterService          dfall_pkg_generate_messages_cpp ${cat
 
 
 
-# GUI-- dependencies
-add_dependencies(SystemConfigGUI dfall_pkg_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
+if(Qt5_FOUND)
+  # GUI-- dependencies
+  add_dependencies(SystemConfigGUI dfall_pkg_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
 
 
 
-# FLYING AGENT GUI-- dependencies
-add_dependencies(FlyingAgentGUI dfall_pkg_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
-
+  # FLYING AGENT GUI-- dependencies
+  add_dependencies(FlyingAgentGUI dfall_pkg_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
+endif()
 
 
 ## Rename C++ executable without prefix
@@ -479,7 +515,7 @@ add_dependencies(FlyingAgentGUI dfall_pkg_generate_messages_cpp ${catkin_EXPORTE
 #   ${catkin_LIBRARIES}
 # )
 
-# find_library(VICON_LIBRARY ViconDataStreamSDK_CPP HINTS lib/vicon)
+
 
 if(VICON_LIBRARY)
 	target_link_libraries(ViconDataPublisher ${catkin_LIBRARIES})
@@ -506,18 +542,18 @@ target_link_libraries(CentralManagerService     ${catkin_LIBRARIES})
 target_link_libraries(ParameterService          ${catkin_LIBRARIES})
 
 
+if(Qt5_FOUND)
+  # GUI -- link libraries
+  target_link_libraries(SystemConfigGUI Qt5::Widgets) # GUI -- let SystemConfigGUI have acesss to Qt stuff
+  target_link_libraries(SystemConfigGUI Qt5::Svg)
+  target_link_libraries(SystemConfigGUI ${catkin_LIBRARIES})
 
-# GUI -- link libraries
-target_link_libraries(SystemConfigGUI Qt5::Widgets) # GUI -- let SystemConfigGUI have acesss to Qt stuff
-target_link_libraries(SystemConfigGUI Qt5::Svg)
-target_link_libraries(SystemConfigGUI ${catkin_LIBRARIES})
 
 
-
-# Flying Agent GUI -- link libraries
-target_link_libraries(FlyingAgentGUI Qt5::Widgets) # GUI -- let FlyingAgentGUI have acesss to Qt stuff
-target_link_libraries(FlyingAgentGUI ${catkin_LIBRARIES})
-
+  # Flying Agent GUI -- link libraries
+  target_link_libraries(FlyingAgentGUI Qt5::Widgets) # GUI -- let FlyingAgentGUI have acesss to Qt stuff
+  target_link_libraries(FlyingAgentGUI ${catkin_LIBRARIES})
+endif()
 
 
 #############
diff --git a/dfall_ws/src/dfall_pkg/launch/agent.launch b/dfall_ws/src/dfall_pkg/launch/agent.launch
index 34881f67..a6e5c9f3 100755
--- a/dfall_ws/src/dfall_pkg/launch/agent.launch
+++ b/dfall_ws/src/dfall_pkg/launch/agent.launch
@@ -15,6 +15,9 @@
     <!-- Example of how to specify the agentID from command line -->
     <!-- roslaunch dfall_pkg agentID:=1 -->
 
+    <!-- Example of how to specify the withGUI from command line -->
+    <!-- roslaunch dfall_pkg withGUI:=false -->
+
     <group ns="$(eval 'agent' + str(agentID).zfill(3))">
 
 		<!-- CRAZY RADIO -->
-- 
GitLab