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 fb7311811a8ad0ad82b69b622c7f9ac2979f3d0c..b0a339e6331d4f94e1af75228d55a17bbccb66bd 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)