diff --git a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/forms/mainwindow.ui b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/forms/mainwindow.ui index e848317a9561d340ffe22e4156c7c15d4f270e0b..faec75cbad2346e7b65a49e0135356bdec56791e 100644 --- a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/forms/mainwindow.ui +++ b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/forms/mainwindow.ui @@ -215,6 +215,8 @@ <addaction name="action_showHideController_picker"/> <addaction name="action_showHideController_tuning"/> <addaction name="action_showHideController_template"/> + <addaction name="separator"/> + <addaction name="action_testMotors"/> </widget> <addaction name="menuFile"/> <addaction name="menuLoad_YAML"/> @@ -313,6 +315,11 @@ <string>Template</string> </property> </action> + <action name="action_testMotors"> + <property name="text"> + <string>TestMotors</string> + </property> + </action> </widget> <layoutdefault spacing="6" margin="11"/> <customwidgets> diff --git a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/Constants_for_Qt_compile.h b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/Constants_for_Qt_compile.h index a6d8f5584ef4b07122c32857256b9a206e8b4b47..eef6cc15a416eb4733ee756e6600728042bb68ca 100644 --- a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/Constants_for_Qt_compile.h +++ b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/Constants_for_Qt_compile.h @@ -132,6 +132,8 @@ #define CMD_CRAZYFLY_LAND 12 #define CMD_CRAZYFLY_MOTORS_OFF 13 +#define CMD_USE_TESTMOTORS_CONTROLLER 21 + // Flying states #define STATE_MOTORS_OFF 1 #define STATE_TAKE_OFF 2 @@ -208,4 +210,4 @@ // ---------------------------------------------------------------------------------- // For standard buttons in the GUI -#define REQUEST_DEFAULT_SETPOINT_BUTTON_ID 100 \ No newline at end of file +#define REQUEST_DEFAULT_SETPOINT_BUTTON_ID 100 diff --git a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/enablecontrollerloadyamlbar.h b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/enablecontrollerloadyamlbar.h index 3ffd3ff9f83268b23da78a423237137f1a81a7c9..7f244e21e16601818527d4c2567639c9a6d10041 100644 --- a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/enablecontrollerloadyamlbar.h +++ b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/enablecontrollerloadyamlbar.h @@ -94,6 +94,8 @@ public: void showHideController_tuning_changed(); void showHideController_template_changed(); + void testMotors_changed(); + public slots: void setAgentIDsToCoordinate(QVector<int> agentIDs , bool shouldCoordinateAll); diff --git a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/mainwindow.h b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/mainwindow.h index 916869bd8ed40c3807059ec66cfe184db17b2f5f..ac58d99105d135c7ac51de528a5177f93e764347 100644 --- a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/mainwindow.h +++ b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/include/mainwindow.h @@ -133,6 +133,8 @@ private slots: void on_action_showHideController_tuning_changed(); void on_action_showHideController_template_changed(); + void on_action_testMotors_changed(); + }; #endif // MAINWINDOW_H diff --git a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/enablecontrollerloadyamlbar.cpp b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/enablecontrollerloadyamlbar.cpp index d5389a8bf817fb1bbaf74c9c4404151a614650b2..d0eea455fe9cfb114f7dedfb18731588538ac5f3 100644 --- a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/enablecontrollerloadyamlbar.cpp +++ b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/enablecontrollerloadyamlbar.cpp @@ -116,6 +116,20 @@ void EnableControllerLoadYamlBar::showHideController_template_changed() +// TEST MOTORS + +void EnableControllerLoadYamlBar::testMotors_changed() +{ +#ifdef CATKIN_MAKE + dfall_pkg::IntWithHeader msg; + fillIntMessageHeader(msg); + msg.data = CMD_USE_TESTMOTORS_CONTROLLER; + this->commandPublisher.publish(msg); + ROS_INFO("[ENABLE CONTROLLER LOAD YAML GUI BAR] Enable Test Motors Controller"); +#endif +} + + // ENABLE CONTROLLER BUTTONS ON-CLICK CALLBACK diff --git a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/mainwindow.cpp b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/mainwindow.cpp index 0a523fe34ee7aa2199456e18ef1cea04d7fa64e9..296e5d25ad356087fc87a8bb0d2cac2d55af9f7a 100644 --- a/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/mainwindow.cpp +++ b/dfall_ws/src/dfall_pkg/GUI_Qt/flyingAgentGUI/src/mainwindow.cpp @@ -253,6 +253,16 @@ void MainWindow::on_action_showHideController_template_changed() } +void MainWindow::on_action_testMotors_changed() +{ +#ifdef CATKIN_MAKE + // Inform the user that the menu item was selected + ROS_INFO("[FLYING AGENT GUI MAIN WINDOW] Test Motors Menu Item clicked in Main Window."); +#endif + // Notify the UI elements of this change + ui->customWidget_enableControllerLoadYamlBar->testMotors_changed(); +} + // ---------------------------------------------------------------------------------- // III DDDD &&& TTTTT Y Y PPPP EEEEE diff --git a/dfall_ws/src/dfall_pkg/include/nodes/Constants.h b/dfall_ws/src/dfall_pkg/include/nodes/Constants.h index 0843e1a25220581d77dc5ad49472c6ff2b8b257a..76a9ff0b509333f9eb09f65f085e98ff63904fa9 100644 --- a/dfall_ws/src/dfall_pkg/include/nodes/Constants.h +++ b/dfall_ws/src/dfall_pkg/include/nodes/Constants.h @@ -145,6 +145,8 @@ #define CMD_CRAZYFLY_LAND 12 #define CMD_CRAZYFLY_MOTORS_OFF 13 +#define CMD_USE_TESTMOTORS_CONTROLLER 21 + // Flying states #define STATE_MOTORS_OFF 1 #define STATE_TAKE_OFF 2