diff --git a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/csonecontrollertab.h b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/csonecontrollertab.h index 28c6aca4deb1535c8c86488284ce7fa05378a6a8..445ebdd3ee7527c84f1fdfa7386fca6e9e96551f 100644 --- a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/csonecontrollertab.h +++ b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/csonecontrollertab.h @@ -106,10 +106,10 @@ private slots: void newDataForPerformingStepAndPlotting(float x); void analyseStepResponse(); - //void on_lineEdit_k_returnPressed(); - //void on_lineEdit_T_returnPressed(); - //void on_lineEdit_alpha_returnPressed(); - //void on_lineEdit_step_size_returnPressed(); + void on_lineEdit_k_returnPressed(); + void on_lineEdit_T_returnPressed(); + void on_lineEdit_alpha_returnPressed(); + void on_lineEdit_step_size_returnPressed(); void on_set_controller_parameters_button_clicked(); @@ -152,7 +152,7 @@ private: // > Time (as a float) for the horizontal axis float m_time_for_step = 0.0f; // > The duration for which to record the step - float m_step_response_data_recording_duration = 10.0f; + float m_step_response_data_recording_duration = 20.0f; // > Line Series for the data QLineSeries *m_lineSeries_for_setpoint_x; QLineSeries *m_lineSeries_for_measured_x; diff --git a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/csonecontrollertab.cpp b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/csonecontrollertab.cpp index 162a1b829c1c69577c6df17281cc9e201f4257b3..0e0ea2998579f909e119b45a557d8b5ad7fb5240 100644 --- a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/csonecontrollertab.cpp +++ b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/csonecontrollertab.cpp @@ -216,17 +216,17 @@ void CsoneControllerTab::on_set_controller_parameters_button_clicked() if (k < 0.0) { k = 0.0; - ui->lineEdit_k->setText(qstr + QString::number( k, 'f', 3)); + ui->lineEdit_k->setText(qstr + QString::number( k, 'f', 4)); } else if (T > 100.0) { k = 100.0; - ui->lineEdit_T->setText(qstr + QString::number( k, 'f', 3)); + ui->lineEdit_k->setText(qstr + QString::number( k, 'f', 4)); } } else { - ui->lineEdit_k->setText(qstr + QString::number( k, 'f', 3)); + ui->lineEdit_k->setText(qstr + QString::number( k, 'f', 4)); } // > For T @@ -237,17 +237,17 @@ void CsoneControllerTab::on_set_controller_parameters_button_clicked() if (T < 0.0) { T = 0.0; - ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 3)); + ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 1)); } else if (T > 100.0) { T = 100.0; - ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 3)); + ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 1)); } } else { - ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 3)); + ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 1)); } // > For T @@ -258,17 +258,17 @@ void CsoneControllerTab::on_set_controller_parameters_button_clicked() if (alpha < 0.0) { alpha = 0.0; - ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 3)); + ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 2)); } else if (T > 100.0) { T = 100.0; - ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 3)); + ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 2)); } } else { - ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 3)); + ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 2)); } // Call the function to publish the setpoint @@ -294,7 +294,7 @@ void CsoneControllerTab::publishControllerParamters(float k, float T, float alph this->requestControllerParamterChangePublisher.publish(msg); // Inform the user about the change - ROS_INFO_STREAM("[CSONE CONTROLLER GUI] Published request for setpoint change to: [" << k << ", "<< T << ", "<< alpha << "]"); + ROS_INFO_STREAM("[CSONE CONTROLLER GUI] Published request for new controller parameters (k,T,alpha) = (" << k << ", "<< T << ", "<< alpha << ")"); #else // TO ASSIST WITH DEBUGGING WHEN COMPILED AND RUN IN "QtCreator" QTextStream(stdout) << "[CSONE CONTROLLER GUI] would publish request for: [" << k << ", "<< T << ", "<< alpha << "]"; @@ -303,25 +303,25 @@ void CsoneControllerTab::publishControllerParamters(float k, float T, float alph -//void CsoneControllerTab::on_lineEdit_k_returnPressed() -//{ -// ui->set_setpoint_button->animateClick(); -//} +void CsoneControllerTab::on_lineEdit_k_returnPressed() +{ + ui->set_controller_parameters_button->animateClick(); +} -//void CsoneControllerTab::on_lineEdit_T_returnPressed() -//{ -// ui->set_setpoint_button->animateClick(); -//} +void CsoneControllerTab::on_lineEdit_T_returnPressed() +{ + ui->set_controller_parameters_button->animateClick(); +} -//void CsoneControllerTab::on_lineEdit_alpha_returnPressed() -//{ -// ui->set_setpoint_button->animateClick(); -//} +void CsoneControllerTab::on_lineEdit_alpha_returnPressed() +{ + ui->set_controller_parameters_button->animateClick(); +} -//void CsoneControllerTab::on_lineEdit_step_size_returnPressed() -//{ -// ui->set_setpoint_button->animateClick(); -//} +void CsoneControllerTab::on_lineEdit_step_size_returnPressed() +{ + ui->set_controller_parameters_button->animateClick(); +}