From 112cd7de280cdbaea71e2b5f1a5081d7cad0d95e Mon Sep 17 00:00:00 2001 From: beuchatp <beuchatp@control.ee.ethz.ch> Date: Sun, 10 Feb 2019 09:24:03 +0100 Subject: [PATCH] Emergency stop button now hidden when flying agent gui is launched for an agent --- .../GUI_Qt/flyingAgentGUI/src/topbanner.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/topbanner.cpp b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/topbanner.cpp index fb731181..b0a339e6 100644 --- a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/topbanner.cpp +++ b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/topbanner.cpp @@ -105,6 +105,10 @@ TopBanner::TopBanner(QWidget *parent) : // INITIALISATIONS ARE COMPLETE if (m_type == TYPE_AGENT) { + // Hide the "emergency stop" + ui->emergency_stop_button->hide(); + + // Load the context for this agent loadCrazyflieContext(m_ID,1000); } else if (m_type == TYPE_COORDINATOR) @@ -113,12 +117,18 @@ TopBanner::TopBanner(QWidget *parent) : QString qstr_title = "Flying Agent GUI: for COORDINATOR ID "; qstr_title.append( QString::number(m_ID) ); ui->top_banner_label->setText(qstr_title); + + // show the "emergency stop" + ui->emergency_stop_button->show(); } else { // Set the label to inform the user of the error QString qstr_title = "Flying Agent GUI: for UNKNOWN NODE TYPE"; ui->top_banner_label->setText(qstr_title); + + // Hide the "emergency stop" + ui->emergency_stop_button->hide(); } } @@ -174,7 +184,7 @@ void TopBanner::loadCrazyflieContext(int ID_to_request_from_database , int emit_ contextCall.request.studentID = ID_to_request_from_database; //ROS_INFO_STREAM("StudentID:" << m_agentID); - centralManagerDatabaseService.waitForExistence(ros::Duration(-1)); + centralManagerDatabaseService.waitForExistence(ros::Duration(2)); if(centralManagerDatabaseService.call(contextCall)) { @@ -203,6 +213,9 @@ void TopBanner::loadCrazyflieContext(int ID_to_request_from_database , int emit_ { ROS_ERROR_STREAM("[TOP BANNER GUI] Failed to load context for agentID = " << m_ID); + // Set the Crazyflie Name String to be a question mark + qstr_crazyflie_name.append("?"); + m_object_name_for_emitting_pose_data = ""; if (emit_after_milliseconds == 0) -- GitLab