diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/controllertabs.ui b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/controllertabs.ui index c1f3085fb22aa85236d51053a9d607d13a30dae9..b847e0361f0a11130f7869bdf0436a0b0b2ee5d2 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/controllertabs.ui +++ b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/controllertabs.ui @@ -28,7 +28,7 @@ <item row="0" column="0"> <widget class="QTabWidget" name="controller_tabs_widget"> <property name="currentIndex"> - <number>3</number> + <number>2</number> </property> <widget class="QWidget" name="default_tab"> <attribute name="title"> @@ -36,7 +36,7 @@ </attribute> <layout class="QGridLayout" name="gridLayout_2"> <item row="0" column="0"> - <widget class="DefaultControllerTab" name="widget" native="true"/> + <widget class="DefaultControllerTab" name="default_controller_tab_widget" native="true"/> </item> </layout> </widget> @@ -46,7 +46,7 @@ </attribute> <layout class="QGridLayout" name="gridLayout_4"> <item row="0" column="0"> - <widget class="StudentControllerTab" name="widget_3" native="true"/> + <widget class="StudentControllerTab" name="student_controller_tab_widget" native="true"/> </item> </layout> </widget> diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/defaultcontrollertab.ui b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/defaultcontrollertab.ui index fc0b70b382b9b3a6567b6a31db30dfdb0d0dc450..46a0ee5568180aae2867a2680d4a4579ff51186a 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/defaultcontrollertab.ui +++ b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/defaultcontrollertab.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>1545</width> - <height>632</height> + <width>1633</width> + <height>765</height> </rect> </property> <property name="font"> @@ -19,7 +19,7 @@ <string>Form</string> </property> <layout class="QGridLayout" name="gridLayout"> - <item row="2" column="10"> + <item row="3" column="11"> <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Horizontal</enum> @@ -32,7 +32,7 @@ </property> </spacer> </item> - <item row="5" column="2"> + <item row="6" column="3"> <widget class="QLineEdit" name="lineEdit_setpoint_current_yaw"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -59,7 +59,7 @@ </property> </widget> </item> - <item row="4" column="0"> + <item row="5" column="1"> <widget class="QLabel" name="label_row_z"> <property name="maximumSize"> <size> @@ -75,7 +75,7 @@ </property> </widget> </item> - <item row="4" column="3"> + <item row="5" column="4"> <widget class="QLineEdit" name="lineEdit_setpoint_new_z"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -99,20 +99,7 @@ </property> </widget> </item> - <item row="7" column="0"> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="1"> + <item row="3" column="2"> <widget class="QLineEdit" name="lineEdit_error_x"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -139,7 +126,7 @@ </property> </widget> </item> - <item row="0" column="1"> + <item row="0" column="2"> <widget class="QLabel" name="label_error_title"> <property name="maximumSize"> <size> @@ -161,7 +148,7 @@ </property> </widget> </item> - <item row="2" column="3"> + <item row="3" column="4"> <widget class="QLineEdit" name="lineEdit_setpoint_new_x"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -185,7 +172,7 @@ </property> </widget> </item> - <item row="2" column="4"> + <item row="3" column="5"> <spacer name="horizontalSpacer_2"> <property name="orientation"> <enum>Qt::Horizontal</enum> @@ -201,12 +188,12 @@ </property> </spacer> </item> - <item row="4" column="7"> + <item row="5" column="8"> <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> <widget class="QPushButton" name="z_increment_minus_button"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -225,7 +212,7 @@ <item> <widget class="QLineEdit" name="lineEdit_setpoint_increment_z"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -246,7 +233,7 @@ <item> <widget class="QPushButton" name="z_increment_plus_button"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -264,7 +251,7 @@ </item> </layout> </item> - <item row="3" column="0"> + <item row="4" column="1"> <widget class="QLabel" name="label_row_y"> <property name="maximumSize"> <size> @@ -280,7 +267,7 @@ </property> </widget> </item> - <item row="2" column="0"> + <item row="3" column="1"> <widget class="QLabel" name="label_row_x"> <property name="maximumSize"> <size> @@ -296,12 +283,12 @@ </property> </widget> </item> - <item row="3" column="7"> + <item row="4" column="8"> <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> <widget class="QPushButton" name="y_increment_minus_button"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -320,7 +307,7 @@ <item> <widget class="QLineEdit" name="lineEdit_setpoint_increment_y"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -341,7 +328,7 @@ <item> <widget class="QPushButton" name="y_increment_plus_button"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -359,7 +346,7 @@ </item> </layout> </item> - <item row="3" column="3"> + <item row="4" column="4"> <widget class="QLineEdit" name="lineEdit_setpoint_new_y"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -383,7 +370,7 @@ </property> </widget> </item> - <item row="3" column="1"> + <item row="4" column="2"> <widget class="QLineEdit" name="lineEdit_error_y"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -410,12 +397,12 @@ </property> </widget> </item> - <item row="5" column="7"> + <item row="6" column="8"> <layout class="QHBoxLayout" name="horizontalLayout"> <item> <widget class="QPushButton" name="yaw_increment_minus_button"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -434,7 +421,7 @@ <item> <widget class="QLineEdit" name="lineEdit_setpoint_increment_yaw"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -455,7 +442,7 @@ <item> <widget class="QPushButton" name="yaw_increment_plus_button"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -473,7 +460,7 @@ </item> </layout> </item> - <item row="0" column="7"> + <item row="0" column="8"> <widget class="QLabel" name="label_increment_title"> <property name="maximumSize"> <size> @@ -495,7 +482,7 @@ </property> </widget> </item> - <item row="1" column="3"> + <item row="2" column="4"> <widget class="QLabel" name="label_new_title_line2"> <property name="maximumSize"> <size> @@ -511,7 +498,7 @@ </property> </widget> </item> - <item row="3" column="2"> + <item row="4" column="3"> <widget class="QLineEdit" name="lineEdit_setpoint_current_y"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -538,7 +525,7 @@ </property> </widget> </item> - <item row="2" column="2"> + <item row="3" column="3"> <widget class="QLineEdit" name="lineEdit_setpoint_current_x"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -565,7 +552,7 @@ </property> </widget> </item> - <item row="1" column="2"> + <item row="2" column="3"> <widget class="QLabel" name="label_current_title_line2"> <property name="maximumSize"> <size> @@ -581,7 +568,7 @@ </property> </widget> </item> - <item row="4" column="2"> + <item row="5" column="3"> <widget class="QLineEdit" name="lineEdit_setpoint_current_z"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -608,7 +595,7 @@ </property> </widget> </item> - <item row="4" column="1"> + <item row="5" column="2"> <widget class="QLineEdit" name="lineEdit_error_z"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -635,7 +622,7 @@ </property> </widget> </item> - <item row="5" column="1"> + <item row="6" column="2"> <widget class="QLineEdit" name="lineEdit_error_yaw"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -662,7 +649,7 @@ </property> </widget> </item> - <item row="5" column="0"> + <item row="6" column="1"> <widget class="QLabel" name="label_row_yaw"> <property name="maximumSize"> <size> @@ -678,7 +665,7 @@ </property> </widget> </item> - <item row="1" column="1"> + <item row="2" column="2"> <widget class="QLabel" name="label_error_title_line2"> <property name="maximumSize"> <size> @@ -687,19 +674,19 @@ </size> </property> <property name="text"> - <string>(meas-ref)</string> + <string>meas-ref</string> </property> <property name="alignment"> <set>Qt::AlignCenter</set> </property> </widget> </item> - <item row="2" column="7"> + <item row="3" column="8"> <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> <widget class="QPushButton" name="x_increment_minus_button"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -718,7 +705,7 @@ <item> <widget class="QLineEdit" name="lineEdit_setpoint_increment_x"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -739,7 +726,7 @@ <item> <widget class="QPushButton" name="x_increment_plus_button"> <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -757,7 +744,7 @@ </item> </layout> </item> - <item row="0" column="2"> + <item row="0" column="3"> <widget class="QLabel" name="label_current_title"> <property name="maximumSize"> <size> @@ -779,7 +766,7 @@ </property> </widget> </item> - <item row="1" column="7"> + <item row="2" column="8"> <widget class="QLabel" name="label_increment_title_line2"> <property name="maximumSize"> <size> @@ -795,7 +782,7 @@ </property> </widget> </item> - <item row="5" column="3"> + <item row="6" column="4"> <widget class="QLineEdit" name="lineEdit_setpoint_new_yaw"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -819,7 +806,7 @@ </property> </widget> </item> - <item row="0" column="3"> + <item row="0" column="4"> <widget class="QLabel" name="label_new_title"> <property name="maximumSize"> <size> @@ -841,7 +828,7 @@ </property> </widget> </item> - <item row="6" column="2"> + <item row="7" column="3"> <widget class="QPushButton" name="default_setpoint_button"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -860,7 +847,7 @@ </property> </widget> </item> - <item row="6" column="3"> + <item row="7" column="4"> <widget class="QPushButton" name="set_setpoint_button"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> @@ -879,6 +866,206 @@ </property> </widget> </item> + <item row="3" column="0"> + <widget class="QLineEdit" name="lineEdit_measured_x"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>180</width> + <height>60</height> + </size> + </property> + <property name="font"> + <font> + <family>Courier</family> + </font> + </property> + <property name="text"> + <string>xx.xx</string> + </property> + </widget> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_measured_title"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Measured</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_measured_title_line2"> + <property name="text"> + <string>Position</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLineEdit" name="lineEdit_measured_y"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>180</width> + <height>60</height> + </size> + </property> + <property name="font"> + <font> + <family>Courier</family> + </font> + </property> + <property name="text"> + <string>xx.xx</string> + </property> + </widget> + </item> + <item row="7" column="1"> + <widget class="QLabel" name="label_row_pitch"> + <property name="text"> + <string>pitch [deg]</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLineEdit" name="lineEdit_measured_z"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>180</width> + <height>60</height> + </size> + </property> + <property name="font"> + <font> + <family>Courier</family> + </font> + </property> + <property name="text"> + <string>xx.xx</string> + </property> + </widget> + </item> + <item row="8" column="1"> + <widget class="QLabel" name="label_row_roll"> + <property name="text"> + <string>roll [deg]</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="6" column="0"> + <widget class="QLineEdit" name="lineEdit_measured_yaw"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>180</width> + <height>60</height> + </size> + </property> + <property name="font"> + <font> + <family>Courier</family> + </font> + </property> + <property name="text"> + <string>xx.xx</string> + </property> + </widget> + </item> + <item row="7" column="0"> + <widget class="QLineEdit" name="lineEdit_measured_pitch"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>180</width> + <height>60</height> + </size> + </property> + <property name="font"> + <font> + <family>Courier</family> + </font> + </property> + <property name="text"> + <string>xx.xx</string> + </property> + </widget> + </item> + <item row="8" column="0"> + <widget class="QLineEdit" name="lineEdit_measured_roll"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>180</width> + <height>60</height> + </size> + </property> + <property name="font"> + <font> + <family>Courier</family> + </font> + </property> + <property name="text"> + <string>xx.xx</string> + </property> + </widget> + </item> + <item row="9" column="0"> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> </layout> </widget> <resources/> diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/studentcontrollertab.ui b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/studentcontrollertab.ui index f72ca16647c317a1091bc75299e98cb992b22296..0360a46ed15cb788964dbe9bd8219edd707d4dbf 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/studentcontrollertab.ui +++ b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/forms/studentcontrollertab.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>1366</width> - <height>703</height> + <width>1631</width> + <height>760</height> </rect> </property> <property name="font"> @@ -19,6 +19,16 @@ <string>Form</string> </property> <layout class="QGridLayout" name="gridLayout"> + <item row="1" column="6"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Setpoint</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> <item row="7" column="1"> <widget class="QLabel" name="label_row_pitch"> <property name="maximumSize"> @@ -57,6 +67,9 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="2" column="0"> @@ -81,9 +94,12 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> - <item row="2" column="5"> + <item row="2" column="7"> <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Horizontal</enum> @@ -97,7 +113,7 @@ </spacer> </item> <item row="8" column="0"> - <widget class="QLineEdit" name="lineEdit_measured_yaw_2"> + <widget class="QLineEdit" name="lineEdit_measured_roll"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -118,6 +134,9 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="9" column="0"> @@ -155,6 +174,9 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="3" column="1"> @@ -174,7 +196,7 @@ </widget> </item> <item row="2" column="3"> - <widget class="QLineEdit" name="lineEdit_current_x"> + <widget class="QLineEdit" name="lineEdit_setpoint_current_x"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -195,6 +217,9 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="4" column="1"> @@ -235,6 +260,9 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="1" column="0"> @@ -269,6 +297,9 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="5" column="1"> @@ -309,6 +340,9 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="5" column="2"> @@ -333,6 +367,9 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="2" column="1"> @@ -405,6 +442,9 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="3" column="2"> @@ -429,10 +469,13 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="2" column="4"> - <widget class="QLineEdit" name="lineEdit_new_x"> + <widget class="QLineEdit" name="lineEdit_setpoint_new_x"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -453,7 +496,7 @@ </widget> </item> <item row="3" column="3"> - <widget class="QLineEdit" name="lineEdit_current_y"> + <widget class="QLineEdit" name="lineEdit_setpoint_current_y"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -474,10 +517,13 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="4" column="3"> - <widget class="QLineEdit" name="lineEdit_current_z"> + <widget class="QLineEdit" name="lineEdit_setpoint_current_z"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -498,10 +544,13 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="5" column="3"> - <widget class="QLineEdit" name="lineEdit_current_yaw"> + <widget class="QLineEdit" name="lineEdit_setpoint_current_yaw"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -522,10 +571,13 @@ <property name="text"> <string>xx.xx</string> </property> + <property name="readOnly"> + <bool>true</bool> + </property> </widget> </item> <item row="3" column="4"> - <widget class="QLineEdit" name="lineEdit_new_y"> + <widget class="QLineEdit" name="lineEdit_setpoint_new_y"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -546,7 +598,7 @@ </widget> </item> <item row="4" column="4"> - <widget class="QLineEdit" name="lineEdit_new_z"> + <widget class="QLineEdit" name="lineEdit_setpoint_new_z"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -567,7 +619,7 @@ </widget> </item> <item row="5" column="4"> - <widget class="QLineEdit" name="lineEdit_new_yaw"> + <widget class="QLineEdit" name="lineEdit_setpoint_new_yaw"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <horstretch>0</horstretch> @@ -644,7 +696,7 @@ <item row="1" column="2"> <widget class="QLabel" name="label_error_title_line2"> <property name="text"> - <string>(meas - ref)</string> + <string>meas-ref</string> </property> <property name="alignment"> <set>Qt::AlignCenter</set> @@ -703,6 +755,269 @@ </property> </widget> </item> + <item row="2" column="5"> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="6"> + <widget class="QLabel" name="label_2"> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Increment</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item row="2" column="6"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QPushButton" name="x_increment_minus_button"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>60</width> + <height>60</height> + </size> + </property> + <property name="text"> + <string>-</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEdit_setpoint_increment_x"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>140</width> + <height>60</height> + </size> + </property> + <property name="font"> + <font> + <family>Courier</family> + </font> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="x_increment_plus_button"> + <property name="maximumSize"> + <size> + <width>60</width> + <height>60</height> + </size> + </property> + <property name="text"> + <string>+</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="3" column="6"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QPushButton" name="y_increment_minus_button"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>60</width> + <height>60</height> + </size> + </property> + <property name="text"> + <string>-</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEdit_setpoint_increment_y"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>140</width> + <height>60</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="y_increment_plus_button"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>60</width> + <height>60</height> + </size> + </property> + <property name="text"> + <string>+</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="4" column="6"> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QPushButton" name="z_increment_minus_button"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>60</width> + <height>60</height> + </size> + </property> + <property name="text"> + <string>-</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEdit_setpoint_increment_z"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>140</width> + <height>60</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="z_increment_plus_button"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>60</width> + <height>60</height> + </size> + </property> + <property name="text"> + <string>+</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="5" column="6"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <widget class="QPushButton" name="yaw_increment_minus_button"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>60</width> + <height>60</height> + </size> + </property> + <property name="text"> + <string>-</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEdit_setpoint_increment_yaw"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>140</width> + <height>60</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="yaw_increment_plus_button"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>60</width> + <height>60</height> + </size> + </property> + <property name="text"> + <string>+</string> + </property> + </widget> + </item> + </layout> + </item> </layout> </widget> <resources/> diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/controllertabs.h b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/controllertabs.h index 3ce7749754833f1c8d0bae089553dec71bee9520..35cb217861406c4d6507db25e81b81aa7f56cc3d 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/controllertabs.h +++ b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/controllertabs.h @@ -2,6 +2,34 @@ #define CONTROLLERTABS_H #include <QWidget> +#include <QVector> + +#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 "d_fall_pps/IntWithHeader.h" +//#include "d_fall_pps/SetpointWithHeader.h" +#include "d_fall_pps/CrazyflieData.h" + +// Include the shared definitions +//#include "nodes/Constants.h" + +// SPECIFY THE PACKAGE NAMESPACE +//using namespace d_fall_pps; + +#else +// Include the shared definitions +//#include "include/Constants_for_Qt_compile.h" + +#endif namespace Ui { class ControllerTabs; @@ -15,8 +43,35 @@ public: explicit ControllerTabs(QWidget *parent = 0); ~ControllerTabs(); + +signals: + void measuredPoseValueChanged(QVector<float> measuredPose); + + private: Ui::ControllerTabs *ui; + + +#ifdef CATKIN_MAKE + // --------------------------------------------------- // + // PRIVATE VARIABLES FOR ROS + + // SUBSRIBER + // > For the pose data from a motion capture system + ros::Subscriber poseDataSubscriber; + + + // --------------------------------------------------- // + // PRIVATE CALLBACKS IN RESPONSE TO ROS MESSAGES + + // > For the controller currently operating, received on + // "controllerUsedSubscriber" + void poseDataReceivedCallback(const d_fall_pps::CrazyflieData& msg); + + +#endif + + }; #endif // CONTROLLERTABS_H diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/defaultcontrollertab.h b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/defaultcontrollertab.h index 33ad470c576f5c358475a5c3d9dea3110ab2d214..6e95ea70a886a636ab9b6c683b65e30672cc4b4f 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/defaultcontrollertab.h +++ b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/defaultcontrollertab.h @@ -2,8 +2,35 @@ #define DEFAULTCONTROLLERTAB_H #include <QWidget> +#include <QVector> #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 "d_fall_pps/IntWithHeader.h" +#include "d_fall_pps/SetpointWithHeader.h" + +// Include the shared definitions +#include "nodes/Constants.h" + +// SPECIFY THE PACKAGE NAMESPACE +//using namespace d_fall_pps; + +#else +// Include the shared definitions +//#include "include/Constants_for_Qt_compile.h" + +#endif + namespace Ui { class DefaultControllerTab; } @@ -16,6 +43,11 @@ public: explicit DefaultControllerTab(QWidget *parent = 0); ~DefaultControllerTab(); + +public slots: + void setMeasuredPose(QVector<float> measuredPose); + + private slots: void on_lineEdit_setpoint_new_x_returnPressed(); void on_lineEdit_setpoint_new_y_returnPressed(); @@ -24,8 +56,26 @@ private slots: void on_set_setpoint_button_clicked(); + void on_default_setpoint_button_clicked(); + + void on_x_increment_plus_button_clicked(); + void on_x_increment_minus_button_clicked(); + void on_y_increment_plus_button_clicked(); + void on_y_increment_minus_button_clicked(); + void on_z_increment_plus_button_clicked(); + void on_z_increment_minus_button_clicked(); + void on_yaw_increment_plus_button_clicked(); + void on_yaw_increment_minus_button_clicked(); + private: Ui::DefaultControllerTab *ui; + +#ifdef CATKIN_MAKE + SetpointWithHeader m_defaultSetpoint; +#endif + + void publishSetpoint(float x, float y, float z, float yaw); + }; #endif // DEFAULTCONTROLLERTAB_H diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/studentcontrollertab.h b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/studentcontrollertab.h index a56804fd88bfa5e976f452d217fbeb569813feb8..01af34d82219ec6d3484e2b39b3dea4b855ad478 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/studentcontrollertab.h +++ b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/include/studentcontrollertab.h @@ -2,6 +2,35 @@ #define STUDENTCONTROLLERTAB_H #include <QWidget> +#include <QVector> +#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 "d_fall_pps/IntWithHeader.h" +#include "d_fall_pps/SetpointWithHeader.h" + +// Include the shared definitions +#include "nodes/Constants.h" + +// SPECIFY THE PACKAGE NAMESPACE +//using namespace d_fall_pps; + +#else +// Include the shared definitions +//#include "include/Constants_for_Qt_compile.h" + +#endif + namespace Ui { class StudentControllerTab; @@ -15,6 +44,11 @@ public: explicit StudentControllerTab(QWidget *parent = 0); ~StudentControllerTab(); + +public slots: + void setMeasuredPose(QVector<float> measuredPose); + + private: Ui::StudentControllerTab *ui; }; diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/controllertabs.cpp b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/controllertabs.cpp index 9c7e79ab75582c577a45fa13a51ec684fe858d4b..4340091b0c92fcbd5a58137e78ed4fb75a6b60a0 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/controllertabs.cpp +++ b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/controllertabs.cpp @@ -6,9 +6,49 @@ ControllerTabs::ControllerTabs(QWidget *parent) : ui(new Ui::ControllerTabs) { ui->setupUi(this); + + + + // CONNECT THE "MEASURED POST" SIGNAL TO EACH OF + // THE TABS + // i.e., connect the "measured pose value changed" + // signal to the "set measured pose" slots + QObject::connect( + this , &ControllerTabs::measuredPoseValueChanged , + ui->default_controller_tab_widget , &DefaultControllerTab::setMeasuredPose + ); + + QObject::connect( + this , &ControllerTabs::measuredPoseValueChanged , + ui->student_controller_tab_widget , &StudentControllerTab::setMeasuredPose + ); + } ControllerTabs::~ControllerTabs() { delete ui; } + + + +#ifdef CATKIN_MAKE +// > For the controller currently operating, received on +// "controllerUsedSubscriber" +void poseDataReceivedCallback(const d_fall_pps::CrazyflieData& msg) +{ + // Initialise a Qvector to sending around + QVector<float> poseDataForSignal; + // Fill in the data + poseDataForSignal.push_back(msg.x); + poseDataForSignal.push_back(msg.y); + poseDataForSignal.push_back(msg.z); + poseDataForSignal.push_back(msg.roll); + poseDataForSignal.push_back(msg.pitch); + poseDataForSignal.push_back(msg.yaw); + // Emit the signal + emit measuredPoseValueChanged(poseDataForSignal); + + +} +#endif diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/defaultcontrollertab.cpp b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/defaultcontrollertab.cpp index 274304500eaf19ebe7d2c360095b86b1186f1753..f2b759d73203684709d845c57a65b7f00922016d 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/defaultcontrollertab.cpp +++ b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/defaultcontrollertab.cpp @@ -6,6 +6,16 @@ DefaultControllerTab::DefaultControllerTab(QWidget *parent) : ui(new Ui::DefaultControllerTab) { ui->setupUi(this); + + + +#ifdef CATKIN_MAKE + m_defaultSetpoint.x = 0.0f; + m_defaultSetpoint.y = 0.0f; + m_defaultSetpoint.z = 0.5f; + m_defaultSetpoint.yaw = 0.0f; +#endif + } DefaultControllerTab::~DefaultControllerTab() @@ -13,6 +23,60 @@ DefaultControllerTab::~DefaultControllerTab() delete ui; } + +void DefaultControllerTab::setMeasuredPose(QVector<float> measuredPose) +{ + // UPDATE THE MEASUREMENT COLUMN + ui->lineEdit_measured_x ->setText(QString::number( measuredPose[0] )); + ui->lineEdit_measured_y ->setText(QString::number( measuredPose[1] )); + ui->lineEdit_measured_z ->setText(QString::number( measuredPose[2] )); + ui->lineEdit_measured_roll ->setText(QString::number( measuredPose[3] )); + ui->lineEdit_measured_pitch->setText(QString::number( measuredPose[4] )); + ui->lineEdit_measured_yaw ->setText(QString::number( measuredPose[5] )); + + // GET THE CURRENT SETPOINT + float curr_x_setpoint = (ui->lineEdit_setpoint_current_x->text() ).toFloat();; + float curr_y_setpoint = (ui->lineEdit_setpoint_current_y->text() ).toFloat();; + float curr_z_setpoint = (ui->lineEdit_setpoint_current_z->text() ).toFloat();; + float curr_yaw_setpoint = (ui->lineEdit_setpoint_current_yaw->text()).toFloat();; + + // UPDATE THE ERROR COLUMN + ui->lineEdit_error_x ->setText(QString::number( measuredPose[0] - curr_x_setpoint )); + ui->lineEdit_error_y ->setText(QString::number( measuredPose[1] - curr_y_setpoint )); + ui->lineEdit_error_z ->setText(QString::number( measuredPose[2] - curr_z_setpoint )); + ui->lineEdit_error_yaw->setText(QString::number( measuredPose[5] - curr_yaw_setpoint )); +} + + + +void publishSetpoint(float x, float y, float z, float yaw) +{ +#ifdef CATKIN_MAKE + // Initialise the message as a local variable + SetpointWithHeader msg; + + // Fill the header of the message + fillSetpointHeader( msg ); + + // Fill in the (x,y,z,yaw) values + msg.x = x; + msg.y = y; + msg.z = z; + msg.yaw = yaw; + + // Publish the setpoint + this->controllerSetpointPublisher.publish(msg); + + // Inform the user about the change + ROS_INFO_STREAM("[DEFAULT CONTROLLER GUI] Published request for setpoint request for: [" << x << ", "<< y << ", "<< z << ", "<< yaw << "]"); +#else + // TO ASSIST WITH DEBUGGING WHEN COMPILED AND RUN IN "QtCreator" + QTextStream(stdout) << "[DEFAULT CONTROLLER GUI] would publish request for: [" << x << ", "<< y << ", "<< z << ", "<< yaw << "]"; +#endif +} + + + void DefaultControllerTab::on_lineEdit_setpoint_new_x_returnPressed() { ui->set_setpoint_button->animateClick(); @@ -41,10 +105,228 @@ void DefaultControllerTab::on_lineEdit_setpoint_new_yaw_returnPressed() void DefaultControllerTab::on_set_setpoint_button_clicked() { - #ifdef CATKIN_MAKE + // Initialise local variable for each of (x,y,z,yaw) + float x = 0.0f, y = 0.0f, z = 0.0f, yaw = 0.0f; + + // Take the new value if available, otherwise use the old value + // > For x + if(!ui->lineEdit_setpoint_new_x->text().isEmpty()) + x = (ui->lineEdit_setpoint_new_x->text()).toFloat(); + else + x = (ui->lineEdit_setpoint_current_x->text()).toFloat(); + // > For x + if(!ui->lineEdit_setpoint_new_y->text().isEmpty()) + y = (ui->lineEdit_setpoint_new_y->text()).toFloat(); + else + y = (ui->lineEdit_setpoint_current_y->text()).toFloat(); + // > For x + if(!ui->lineEdit_setpoint_new_z->text().isEmpty()) + z = (ui->lineEdit_setpoint_new_z->text()).toFloat(); + else + z = (ui->lineEdit_setpoint_current_z->text()).toFloat(); + // > For x + if(!ui->lineEdit_setpoint_new_yaw->text().isEmpty()) + yaw = (ui->lineEdit_setpoint_new_yaw->text()).toFloat(); + else + yaw = (ui->lineEdit_setpoint_current_yaw->text()).toFloat(); + + // Call the function to publish the setpoint + publishSetpoint(x,y,z,yaw); + #else // TO ASSIST WITH DEBUGGING WHEN COMPILED AND RUN IN "QtCreator" QTextStream(stdout) << "[DEFAULT CONTROLLER TAB] set setpoint button clicked"; #endif } + +void DefaultControllerTab::on_default_setpoint_button_clicked() +{ +#ifdef CATKIN_MAKE + // Call the function to publish the setpoint + publishSetpoint(m_defaultSetpoint.x, m_defaultSetpoint.y, m_defaultSetpoint.z, m_defaultSetpoint.yaw ); +#endif +} + +void DefaultControllerTab::on_x_increment_plus_button_clicked() +{ +#ifdef CATKIN_MAKE + // Only need to do something if the field is not empty + if(!ui->lineEdit_setpoint_increment_x->text().isEmpty()) + { + // Call the function to publish the setpoint + publishSetpoint( + (ui->lineEdit_setpoint_current_x->text() ).toFloat() + (ui->lineEdit_setpoint_increment_x->text()).toFloat() + (ui->lineEdit_setpoint_current_y->text() ).toFloat() + (ui->lineEdit_setpoint_current_z->text() ).toFloat() + (ui->lineEdit_setpoint_current_yaw->text()).toFloat() + ); + } + else + { + // Inform the user that nothing can be done + ROS_INFO_STREAM("[DEFAULT CONTROLLER GUI] Increment x setpoint clicked but field is empty"); + + } +#endif +} + +void DefaultControllerTab::on_x_increment_minus_button_clicked() +{ +#ifdef CATKIN_MAKE + // Only need to do something if the field is not empty + if(!ui->lineEdit_setpoint_increment_x->text().isEmpty()) + { + // Call the function to publish the setpoint + publishSetpoint( + (ui->lineEdit_setpoint_current_x->text() ).toFloat() - (ui->lineEdit_setpoint_increment_x->text()).toFloat(), + (ui->lineEdit_setpoint_current_y->text() ).toFloat(), + (ui->lineEdit_setpoint_current_z->text() ).toFloat(), + (ui->lineEdit_setpoint_current_yaw->text()).toFloat() + ); + } + else + { + // Inform the user that nothing can be done + ROS_INFO_STREAM("[DEFAULT CONTROLLER GUI] Increment x setpoint clicked but field is empty"); + + } +#endif +} + +void DefaultControllerTab::on_y_increment_plus_button_clicked() +{ +#ifdef CATKIN_MAKE + // Only need to do something if the field is not empty + if(!ui->lineEdit_setpoint_increment_y->text().isEmpty()) + { + // Call the function to publish the setpoint + publishSetpoint( + (ui->lineEdit_setpoint_current_x->text() ).toFloat(), + (ui->lineEdit_setpoint_current_y->text() ).toFloat() + (ui->lineEdit_setpoint_increment_y->text()).toFloat(), + (ui->lineEdit_setpoint_current_z->text() ).toFloat(), + (ui->lineEdit_setpoint_current_yaw->text()).toFloat() + ); + } + else + { + // Inform the user that nothing can be done + ROS_INFO_STREAM("[DEFAULT CONTROLLER GUI] Increment x setpoint clicked but field is empty"); + + } +#endif +} + +void DefaultControllerTab::on_y_increment_minus_button_clicked() +{ +#ifdef CATKIN_MAKE + // Only need to do something if the field is not empty + if(!ui->lineEdit_setpoint_increment_y->text().isEmpty()) + { + // Call the function to publish the setpoint + publishSetpoint( + (ui->lineEdit_setpoint_current_x->text() ).toFloat(), + (ui->lineEdit_setpoint_current_y->text() ).toFloat() - (ui->lineEdit_setpoint_increment_y->text()).toFloat(), + (ui->lineEdit_setpoint_current_z->text() ).toFloat(), + (ui->lineEdit_setpoint_current_yaw->text()).toFloat() + ); + } + else + { + // Inform the user that nothing can be done + ROS_INFO_STREAM("[DEFAULT CONTROLLER GUI] Increment x setpoint clicked but field is empty"); + + } +#endif +} + +void DefaultControllerTab::on_z_increment_plus_button_clicked() +{ +#ifdef CATKIN_MAKE + // Only need to do something if the field is not empty + if(!ui->lineEdit_setpoint_increment_z->text().isEmpty()) + { + // Call the function to publish the setpoint + publishSetpoint( + (ui->lineEdit_setpoint_current_x->text() ).toFloat(), + (ui->lineEdit_setpoint_current_y->text() ).toFloat(), + (ui->lineEdit_setpoint_current_z->text() ).toFloat() + (ui->lineEdit_setpoint_increment_z->text()).toFloat(), + (ui->lineEdit_setpoint_current_yaw->text()).toFloat() + ); + } + else + { + // Inform the user that nothing can be done + ROS_INFO_STREAM("[DEFAULT CONTROLLER GUI] Increment x setpoint clicked but field is empty"); + + } +#endif +} + +void DefaultControllerTab::on_z_increment_minus_button_clicked() +{ +#ifdef CATKIN_MAKE + // Only need to do something if the field is not empty + if(!ui->lineEdit_setpoint_increment_z->text().isEmpty()) + { + // Call the function to publish the setpoint + publishSetpoint( + (ui->lineEdit_setpoint_current_x->text() ).toFloat(), + (ui->lineEdit_setpoint_current_y->text() ).toFloat(), + (ui->lineEdit_setpoint_current_z->text() ).toFloat() - (ui->lineEdit_setpoint_increment_z->text()).toFloat(), + (ui->lineEdit_setpoint_current_yaw->text()).toFloat() + ); + } + else + { + // Inform the user that nothing can be done + ROS_INFO_STREAM("[DEFAULT CONTROLLER GUI] Increment x setpoint clicked but field is empty"); + + } +#endif +} + +void DefaultControllerTab::on_yaw_increment_plus_button_clicked() +{ +#ifdef CATKIN_MAKE + // Only need to do something if the field is not empty + if(!ui->lineEdit_setpoint_increment_yaw->text().isEmpty()) + { + // Call the function to publish the setpoint + publishSetpoint( + (ui->lineEdit_setpoint_current_x->text() ).toFloat(), + (ui->lineEdit_setpoint_current_y->text() ).toFloat(), + (ui->lineEdit_setpoint_current_z->text() ).toFloat(), + (ui->lineEdit_setpoint_current_yaw->text()).toFloat() + (ui->lineEdit_setpoint_increment_yaw->text()).toFloat() + ); + } + else + { + // Inform the user that nothing can be done + ROS_INFO_STREAM("[DEFAULT CONTROLLER GUI] Increment x setpoint clicked but field is empty"); + + } +#endif +} +void DefaultControllerTab::on_yaw_increment_minus_button_clicked() +{ +#ifdef CATKIN_MAKE + // Only need to do something if the field is not empty + if(!ui->lineEdit_setpoint_increment_yaw->text().isEmpty()) + { + // Call the function to publish the setpoint + publishSetpoint( + (ui->lineEdit_setpoint_current_x->text() ).toFloat(), + (ui->lineEdit_setpoint_current_y->text() ).toFloat(), + (ui->lineEdit_setpoint_current_z->text() ).toFloat(), + (ui->lineEdit_setpoint_current_yaw->text()).toFloat() - (ui->lineEdit_setpoint_increment_yaw->text()).toFloat() + ); + } + else + { + // Inform the user that nothing can be done + ROS_INFO_STREAM("[DEFAULT CONTROLLER GUI] Increment x setpoint clicked but field is empty"); + + } +#endif +} diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/studentcontrollertab.cpp b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/studentcontrollertab.cpp index a47ccd3bba935d80816818980ef826ef63829aaa..f3561d0d94ad22de9c1557a665fb2ebeedd51b08 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/studentcontrollertab.cpp +++ b/pps_ws/src/d_fall_pps/GUI_Qt/flyingAgentGUI/src/studentcontrollertab.cpp @@ -12,3 +12,26 @@ StudentControllerTab::~StudentControllerTab() { delete ui; } + +void StudentControllerTab::setMeasuredPose(QVector<float> measuredPose) +{ + // UPDATE THE MEASUREMENT COLUMN + ui->lineEdit_measured_x ->setText(QString::number( measuredPose[0] )); + ui->lineEdit_measured_y ->setText(QString::number( measuredPose[1] )); + ui->lineEdit_measured_z ->setText(QString::number( measuredPose[2] )); + ui->lineEdit_measured_roll ->setText(QString::number( measuredPose[3] )); + ui->lineEdit_measured_pitch->setText(QString::number( measuredPose[4] )); + ui->lineEdit_measured_yaw ->setText(QString::number( measuredPose[5] )); + + // GET THE CURRENT SETPOINT + float curr_x_setpoint = (ui->lineEdit_setpoint_current_x->text() ).toFloat();; + float curr_y_setpoint = (ui->lineEdit_setpoint_current_y->text() ).toFloat();; + float curr_z_setpoint = (ui->lineEdit_setpoint_current_z->text() ).toFloat();; + float curr_yaw_setpoint = (ui->lineEdit_setpoint_current_yaw->text()).toFloat();; + + // UPDATE THE ERROR COLUMN + ui->lineEdit_error_x ->setText(QString::number( measuredPose[0] - curr_x_setpoint )); + ui->lineEdit_error_y ->setText(QString::number( measuredPose[1] - curr_y_setpoint )); + ui->lineEdit_error_z ->setText(QString::number( measuredPose[2] - curr_z_setpoint )); + ui->lineEdit_error_yaw->setText(QString::number( measuredPose[5] - curr_yaw_setpoint )); +} diff --git a/pps_ws/src/d_fall_pps/msg/SetpointWithHeader.msg b/pps_ws/src/d_fall_pps/msg/SetpointWithHeader.msg new file mode 100644 index 0000000000000000000000000000000000000000..9198063bc304eeb821d802752c48b99e2f7402de --- /dev/null +++ b/pps_ws/src/d_fall_pps/msg/SetpointWithHeader.msg @@ -0,0 +1,8 @@ +float64 x +float64 y +float64 z +float64 yaw +bool isChecked +uint32 buttonID +bool shouldCheckForAgentID +uint8[] agentIDs \ No newline at end of file