Commit 3cdac115 authored by pragash1's avatar pragash1
Browse files

Added GUI DroneX Tab

Added necessary files for DroneX Controller
parent 63e4a175
// Copyright (C) 2017, ETH Zurich, D-ITET, Paul Beuchat, Angel Romero // Copyright (C) 2017, ETH Zurich, D-ITET, Paul Beuchat, Angel Romero
// //
// This file is part of D-FaLL-System. // This file is part of D-FaLL-System.
// //
// D-FaLL-System is free software: you can redistribute it and/or modify // D-FaLL-System is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// D-FaLL-System is distributed in the hope that it will be useful, // D-FaLL-System is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with D-FaLL-System. If not, see <http://www.gnu.org/licenses/>. // along with D-FaLL-System. If not, see <http://www.gnu.org/licenses/>.
// //
// //
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// DDDD FFFFF L L SSSS Y Y SSSS TTTTT EEEEE M M // DDDD FFFFF L L SSSS Y Y SSSS TTTTT EEEEE M M
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#define REMOTE_CONTROLLER 5 #define REMOTE_CONTROLLER 5
#define TUNING_CONTROLLER 6 #define TUNING_CONTROLLER 6
#define PICKER_CONTROLLER 7 #define PICKER_CONTROLLER 7
#define DRONEX_CONTROLLER 8
// Commands for CrazyRadio // Commands for CrazyRadio
...@@ -77,6 +78,7 @@ ...@@ -77,6 +78,7 @@
#define CMD_USE_REMOTE_CONTROLLER 5 #define CMD_USE_REMOTE_CONTROLLER 5
#define CMD_USE_TUNING_CONTROLLER 6 #define CMD_USE_TUNING_CONTROLLER 6
#define CMD_USE_PICKER_CONTROLLER 7 #define CMD_USE_PICKER_CONTROLLER 7
#define CMD_USE_DRONEX_CONTROLLER 8
#define CMD_CRAZYFLY_TAKE_OFF 11 #define CMD_CRAZYFLY_TAKE_OFF 11
#define CMD_CRAZYFLY_LAND 12 #define CMD_CRAZYFLY_LAND 12
...@@ -109,6 +111,7 @@ ...@@ -109,6 +111,7 @@
#define LOAD_YAML_REMOTE_CONTROLLER_AGENT 5 #define LOAD_YAML_REMOTE_CONTROLLER_AGENT 5
#define LOAD_YAML_TUNING_CONTROLLER_AGENT 6 #define LOAD_YAML_TUNING_CONTROLLER_AGENT 6
#define LOAD_YAML_PICKER_CONTROLLER_AGENT 7 #define LOAD_YAML_PICKER_CONTROLLER_AGENT 7
#define LOAD_YAML_DRONEX_CONTROLLER_AGENT 8
#define LOAD_YAML_SAFE_CONTROLLER_COORDINATOR 11 #define LOAD_YAML_SAFE_CONTROLLER_COORDINATOR 11
#define LOAD_YAML_DEMO_CONTROLLER_COORDINATOR 12 #define LOAD_YAML_DEMO_CONTROLLER_COORDINATOR 12
...@@ -117,6 +120,8 @@ ...@@ -117,6 +120,8 @@
#define LOAD_YAML_REMOTE_CONTROLLER_COORDINATOR 15 #define LOAD_YAML_REMOTE_CONTROLLER_COORDINATOR 15
#define LOAD_YAML_TUNING_CONTROLLER_COORDINATOR 16 #define LOAD_YAML_TUNING_CONTROLLER_COORDINATOR 16
#define LOAD_YAML_PICKER_CONTROLLER_COORDINATOR 17 #define LOAD_YAML_PICKER_CONTROLLER_COORDINATOR 17
#define LOAD_YAML_DRONEX_CONTROLLER_COORDINATOR 18
// FOR WHICH BUTTON WAS PRESSED IN THE PICKER CONTOLLER // FOR WHICH BUTTON WAS PRESSED IN THE PICKER CONTOLLER
...@@ -188,7 +193,7 @@ private slots: ...@@ -188,7 +193,7 @@ private slots:
void on_enable_tuning_controller_clicked(); void on_enable_tuning_controller_clicked();
void on_enable_picker_controller_clicked(); void on_enable_picker_controller_clicked();
void on_demoButton_1_clicked(); void on_demoButton_1_clicked();
void on_demoButton_2_clicked(); void on_demoButton_2_clicked();
...@@ -235,6 +240,11 @@ private slots: ...@@ -235,6 +240,11 @@ private slots:
// > For the dial // > For the dial
void on_picker_yaw_dial_valueChanged(int value); void on_picker_yaw_dial_valueChanged(int value);
// Interationswith the DroneX controller tab
void on_dronex_take_off_button_clicked();
void on_dronex_land_button_clicked();
...@@ -322,6 +332,10 @@ private: ...@@ -322,6 +332,10 @@ private:
ros::Publisher tuningVerticalGainPublisher; ros::Publisher tuningVerticalGainPublisher;
ros::Publisher tuningHeadingGainPublisher; ros::Publisher tuningHeadingGainPublisher;
// > For the DRONEX CONTROLLER
ros::Publisher droneXSetpointPublisher;
ros::Subscriber droneXSetpointSubscriber;
// > For the PICKER CONTROLLER // > For the PICKER CONTROLLER
...@@ -370,7 +384,7 @@ private: ...@@ -370,7 +384,7 @@ private:
void studentSetpointCallback(const Setpoint& newSetpoint); void studentSetpointCallback(const Setpoint& newSetpoint);
void mpcSetpointCallback(const Setpoint& newSetpoint); void mpcSetpointCallback(const Setpoint& newSetpoint);
void pickerSetpointCallback(const Setpoint& newSetpoint); void pickerSetpointCallback(const Setpoint& newSetpoint);
void remoteDataCallback(const CrazyflieData& objectData); void remoteDataCallback(const CrazyflieData& objectData);
void remoteControlSetpointCallback(const CrazyflieData& setpointData); void remoteControlSetpointCallback(const CrazyflieData& setpointData);
...@@ -378,7 +392,7 @@ private: ...@@ -378,7 +392,7 @@ private:
// > For actually sending the button message // > For actually sending the button message
void send_picker_button_clicked_message(int button_index); void send_picker_button_clicked_message(int button_index);
void DBChangedCallback(const std_msgs::Int32& msg); void DBChangedCallback(const std_msgs::Int32& msg);
...@@ -390,7 +404,7 @@ private: ...@@ -390,7 +404,7 @@ private:
void remoteYamlFileTimerCallback(const ros::TimerEvent&); void remoteYamlFileTimerCallback(const ros::TimerEvent&);
void tuningYamlFileTimerCallback(const ros::TimerEvent&); void tuningYamlFileTimerCallback(const ros::TimerEvent&);
void pickerYamlFileTimerCallback(const ros::TimerEvent&); void pickerYamlFileTimerCallback(const ros::TimerEvent&);
void requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::Int32& msg); void requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::Int32& msg);
......
// Copyright (C) 2017, ETH Zurich, D-ITET, Paul Beuchat, Angel Romero // Copyright (C) 2017, ETH Zurich, D-ITET, Paul Beuchat, Angel Romero
// //
// This file is part of D-FaLL-System. // This file is part of D-FaLL-System.
// //
// D-FaLL-System is free software: you can redistribute it and/or modify // D-FaLL-System is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by // it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or // the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. // (at your option) any later version.
// //
// D-FaLL-System is distributed in the hope that it will be useful, // D-FaLL-System is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with D-FaLL-System. If not, see <http://www.gnu.org/licenses/>. // along with D-FaLL-System. If not, see <http://www.gnu.org/licenses/>.
// //
// //
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// DDDD FFFFF L L SSSS Y Y SSSS TTTTT EEEEE M M // DDDD FFFFF L L SSSS Y Y SSSS TTTTT EEEEE M M
...@@ -109,6 +109,13 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) : ...@@ -109,6 +109,13 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) :
pickerSetpointSubscriber = nodeHandle.subscribe("PickerControllerService/Setpoint", 1, &MainWindow::pickerSetpointCallback, this); pickerSetpointSubscriber = nodeHandle.subscribe("PickerControllerService/Setpoint", 1, &MainWindow::pickerSetpointCallback, this);
pickerSetpointToGUISubscriber = nodeHandle.subscribe("PickerControllerService/SetpointToGUI", 1, &MainWindow::pickerSetpointCallback, this); pickerSetpointToGUISubscriber = nodeHandle.subscribe("PickerControllerService/SetpointToGUI", 1, &MainWindow::pickerSetpointCallback, this);
//TODO add Publisher and Subscriber for DroneX
// SET ALL SLIDERS AND DIALS TO DEFAULT VALUES // SET ALL SLIDERS AND DIALS TO DEFAULT VALUES
ui->picker_z_slider->setValue( 40 ); ui->picker_z_slider->setValue( 40 );
ui->picker_mass_slider->setValue( 29 ); ui->picker_mass_slider->setValue( 29 );
...@@ -141,7 +148,7 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) : ...@@ -141,7 +148,7 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) :
//ros::NodeHandle nh_PPSClient(m_ros_namespace + "/PPSClient"); //ros::NodeHandle nh_PPSClient(m_ros_namespace + "/PPSClient");
ros::NodeHandle nh_PPSClient("PPSClient"); ros::NodeHandle nh_PPSClient("PPSClient");
crazyRadioCommandPublisher = nh_PPSClient.advertise<std_msgs::Int32>("crazyRadioCommand", 1); crazyRadioCommandPublisher = nh_PPSClient.advertise<std_msgs::Int32>("crazyRadioCommand", 1);
PPSClientCommandPublisher = nh_PPSClient.advertise<std_msgs::Int32>("Command", 1); PPSClientCommandPublisher = nh_PPSClient.advertise<std_msgs::Int32>("Command", 1);
// > For publishing a message that requests the // > For publishing a message that requests the
...@@ -231,6 +238,8 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) : ...@@ -231,6 +238,8 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) :
initialize_student_setpoint(); initialize_student_setpoint();
initialize_mpc_setpoint(); initialize_mpc_setpoint();
initialize_picker_setpoint(); initialize_picker_setpoint();
//TODO add initialize_dronex_setpoint();
} }
...@@ -265,6 +274,7 @@ void MainWindow::highlightSafeControllerTab() ...@@ -265,6 +274,7 @@ void MainWindow::highlightSafeControllerTab()
ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::black);
} }
void MainWindow::highlightPickerControllerTab() void MainWindow::highlightPickerControllerTab()
{ {
...@@ -275,6 +285,7 @@ void MainWindow::highlightPickerControllerTab() ...@@ -275,6 +285,7 @@ void MainWindow::highlightPickerControllerTab()
ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::black);
} }
void MainWindow::highlightDemoControllerTab() void MainWindow::highlightDemoControllerTab()
{ {
...@@ -285,6 +296,7 @@ void MainWindow::highlightDemoControllerTab() ...@@ -285,6 +296,7 @@ void MainWindow::highlightDemoControllerTab()
ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::black);
} }
void MainWindow::highlightStudentControllerTab() void MainWindow::highlightStudentControllerTab()
{ {
...@@ -295,6 +307,7 @@ void MainWindow::highlightStudentControllerTab() ...@@ -295,6 +307,7 @@ void MainWindow::highlightStudentControllerTab()
ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::black);
} }
void MainWindow::highlightMpcControllerTab() void MainWindow::highlightMpcControllerTab()
{ {
...@@ -305,6 +318,7 @@ void MainWindow::highlightMpcControllerTab() ...@@ -305,6 +318,7 @@ void MainWindow::highlightMpcControllerTab()
ui->tabWidget->tabBar()->setTabTextColor(4, Qt::green); ui->tabWidget->tabBar()->setTabTextColor(4, Qt::green);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::black);
} }
void MainWindow::highlightRemoteControllerTab() void MainWindow::highlightRemoteControllerTab()
{ {
...@@ -315,6 +329,7 @@ void MainWindow::highlightRemoteControllerTab() ...@@ -315,6 +329,7 @@ void MainWindow::highlightRemoteControllerTab()
ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::green); ui->tabWidget->tabBar()->setTabTextColor(5, Qt::green);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::black);
} }
void MainWindow::highlightTuningControllerTab() void MainWindow::highlightTuningControllerTab()
{ {
...@@ -325,8 +340,19 @@ void MainWindow::highlightTuningControllerTab() ...@@ -325,8 +340,19 @@ void MainWindow::highlightTuningControllerTab()
ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black); ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::green); ui->tabWidget->tabBar()->setTabTextColor(6, Qt::green);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::black);
}
void MainWindow::highlightDroneXControllerTab()
{
ui->tabWidget->tabBar()->setTabTextColor(0, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(1, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(2, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(3, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::green);
} }
void MainWindow::DBChangedCallback(const std_msgs::Int32& msg) void MainWindow::DBChangedCallback(const std_msgs::Int32& msg)
{ {
...@@ -359,6 +385,8 @@ void MainWindow::controllerUsedChangedCallback(const std_msgs::Int32& msg) ...@@ -359,6 +385,8 @@ void MainWindow::controllerUsedChangedCallback(const std_msgs::Int32& msg)
case PICKER_CONTROLLER: case PICKER_CONTROLLER:
highlightPickerControllerTab(); highlightPickerControllerTab();
break; break;
case DRONEX_CONTROLLER:
highlightDroneXControllerTab();
default: default:
break; break;
} }
...@@ -410,7 +438,7 @@ void MainWindow::pickerSetpointCallback(const Setpoint& newSetpoint) ...@@ -410,7 +438,7 @@ void MainWindow::pickerSetpointCallback(const Setpoint& newSetpoint)
// here we get the new setpoint, need to update it in GUI // here we get the new setpoint, need to update it in GUI
ui->picker_z_slider->setValue( int(newSetpoint.z*100.0) ); ui->picker_z_slider->setValue( int(newSetpoint.z*100.0) );
ui->picker_yaw_dial->setValue( int(newSetpoint.yaw * RAD2DEG) ); ui->picker_yaw_dial->setValue( int(newSetpoint.yaw * RAD2DEG) );
} }
void MainWindow::flyingStateChangedCallback(const std_msgs::Int32& msg) void MainWindow::flyingStateChangedCallback(const std_msgs::Int32& msg)
...@@ -1180,7 +1208,7 @@ void MainWindow::on_load_student_yaml_button_clicked() ...@@ -1180,7 +1208,7 @@ void MainWindow::on_load_student_yaml_button_clicked()
// > Thus we use this timer to prevent the user from clicking the // > Thus we use this timer to prevent the user from clicking the
// button in the GUI repeatedly. // button in the GUI repeatedly.
ros::NodeHandle nodeHandle("~"); ros::NodeHandle nodeHandle("~");
m_timer_yaml_file_for_student_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::studentYamlFileTimerCallback, this, true); m_timer_yaml_file_for_student_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::studentYamlFileTimerCallback, this, true);
} }
void MainWindow::studentYamlFileTimerCallback(const ros::TimerEvent&) void MainWindow::studentYamlFileTimerCallback(const ros::TimerEvent&)
...@@ -1349,7 +1377,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs:: ...@@ -1349,7 +1377,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent. // to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the // > Thus we use this timer to prevent the user from clicking the
// button in the GUI repeatedly. // button in the GUI repeatedly.
m_timer_yaml_file_for_demo_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::demoYamlFileTimerCallback, this, true); m_timer_yaml_file_for_demo_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::demoYamlFileTimerCallback, this, true);
break; break;
...@@ -1364,7 +1392,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs:: ...@@ -1364,7 +1392,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent. // to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the // > Thus we use this timer to prevent the user from clicking the
// button in the GUI repeatedly. // button in the GUI repeatedly.
m_timer_yaml_file_for_student_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::studentYamlFileTimerCallback, this, true); m_timer_yaml_file_for_student_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::studentYamlFileTimerCallback, this, true);
break; break;
...@@ -1379,7 +1407,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs:: ...@@ -1379,7 +1407,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent. // to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the // > Thus we use this timer to prevent the user from clicking the
// button in the GUI repeatedly. // button in the GUI repeatedly.
m_timer_yaml_file_for_mpc_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::mpcYamlFileTimerCallback, this, true); m_timer_yaml_file_for_mpc_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::mpcYamlFileTimerCallback, this, true);
break; break;
...@@ -1394,7 +1422,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs:: ...@@ -1394,7 +1422,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent. // to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the // > Thus we use this timer to prevent the user from clicking the
// button in the GUI repeatedly. // button in the GUI repeatedly.
m_timer_yaml_file_for_remote_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::remoteYamlFileTimerCallback, this, true); m_timer_yaml_file_for_remote_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::remoteYamlFileTimerCallback, this, true);
break; break;
...@@ -1409,7 +1437,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs:: ...@@ -1409,7 +1437,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent. // to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the // > Thus we use this timer to prevent the user from clicking the
// button in the GUI repeatedly. // button in the GUI repeatedly.
m_timer_yaml_file_for_tuning_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::tuningYamlFileTimerCallback, this, true); m_timer_yaml_file_for_tuning_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::tuningYamlFileTimerCallback, this, true);
break; break;
...@@ -1424,7 +1452,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs:: ...@@ -1424,7 +1452,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent. // to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the // > Thus we use this timer to prevent the user from clicking the
// button in the GUI repeatedly. // button in the GUI repeatedly.
m_timer_yaml_file_for_picker_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::pickerYamlFileTimerCallback, this, true); m_timer_yaml_file_for_picker_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::pickerYamlFileTimerCallback, this, true);
break; break;
...@@ -1490,6 +1518,26 @@ void MainWindow::on_enable_picker_controller_clicked() ...@@ -1490,6 +1518,26 @@ void MainWindow::on_enable_picker_controller_clicked()
// TODO
// # Custom command buttons - FOR DRONEX CONTROLLER
void MainWindow::on_dronex_take_off_button_clicked(){
ROS_INFO("DroneX: Take off from DroneX! - Please upgrade my function in MainWindow.cpp!!!!!!!!!!!!!!!!!!!");
}
void MainWindow::on_dronex_land_button_clicked(){
ROS_INFO("DroneX: Land on DroneX - Please upgrade my function in MainWindow.cpp!!!!!!!!!!!!!!!!!!!");
}
// # Custom command buttons - FOR DEMO CONTROLLER // # Custom command buttons - FOR DEMO CONTROLLER
void MainWindow::on_demoButton_1_clicked() void MainWindow::on_demoButton_1_clicked()
{ {
...@@ -1910,6 +1958,3 @@ void MainWindow::on_picker_yaw_dial_valueChanged(int value) ...@@ -1910,6 +1958,3 @@ void MainWindow::on_picker_yaw_dial_valueChanged(int value)
// Publish the message // Publish the message
this->pickerYawSetpointPublisher.publish(msg); this->pickerYawSetpointPublisher.publish(msg);
} }
...@@ -391,7 +391,7 @@ ...@@ -391,7 +391,7 @@
</font> </font>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<property name="usesScrollButtons"> <property name="usesScrollButtons">
<bool>true</bool> <bool>true</bool>
...@@ -399,6 +399,35 @@ ...@@ -399,6 +399,35 @@
<property name="tabsClosable"> <property name="tabsClosable">
<bool>false</bool> <bool>false</bool>
</property> </property>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Page</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_22">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_21">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="QPushButton" name="take_off_mothership_button">
<property name="text">
<string>Take off from Mothership</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="land_on_mothership_button">
<property name="text">
<string>Land on Mothership</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_safe"> <widget class="QWidget" name="tab_safe">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
...@@ -4006,6 +4035,48 @@ ...@@ -4006,6 +4035,48 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>6</number> <number>6</number>
</property> </property>
<item row="1" column="2">
<widget class="QLabel" name="label_22">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>30</height>
</size>
</property>
<property name="font">