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

Small changes to make the GUI look nicer. Added an emergency stop button. It...

Small changes to make the GUI look nicer. Added an emergency stop button. It needs to be connected, given a proper image, and made hidden for when launched as an agent
parent 1072e6c8
No related branches found
No related tags found
No related merge requests found
Showing
with 224 additions and 88 deletions
...@@ -47,13 +47,13 @@ ...@@ -47,13 +47,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>750</width> <width>750</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
...@@ -71,8 +71,8 @@ ...@@ -71,8 +71,8 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>95</width> <width>72</width>
<height>70</height> <height>55</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
...@@ -97,13 +97,13 @@ ...@@ -97,13 +97,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>750</width> <width>750</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
...@@ -117,21 +117,21 @@ ...@@ -117,21 +117,21 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>180</width> <width>0</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>180</width> <width>180</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
...@@ -162,8 +162,8 @@ ...@@ -162,8 +162,8 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>50</width> <width>38</width>
<height>70</height> <height>55</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
...@@ -188,13 +188,13 @@ ...@@ -188,13 +188,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>750</width> <width>750</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
...@@ -213,13 +213,13 @@ ...@@ -213,13 +213,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>750</width> <width>750</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="text"> <property name="text">
...@@ -237,8 +237,8 @@ ...@@ -237,8 +237,8 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>90</width> <width>72</width>
<height>70</height> <height>55</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
...@@ -263,13 +263,13 @@ ...@@ -263,13 +263,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>750</width> <width>750</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QTabWidget" name="controller_tabs_widget"> <widget class="QTabWidget" name="controller_tabs_widget">
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>3</number>
</property> </property>
<widget class="QWidget" name="default_tab"> <widget class="QWidget" name="default_tab">
<attribute name="title"> <attribute name="title">
......
...@@ -54,6 +54,9 @@ ...@@ -54,6 +54,9 @@
<property name="text"> <property name="text">
<string>xx.xx</string> <string>xx.xx</string>
</property> </property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
...@@ -131,6 +134,9 @@ ...@@ -131,6 +134,9 @@
<property name="text"> <property name="text">
<string>xx.xx</string> <string>xx.xx</string>
</property> </property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
...@@ -399,6 +405,9 @@ ...@@ -399,6 +405,9 @@
<property name="text"> <property name="text">
<string>xx.xx</string> <string>xx.xx</string>
</property> </property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item row="5" column="7"> <item row="5" column="7">
...@@ -524,6 +533,9 @@ ...@@ -524,6 +533,9 @@
<property name="text"> <property name="text">
<string>xx.xx</string> <string>xx.xx</string>
</property> </property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="2" column="2">
...@@ -548,6 +560,9 @@ ...@@ -548,6 +560,9 @@
<property name="text"> <property name="text">
<string>xx.xx</string> <string>xx.xx</string>
</property> </property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
...@@ -588,6 +603,9 @@ ...@@ -588,6 +603,9 @@
<property name="text"> <property name="text">
<string>xx.xx</string> <string>xx.xx</string>
</property> </property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1">
...@@ -612,6 +630,9 @@ ...@@ -612,6 +630,9 @@
<property name="text"> <property name="text">
<string>xx.xx</string> <string>xx.xx</string>
</property> </property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="5" column="1">
...@@ -636,6 +657,9 @@ ...@@ -636,6 +657,9 @@
<property name="text"> <property name="text">
<string>xx.xx</string> <string>xx.xx</string>
</property> </property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="5" column="0">
......
...@@ -41,13 +41,13 @@ ...@@ -41,13 +41,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>60</width> <width>60</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>180</width> <width>180</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
...@@ -72,13 +72,13 @@ ...@@ -72,13 +72,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
...@@ -106,13 +106,13 @@ ...@@ -106,13 +106,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>60</width> <width>60</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>180</width> <width>180</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
...@@ -246,13 +246,13 @@ ...@@ -246,13 +246,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>60</width> <width>60</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>180</width> <width>180</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
...@@ -277,13 +277,13 @@ ...@@ -277,13 +277,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>60</width> <width>60</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>180</width> <width>180</width>
<height>70</height> <height>50</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
......
...@@ -54,22 +54,29 @@ ...@@ -54,22 +54,29 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="Line" name="coordinator_to_main_panel_vertical_line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>6</number> <number>12</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>6</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>6</number> <number>6</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>6</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="TopBanner" name="customWidget_topBanner" native="true"> <widget class="TopBanner" name="customWidget_topBanner" native="true">
...@@ -93,6 +100,13 @@ ...@@ -93,6 +100,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="Line" name="line_1">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item> <item>
<widget class="ConnectStartStopBar" name="customWidget_connectStartStopBar" native="true"> <widget class="ConnectStartStopBar" name="customWidget_connectStartStopBar" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
...@@ -115,6 +129,13 @@ ...@@ -115,6 +129,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item> <item>
<widget class="EnableControllerLoadYamlBar" name="customWidget_enableControllerLoadYamlBar" native="true"> <widget class="EnableControllerLoadYamlBar" name="customWidget_enableControllerLoadYamlBar" native="true">
<property name="enabled"> <property name="enabled">
...@@ -141,33 +162,21 @@ ...@@ -141,33 +162,21 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="Line" name="line_3">
<property name="spacing"> <property name="orientation">
<number>6</number> <enum>Qt::Horizontal</enum>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
</property> </property>
<property name="rightMargin"> </widget>
<number>6</number> </item>
</property> <item>
<property name="bottomMargin"> <widget class="ControllerTabs" name="customWidget_controller_tabs" native="true">
<number>6</number> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<item> </widget>
<widget class="ControllerTabs" name="customWidget_controller_tabs" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</item> </item>
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1049</width> <width>1418</width>
<height>300</height> <height>300</height>
</rect> </rect>
</property> </property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>20</pointsize> <pointsize>18</pointsize>
<weight>75</weight> <weight>75</weight>
<bold>true</bold> <bold>true</bold>
</font> </font>
...@@ -27,13 +27,13 @@ ...@@ -27,13 +27,13 @@
<number>6</number> <number>6</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>6</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>6</number> <number>6</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>6</number> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
...@@ -54,6 +54,31 @@ ...@@ -54,6 +54,31 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<widget class="QPushButton" name="emergency_stop_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>60</height>
</size>
</property>
<property name="text">
<string>ES</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define DEFAULTCONTROLLERTAB_H #define DEFAULTCONTROLLERTAB_H
#include <QWidget> #include <QWidget>
#include <QTextStream>
namespace Ui { namespace Ui {
class DefaultControllerTab; class DefaultControllerTab;
...@@ -15,6 +16,14 @@ public: ...@@ -15,6 +16,14 @@ public:
explicit DefaultControllerTab(QWidget *parent = 0); explicit DefaultControllerTab(QWidget *parent = 0);
~DefaultControllerTab(); ~DefaultControllerTab();
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();
private: private:
Ui::DefaultControllerTab *ui; Ui::DefaultControllerTab *ui;
}; };
......
...@@ -100,7 +100,7 @@ private: ...@@ -100,7 +100,7 @@ private:
#ifdef CATKIN_MAKE #ifdef CATKIN_MAKE
// --------------------------------------------------- // // --------------------------------------------------- //
// PRIVATE VARIABLES FOR ROS // PRIVATE VARIABLES FOR ROS
...@@ -123,9 +123,15 @@ private: ...@@ -123,9 +123,15 @@ private:
// > For the notification that the database was changes, // > For the notification that the database was changes,
// received on the "DatabaseChangedSubscriber" // received on the "DatabaseChangedSubscriber"
void databaseChangedCallback(const std_msgs::Int32& msg); void databaseChangedCallback(const std_msgs::Int32& msg);
#endif
#endif private slots:
// PRIVATE METHODS FOR BUTTON CALLBACKS
// > For the emergency stop button
void on_emergency_stop_button_clicked();
}; };
#endif // TOPBANNER_H #endif // TOPBANNER_H
...@@ -12,3 +12,39 @@ DefaultControllerTab::~DefaultControllerTab() ...@@ -12,3 +12,39 @@ DefaultControllerTab::~DefaultControllerTab()
{ {
delete ui; delete ui;
} }
void DefaultControllerTab::on_lineEdit_setpoint_new_x_returnPressed()
{
ui->set_setpoint_button->animateClick();
#ifdef CATKIN_MAKE
#else
// TO ASSIST WITH DEBUGGING WHEN COMPILED AND RUN IN "QtCreator"
QTextStream(stdout) << "[DEFAULT CONTROLLER TAB] return pressed for x setpoint";
#endif
}
void DefaultControllerTab::on_lineEdit_setpoint_new_y_returnPressed()
{
ui->set_setpoint_button->animateClick();
}
void DefaultControllerTab::on_lineEdit_setpoint_new_z_returnPressed()
{
ui->set_setpoint_button->animateClick();
}
void DefaultControllerTab::on_lineEdit_setpoint_new_yaw_returnPressed()
{
ui->set_setpoint_button->animateClick();
}
void DefaultControllerTab::on_set_setpoint_button_clicked()
{
#ifdef CATKIN_MAKE
#else
// TO ASSIST WITH DEBUGGING WHEN COMPILED AND RUN IN "QtCreator"
QTextStream(stdout) << "[DEFAULT CONTROLLER TAB] set setpoint button clicked";
#endif
}
...@@ -172,17 +172,6 @@ void EnableControllerLoadYamlBar::setAgentIDsToCoordinate(QVector<int> agentIDs ...@@ -172,17 +172,6 @@ void EnableControllerLoadYamlBar::setAgentIDsToCoordinate(QVector<int> agentIDs
} }
// Unlock the mutex // Unlock the mutex
m_agentIDs_toCoordinate_mutex.unlock(); m_agentIDs_toCoordinate_mutex.unlock();
#ifdef CATKIN_MAKE
#else
// TO ASSIST WITH DEBUGGING WHEN COMPILED AND RUN IN "QtCreator"
QTextStream(stdout) << "[CONNECT START STOP GUI BAR] is coordinating agentIDs:";
for ( int irow = 0 ; irow < agentIDs.length() ; irow++ )
{
QTextStream(stdout) << " " << agentIDs[irow];
}
QTextStream(stdout) << " " << endl;
#endif
} }
...@@ -385,4 +374,4 @@ bool EnableControllerLoadYamlBar::getTypeAndIDParameters() ...@@ -385,4 +374,4 @@ bool EnableControllerLoadYamlBar::getTypeAndIDParameters()
// Return // Return
return return_was_successful; return return_was_successful;
} }
#endif #endif
\ No newline at end of file
...@@ -121,12 +121,14 @@ void MainWindow::on_actionShowHide_Coordinator_triggered() ...@@ -121,12 +121,14 @@ void MainWindow::on_actionShowHide_Coordinator_triggered()
if ( ui->customWidget_coordinator->isHidden() ) if ( ui->customWidget_coordinator->isHidden() )
{ {
ui->customWidget_coordinator->show(); ui->customWidget_coordinator->show();
ui->coordinator_to_main_panel_vertical_line->show();
QString qstr = "Hide Coordinator"; QString qstr = "Hide Coordinator";
ui->actionShowHide_Coordinator->setText(qstr); ui->actionShowHide_Coordinator->setText(qstr);
} }
else else
{ {
ui->customWidget_coordinator->hide(); ui->customWidget_coordinator->hide();
ui->coordinator_to_main_panel_vertical_line->hide();
QString qstr = "Show Coordinator"; QString qstr = "Show Coordinator";
ui->actionShowHide_Coordinator->setText(qstr); ui->actionShowHide_Coordinator->setText(qstr);
} }
......
...@@ -36,7 +36,12 @@ ...@@ -36,7 +36,12 @@
#include "topbanner.h" #include "topbanner.h"
#include "ui_topbanner.h" #include "ui_topbanner.h"
#ifdef CATKIN_MAKE
#else
// Include the shared definitions
#include "include/Constants_for_Qt_compile.h"
#endif
...@@ -45,12 +50,19 @@ TopBanner::TopBanner(QWidget *parent) : ...@@ -45,12 +50,19 @@ TopBanner::TopBanner(QWidget *parent) :
ui(new Ui::TopBanner) ui(new Ui::TopBanner)
{ {
ui->setupUi(this); ui->setupUi(this);
(":/images/rf_connected.png");
QPixmap pixmap(":/images/rf_connected.png");
QIcon ButtonIcon(pixmap);
ui->emergency_stop_button->setText("");
ui->emergency_stop_button->setIcon(ButtonIcon);
ui->emergency_stop_button->setIconSize(QSize(50,50));
//ui->emergency_stop_button->setIconSize(pixmap.rect().size());
#ifdef CATKIN_MAKE #ifdef CATKIN_MAKE
// Get the namespace of this node // Get the namespace of this node
std::string base_namespace = ros::this_node::getNamespace(); std::string base_namespace = ros::this_node::getNamespace();
ROS_INFO_STREAM("[CONNECT START STOP GUI BAR] ros::this_node::getNamespace() = " << base_namespace); ROS_INFO_STREAM("[TOP BANNER GUI] ros::this_node::getNamespace() = " << base_namespace);
// Get the type and ID of this parameter service // Get the type and ID of this parameter service
...@@ -59,7 +71,7 @@ TopBanner::TopBanner(QWidget *parent) : ...@@ -59,7 +71,7 @@ TopBanner::TopBanner(QWidget *parent) :
// Stall if the TYPE and ID are not valid // Stall if the TYPE and ID are not valid
if ( !isValid_type_and_ID ) if ( !isValid_type_and_ID )
{ {
ROS_ERROR("[CONNECT START STOP GUI BAR] Node NOT FUNCTIONING :-)"); ROS_ERROR("[TOP BANNER GUI] Node NOT FUNCTIONING :-)");
ros::spin(); ros::spin();
} }
#else #else
...@@ -133,7 +145,7 @@ TopBanner::~TopBanner() ...@@ -133,7 +145,7 @@ TopBanner::~TopBanner()
// > For the notification that the database was changes, received on the "DatabaseChangedSubscriber" // > For the notification that the database was changes, received on the "DatabaseChangedSubscriber"
void TopBanner::databaseChangedCallback(const std_msgs::Int32& msg) void TopBanner::databaseChangedCallback(const std_msgs::Int32& msg)
{ {
//ROS_INFO_STEAM("[COORDINATOR ROW GUI] Database Changed Callback called for agentID = " << m_agentID); //ROS_INFO_STEAM("[TOP BANNER GUI] Database Changed Callback called for agentID = " << m_agentID);
loadCrazyflieContext(); loadCrazyflieContext();
} }
#endif #endif
...@@ -194,6 +206,30 @@ void TopBanner::loadCrazyflieContext() ...@@ -194,6 +206,30 @@ void TopBanner::loadCrazyflieContext()
// ----------------------------------------------------------------------------------
// BBBB U U TTTTT TTTTT OOO N N SSSS
// B B U U T T O O NN N S
// BBBB U U T T O O N N N SSS
// B B U U T T O O N NN S
// BBBB UUU T T OOO N N SSSS
// ----------------------------------------------------------------------------------
void TopBanner::on_emergency_stop_button_clicked()
{
#ifdef CATKIN_MAKE
d_fall_pps::IntWithHeader msg;
fillIntMessageHeader(msg);
msg.data = CMD_RECONNECT;
this->crazyRadioCommandPublisher.publish(msg);
ROS_INFO("[TOP BANNER GUI] EMERGENCY STOP button clicked");
#endif
}
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// III DDDD &&& TTTTT Y Y PPPP EEEEE // III DDDD &&& TTTTT Y Y PPPP EEEEE
...@@ -220,7 +256,7 @@ bool TopBanner::getTypeAndIDParameters() ...@@ -220,7 +256,7 @@ bool TopBanner::getTypeAndIDParameters()
if(!nodeHandle.getParam("type", type_string)) if(!nodeHandle.getParam("type", type_string))
{ {
// Throw an error if the agent ID parameter could not be obtained // Throw an error if the agent ID parameter could not be obtained
ROS_ERROR("[CONNECT START STOP GUI BAR] Failed to get type"); ROS_ERROR("[TOP BANNER GUI] Failed to get type");
} }
// Set the "m_type" class variable based on this string loaded // Set the "m_type" class variable based on this string loaded
...@@ -237,7 +273,7 @@ bool TopBanner::getTypeAndIDParameters() ...@@ -237,7 +273,7 @@ bool TopBanner::getTypeAndIDParameters()
// Set "m_type" to the value indicating that it is invlid // Set "m_type" to the value indicating that it is invlid
m_type = TYPE_INVALID; m_type = TYPE_INVALID;
return_was_successful = false; return_was_successful = false;
ROS_ERROR("[CONNECT START STOP GUI BAR] The 'type' parameter retrieved was not recognised."); ROS_ERROR("[TOP BANNER GUI] The 'type' parameter retrieved was not recognised.");
} }
...@@ -251,12 +287,12 @@ bool TopBanner::getTypeAndIDParameters() ...@@ -251,12 +287,12 @@ bool TopBanner::getTypeAndIDParameters()
{ {
// Throw an error if the agent ID parameter could not be obtained // Throw an error if the agent ID parameter could not be obtained
return_was_successful = false; return_was_successful = false;
ROS_ERROR("[CONNECT START STOP GUI BAR] Failed to get agentID"); ROS_ERROR("[TOP BANNER GUI] Failed to get agentID");
} }
else else
{ {
// Inform the user about the type and ID // Inform the user about the type and ID
ROS_INFO_STREAM("[CONNECT START STOP GUI BAR] Is of type AGENT with ID = " << m_ID); ROS_INFO_STREAM("[TOP BANNER GUI] Is of type AGENT with ID = " << m_ID);
} }
break; break;
} }
...@@ -270,12 +306,12 @@ bool TopBanner::getTypeAndIDParameters() ...@@ -270,12 +306,12 @@ bool TopBanner::getTypeAndIDParameters()
{ {
// Throw an error if the coord ID parameter could not be obtained // Throw an error if the coord ID parameter could not be obtained
return_was_successful = false; return_was_successful = false;
ROS_ERROR("[CONNECT START STOP GUI BAR] Failed to get coordID"); ROS_ERROR("[TOP BANNER GUI] Failed to get coordID");
} }
else else
{ {
// Inform the user about the type and ID // Inform the user about the type and ID
ROS_INFO_STREAM("[CONNECT START STOP GUI BAR] Is of type COORDINATOR with ID = " << m_ID); ROS_INFO_STREAM("[TOP BANNER GUI] Is of type COORDINATOR with ID = " << m_ID);
} }
break; break;
} }
...@@ -284,7 +320,7 @@ bool TopBanner::getTypeAndIDParameters() ...@@ -284,7 +320,7 @@ bool TopBanner::getTypeAndIDParameters()
{ {
// Throw an error if the type is not recognised // Throw an error if the type is not recognised
return_was_successful = false; return_was_successful = false;
ROS_ERROR("[CONNECT START STOP GUI BAR] The 'm_type' variable was not recognised."); ROS_ERROR("[TOP BANNER GUI] The 'm_type' variable was not recognised.");
break; break;
} }
} }
...@@ -292,4 +328,4 @@ bool TopBanner::getTypeAndIDParameters() ...@@ -292,4 +328,4 @@ bool TopBanner::getTypeAndIDParameters()
// Return // Return
return return_was_successful; return return_was_successful;
} }
#endif #endif
\ No newline at end of file
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