Skip to content
Snippets Groups Projects
Commit df5599a6 authored by beuchatp's avatar beuchatp
Browse files

Added the remote controller tab widget to the GUI as a copy of the template...

Added the remote controller tab widget to the GUI as a copy of the template controller. Next step is to connect it up
parent 604899fc
No related branches found
No related tags found
No related merge requests found
......@@ -114,6 +114,7 @@ set(SRC_HDRS_QOBJECT_FLYING_AGENT_GUI
${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
......@@ -131,6 +132,7 @@ qt5_wrap_ui(UIS_HDRS_FLYING_AGENT_GUI
${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
......@@ -370,6 +372,7 @@ set(FLYING_AGENT_GUI_CPP_SOURCES # compilation of sources
${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
......
......@@ -30,6 +30,7 @@ SOURCES += src/main.cpp\
src/pickercontrollertab.cpp \
src/templatecontrollertab.cpp \
src/tuningcontrollertab.cpp \
src/remotecontrollertab.cpp
HEADERS += include/mainwindow.h \
......@@ -46,6 +47,7 @@ HEADERS += include/mainwindow.h \
include/templatecontrollertab.h \
include/tuningcontrollertab.h \
include/Constants_for_Qt_compile.h \
include/remotecontrollertab.h
......@@ -62,6 +64,7 @@ FORMS += forms/mainwindow.ui \
forms/pickercontrollertab.ui \
forms/templatecontrollertab.ui \
forms/tuningcontrollertab.ui \
forms/remotecontrollertab.ui
RESOURCES += \
......
......@@ -28,7 +28,7 @@
<item row="0" column="0">
<widget class="QTabWidget" name="controller_tabs_widget">
<property name="currentIndex">
<number>5</number>
<number>4</number>
</property>
<property name="movable">
<bool>true</bool>
......@@ -77,6 +77,11 @@
<attribute name="title">
<string>Remote</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="RemoteControllerTab" name="remote_controller_tab_widget" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="template_tab">
<attribute name="title">
......@@ -123,6 +128,12 @@
<header>templatecontrollertab.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>RemoteControllerTab</class>
<extends>QWidget</extends>
<header>remotecontrollertab.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
......
This diff is collapsed.
// Copyright (C) 2019, ETH Zurich, D-ITET, Paul Beuchat
//
// This file is part of D-FaLL-System.
//
// D-FaLL-System 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.
//
// D-FaLL-System 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 D-FaLL-System. If not, see <http://www.gnu.org/licenses/>.
//
//
// ----------------------------------------------------------------------------------
// DDDD FFFFF L L SSSS Y Y SSSS TTTTT EEEEE M M
// D D F aaa L L S Y Y S T E MM MM
// D D --- FFFF a a L L --- SSS Y SSS T EEE M M M
// D D F a aa L L S Y S T E M M
// DDDD F aa a LLLL LLLL SSSS Y SSSS T EEEEE M M
//
//
// DESCRIPTION:
// The GUI for a Remote Controller
//
// ----------------------------------------------------------------------------------
#ifndef REMOTECONTROLLERTAB_H
#define REMOTECONTROLLERTAB_H
#include <QWidget>
#include <QMutex>
#include <QVector>
#include <QLineEdit>
#include <QTextStream>
#ifdef CATKIN_MAKE
#include <ros/ros.h>
#include <ros/network.h>
#include <ros/package.h>
// Include the standard message types
//#include "std_msgs/Int32.h"
//#include "std_msgs/Float32.h"
//#include <std_msgs/String.h>
// Include the DFALL message types
//#include "dfall_pkg/IntWithHeader.h"
#include "dfall_pkg/SetpointWithHeader.h"
#include "dfall_pkg/CustomButtonWithHeader.h"
// Include the DFALL service types
#include "dfall_pkg/GetSetpointService.h"
// Include the shared definitions
#include "nodes/Constants.h"
// SPECIFY THE PACKAGE NAMESPACE
//using namespace dfall_pkg;
#else
// Include the shared definitions
#include "include/Constants_for_Qt_compile.h"
#endif
namespace Ui {
class RemoteControllerTab;
}
class RemoteControllerTab : public QWidget
{
Q_OBJECT
public:
explicit RemoteControllerTab(QWidget *parent = 0);
~RemoteControllerTab();
public slots:
void setAgentIDsToCoordinate(QVector<int> agentIDs , bool shouldCoordinateAll);
void setMeasuredPose(float x , float y , float z , float roll , float pitch , float yaw , bool occluded);
void poseDataUnavailableSlot();
private slots:
void on_lineEdit_setpoint_new_x_returnPressed();
void on_lineEdit_setpoint_new_y_returnPressed();
void on_lineEdit_setpoint_new_z_returnPressed();
void on_lineEdit_setpoint_new_yaw_returnPressed();
void on_set_setpoint_button_clicked();
void on_default_setpoint_button_clicked();
void on_custom_button_1_clicked();
void on_custom_button_2_clicked();
void on_custom_button_3_clicked();
private:
Ui::RemoteControllerTab *ui;
// --------------------------------------------------- //
// PRIVATE VARIABLES
// The type of this node, i.e., agent or a coordinator,
// specified as a parameter in the "*.launch" file
int m_type = 0;
// The ID of this node
int m_ID;
// For coordinating multiple agents
std::vector<int> m_vector_of_agentIDs_toCoordinate;
bool m_shouldCoordinateAll = true;
QMutex m_agentIDs_toCoordinate_mutex;
#ifdef CATKIN_MAKE
// PUBLISHER
// > For requesting the setpoint to be changed
ros::Publisher requestSetpointChangePublisher;
// SUBSCRIBER
// > For being notified when the setpoint is changed
ros::Subscriber setpointChangedSubscriber;
// PUBLISHER
// > For notifying that a custom button is pressed
ros::Publisher customButtonPublisher;
#endif
// --------------------------------------------------- //
// PRIVATE FUNCTIONS
#ifdef CATKIN_MAKE
// For receiving message that the setpoint was changed
void setpointChangedCallback(const dfall_pkg::SetpointWithHeader& newSetpoint);
// Publish a message when a custom button is pressed
void publish_custom_button_command(int button_index , QLineEdit * lineEdit_pointer);
// Fill the header for a message
void fillSetpointMessageHeader( dfall_pkg::SetpointWithHeader & msg );
void fillCustomButtonMessageHeader( dfall_pkg::CustomButtonWithHeader & msg );
// Get the paramters that specify the type and ID
bool getTypeAndIDParameters();
#endif
void publishSetpoint(float x, float y, float z, float yaw_degrees);
};
#endif // REMOTECONTROLLERTAB_H
......@@ -77,6 +77,11 @@ ControllerTabs::ControllerTabs(QWidget *parent) :
ui->tuning_controller_tab_widget , &TuningControllerTab::setMeasuredPose
);
QObject::connect(
this , &ControllerTabs::measuredPoseValueChanged ,
ui->remote_controller_tab_widget , &RemoteControllerTab::setMeasuredPose
);
QObject::connect(
this , &ControllerTabs::measuredPoseValueChanged ,
ui->template_controller_tab_widget , &TemplateControllerTab::setMeasuredPose
......@@ -106,6 +111,11 @@ ControllerTabs::ControllerTabs(QWidget *parent) :
ui->tuning_controller_tab_widget , &TuningControllerTab::poseDataUnavailableSlot
);
QObject::connect(
this , &ControllerTabs::poseDataUnavailableSignal ,
ui->remote_controller_tab_widget , &RemoteControllerTab::poseDataUnavailableSlot
);
QObject::connect(
this , &ControllerTabs::poseDataUnavailableSignal ,
ui->template_controller_tab_widget , &TemplateControllerTab::poseDataUnavailableSlot
......@@ -137,6 +147,11 @@ ControllerTabs::ControllerTabs(QWidget *parent) :
ui->tuning_controller_tab_widget , &TuningControllerTab::setAgentIDsToCoordinate
);
QObject::connect(
this , &ControllerTabs::agentIDsToCoordinateChanged ,
ui->remote_controller_tab_widget , &RemoteControllerTab::setAgentIDsToCoordinate
);
QObject::connect(
this , &ControllerTabs::agentIDsToCoordinateChanged ,
ui->template_controller_tab_widget , &TemplateControllerTab::setAgentIDsToCoordinate
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment