To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit b0e9064e authored by beuchatp's avatar beuchatp
Browse files

Flying Agent GUI debugged and able to launch and control individual agents.

parent 085f9ad1
......@@ -71,9 +71,9 @@ set(STUDENT_RESOURCE_FILE_QRC ${PROJECT_SOURCE_DIR}/GUI_Qt/studentGUI/studentgui
# 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_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)
......@@ -130,7 +130,7 @@ set(SRC_HDRS_QOBJECT_FLYING_AGENT_GUI
${FLYING_AGENT_GUI_LIB_PATH_INC}/coordinatorrow.h
${FLYING_AGENT_GUI_LIB_PATH_INC}/enablecontrollerloadyamlbar.h
${FLYING_AGENT_GUI_LIB_PATH_INC}/mainwindow.h
${FLYING_AGENT_GUI_LIB_PATH_INC}/rosNodeThread.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}/topbanner.h
)
......@@ -147,7 +147,7 @@ qt5_wrap_ui(UIS_HDRS_FLYING_AGENT_GUI
)
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 ${MY_RESOURCE_FILE_QRC})
qt5_add_resources(FLYING_AGENT_GUI_RESOURCE_FILE_RCC ${FLYING_AGENT_GUI_RESOURCE_FILE_QRC})
......@@ -269,7 +269,7 @@ generate_messages(
catkin_package(
INCLUDE_DIRS include ${MY_GUI_LIB_PATH_INC} # GUI -- include headers from GUI in package
INCLUDE_DIRS include ${STUDENT_GUI_LIB_PATH_INC} # StudentGUI -- include headers from GUI in package
INCLUDE_DIRS include ${FLYING_AGENT_GUI_LIB_PATH_INC} # StudentGUI -- 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
......@@ -285,7 +285,7 @@ catkin_package(
include_directories(
${MY_GUI_LIB_PATH_INC} # GUI -- include directory inside GUI folder
${STUDENT_GUI_LIB_PATH_INC} # StudentGUI -- include directory inside GUI folder
${FLYING_AGENT_GUI_LIB_PATH_INC} # StudentGUI -- include directory inside GUI folder
${FLYING_AGENT_GUI_LIB_PATH_INC} # FlyingAgentGUI -- include directory inside GUI folder
${catkin_INCLUDE_DIRS}
include
include/nodes
......@@ -354,14 +354,14 @@ set(MY_CPP_SOURCES_STUDENT_GUI # compilation of sources
# FLYING AGENT GUI -- Add sources here
set(MY_CPP_SOURCES_FLYING_AGENT_GUI # 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}/enablecontrollerloadyamlbar.cpp
${FLYING_AGENT_GUI_LIB_PATH_SRC}/main.cpp
${FLYING_AGENT_GUI_LIB_PATH_SRC}/mainwindow.cpp
${FLYING_AGENT_GUI_LIB_PATH_SRC}/rosNodeThread.cpp
${FLYING_AGENT_GUI_LIB_PATH_SRC}/safecontrollertab.cpp
${FLYING_AGENT_GUI_LIB_PATH_SRC}/topbanner.cpp
)
......
......@@ -30,14 +30,17 @@
// ----------------------------------------------------------------------------------
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#ifndef MAINWINDOW_FLYINGAGENTGUI_H
#define MAINWINDOW_FLYINGAGENTGUI_H
#include <QMainWindow>
#include <QShortcut>
#ifdef CATKIN_MAKE
#include "rosNodeThread.h"
#include <ros/ros.h>
#include <ros/network.h>
#include <ros/package.h>
#include "rosNodeThread_for_flyingAgentGUI.h"
#endif
......
// Copyright (C) 2017, ETH Zurich, D-ITET, Angel Romero
// Copyright (C) 2017, ETH Zurich, D-ITET, Paul Beuchat
//
// This file is part of D-FaLL-System.
//
......@@ -30,8 +30,8 @@
// ----------------------------------------------------------------------------------
#ifndef ___ROSNODETHREAD_H___
#define ___ROSNODETHREAD_H___
#ifndef ___ROSNODETHREAD_FOR_FLYINGAGENTGUI_H___
#define ___ROSNODETHREAD_FOR_FLYINGAGENTGUI_H___
#include <QtCore>
#include <QThread>
......@@ -43,11 +43,16 @@
#include <ros/ros.h>
#include <ros/network.h>
#include "d_fall_pps/CMRead.h"
#include "d_fall_pps/CMUpdate.h"
#include "d_fall_pps/CMCommand.h"
//#include "d_fall_pps/UnlabeledMarker.h"
//#include "d_fall_pps/CrazyflieData.h"
//#include "d_fall_pps/ViconData.h"
//using namespace d_fall_pps;
using namespace d_fall_pps;
//typedef ViconData::ConstPtr ptrToMessage;
......@@ -69,7 +74,7 @@ public:
ros::ServiceClient m_update_db_client;
ros::ServiceClient m_command_db_client;
signals:
//signals:
//void newViconData(const ptrToMessage& p_msg);
......
......@@ -103,7 +103,10 @@ CoordinatorRow::CoordinatorRow(QWidget *parent, int agentID) :
// LET THE USER KNOW WHAT THE BASE NAMESPACE IS
ROS_INFO_STREAM("[Coordinator Row GUI] using base namespace: %s" << ros_base_namespace.c_str() << ", for agentID = " << my_agentID);
ROS_INFO_STREAM("[Coordinator Row GUI] using base namespace: " << ros_base_namespace.c_str() << ", for agentID = " << my_agentID);
std::string temp_ros_namespace = ros::this_node::getNamespace();
ROS_INFO_STREAM("[Coordinator Row GUI] compared to: ros::this_node::getNamespace() = " << temp_ros_namespace.c_str());
// CREATE A NODE HANDLE TO THE BASE NAMESPACE
ros::NodeHandle base_nodeHandle(ros_base_namespace);
......@@ -125,8 +128,8 @@ CoordinatorRow::CoordinatorRow(QWidget *parent, int agentID) :
// > For updating the "flying_state_label" picture
flyingStateSubscriber = base_nodeHandle.subscribe("PPSClient/flyingState", 1, &CoordinatorRow::flyingStateChangedCallback, this);
// > For changes in the database that defines {agentID,cfID,flying zone} links
databaseChangedSubscriber = dfall_root_nodeHandle.subscribe("my_GUI/DBChanged", 1, &CoordinatorRow::databaseChangedCallback, this);;
centralManagerDatabaseService = dfall_root_nodeHandle.serviceClient<CMQuery>("CentralManagerService/Query", false);
databaseChangedSubscriber = dfall_root_nodeHandle.subscribe("/my_GUI/DBChanged", 1, &CoordinatorRow::databaseChangedCallback, this);;
centralManagerDatabaseService = dfall_root_nodeHandle.serviceClient<CMQuery>("/CentralManagerService/Query", false);
// > For updating the controller that is currently operating
controllerUsedSubscriber = base_nodeHandle.subscribe("PPSClient/controllerUsed", 1, &CoordinatorRow::controllerUsedChangedCallback, this);
......
......@@ -31,7 +31,7 @@
#include "mainwindow.h"
#include "ui_mainwindow.h" // <-- this include is additional to the Qt default
//#include "ui_mainwindow.h" // <-- this include is additional to the Qt default
#include <QApplication>
int main(int argc, char *argv[])
......
......@@ -37,6 +37,7 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) :
ui(new Ui::MainWindow)
{
#ifdef CATKIN_MAKE
//ROS_INFO("[flyingAgentGUI] Debug Point 5");
m_rosNodeThread = new rosNodeThread(argc, argv, "flyingAgentGUI");
#endif
ui->setupUi(this);
......
// Copyright (C) 2017, ETH Zurich, D-ITET, Angel Romero
// Copyright (C) 2017, ETH Zurich, D-ITET, Paul Beuchat
//
// This file is part of D-FaLL-System.
//
......@@ -30,11 +30,13 @@
// ----------------------------------------------------------------------------------
#include "rosNodeThread.h"
#include "rosNodeThread_for_flyingAgentGUI.h"
#include "d_fall_pps/CMRead.h"
#include "d_fall_pps/CMUpdate.h"
#include "d_fall_pps/CMCommand.h"
// #include "d_fall_pps/CMRead.h"
// #include "d_fall_pps/CMUpdate.h"
// #include "d_fall_pps/CMCommand.h"
// using namespace d_fall_pps;
rosNodeThread::rosNodeThread(int argc, char** pArgv, const char * node_name, QObject* parent)
......
<launch>
<!-- COORDINATOR GUI -->
<node pkg="d_fall_pps" name="coordinator_GUI" output="screen" type="coordinator_GUI">
</node>
<!-- INPUT ARGUMENT OF THE AGENT's ID -->
<arg name="coordID" default="$(optenv DFALL_DEFAULT_COORD_ID)" />
<!-- Example of how to use the value in coordID -->
<!-- <param name="param" value="$(arg coordID)"/> -->
<!-- Example of how to specify the coordID from command line -->
<!-- roslaunch d_fall_pps coordID:=001 -->
<group ns="coord$(arg coordID)">
<!-- COORDINATOR GUI -->
<node
pkg="d_fall_pps"
name="flyingAgentGUI"
output="screen"
type="flyingAgentGUI"
>
<param name="type" type="str" value="coordinator" />
<param name="coordID" type="str" value="$(arg coordID)" />
</node>
</group>
</launch>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment