Commit f5a97334 authored by maruggv's avatar maruggv
Browse files

valentin out of date

Merge branch 'mothership' into valentin
parents ea26deb3 ce1be7ea
/opt/ros/kinetic/share/catkin/cmake/toplevel.cmake
\ No newline at end of file
/opt/ros/melodic/share/catkin/cmake/toplevel.cmake
\ No newline at end of file
......@@ -324,6 +324,7 @@ add_executable(MpcControllerService src/nodes/MpcControllerService.cpp)
add_executable(RemoteControllerService src/nodes/RemoteControllerService.cpp)
add_executable(TuningControllerService src/nodes/TuningControllerService.cpp)
add_executable(PickerControllerService src/nodes/PickerControllerService.cpp)
add_executable(DroneXControllerService src/nodes/DroneXControllerService.cpp)
add_executable(CentralManagerService src/nodes/CentralManagerService.cpp src/CrazyflieIO.cpp)
add_executable(ParameterService src/nodes/ParameterService.cpp)
......@@ -407,6 +408,7 @@ add_dependencies(MpcControllerService d_fall_pps_generate_messages_cpp ${cat
add_dependencies(RemoteControllerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(TuningControllerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(PickerControllerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(DroneXControllerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(CentralManagerService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
add_dependencies(ParameterService d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
......@@ -461,6 +463,7 @@ endif()
target_link_libraries(RemoteControllerService ${catkin_LIBRARIES})
target_link_libraries(TuningControllerService ${catkin_LIBRARIES})
target_link_libraries(PickerControllerService ${catkin_LIBRARIES})
target_link_libraries(DroneXControllerService ${catkin_LIBRARIES})
target_link_libraries(CentralManagerService ${catkin_LIBRARIES})
target_link_libraries(ParameterService ${catkin_LIBRARIES})
......
......@@ -48,7 +48,7 @@
#include "d_fall_pps/CrazyflieDB.h"
#include "d_fall_pps/CrazyflieEntry.h"
#include "d_fall_pps/CustomControllerYAML.h"
//#include "d_fall_pps/CustomControllerYAML.h"
#include <std_msgs/Int32.h>
......
// Copyright (C) 2017, ETH Zurich, D-ITET, Paul Beuchat, Angel Romero
//
// This file is part of D-FaLL-System.
//
//
// 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
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// D-FaLL-System is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// 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/>.
//
//
//
// ----------------------------------------------------------------------------------
// DDDD FFFFF L L SSSS Y Y SSSS TTTTT EEEEE M M
......@@ -55,6 +55,7 @@
#define REMOTE_CONTROLLER 5
#define TUNING_CONTROLLER 6
#define PICKER_CONTROLLER 7
#define DRONEX_CONTROLLER 8
// Commands for CrazyRadio
......@@ -77,6 +78,7 @@
#define CMD_USE_REMOTE_CONTROLLER 5
#define CMD_USE_TUNING_CONTROLLER 6
#define CMD_USE_PICKER_CONTROLLER 7
#define CMD_USE_DRONEX_CONTROLLER 8
#define CMD_CRAZYFLY_TAKE_OFF 11
#define CMD_CRAZYFLY_LAND 12
......@@ -109,6 +111,7 @@
#define LOAD_YAML_REMOTE_CONTROLLER_AGENT 5
#define LOAD_YAML_TUNING_CONTROLLER_AGENT 6
#define LOAD_YAML_PICKER_CONTROLLER_AGENT 7
#define LOAD_YAML_DRONEX_CONTROLLER_AGENT 8
#define LOAD_YAML_SAFE_CONTROLLER_COORDINATOR 11
#define LOAD_YAML_DEMO_CONTROLLER_COORDINATOR 12
......@@ -117,6 +120,8 @@
#define LOAD_YAML_REMOTE_CONTROLLER_COORDINATOR 15
#define LOAD_YAML_TUNING_CONTROLLER_COORDINATOR 16
#define LOAD_YAML_PICKER_CONTROLLER_COORDINATOR 17
#define LOAD_YAML_DRONEX_CONTROLLER_COORDINATOR 18
// FOR WHICH BUTTON WAS PRESSED IN THE PICKER CONTOLLER
......@@ -134,6 +139,17 @@
#define PICKER_BUTTON_4 14
// FOR WHICH BUTTON WAS PRESSED IN THE DRONEX CONTOLLER
#define DRONEX_TAKE_OFF 8
#define DRONEX_LAND 9
#define DRONEX_ABORT 10
#define DRONEX_INTEGRATOR_ON 15
#define DRONEX_INTEGRATOR_OFF 16
#define DRONEX_INTEGRATOR_RESET 17
// Universal constants
#define PI 3.141592653589
......@@ -178,6 +194,7 @@ private slots:
void on_load_remote_yaml_button_clicked();
void on_load_tuning_yaml_button_clicked();
void on_load_picker_yaml_button_clicked();
void on_load_dronex_yaml_button_clicked();
// # Enable controllers
void on_enable_safe_controller_clicked();
......@@ -187,8 +204,9 @@ private slots:
void on_enable_remote_controller_clicked();
void on_enable_tuning_controller_clicked();
void on_enable_picker_controller_clicked();
void on_enable_droneX_controller_clicked();
void on_demoButton_1_clicked();
void on_demoButton_2_clicked();
......@@ -235,6 +253,14 @@ private slots:
// > For the dial
void on_picker_yaw_dial_valueChanged(int value);
// Interactions with the DroneX controller tab
void on_take_off_dronex_button_clicked();
void on_land_on_dronex_button_clicked();
void on_abort_dronex_button_clicked();
void on_integrate_on_dronex_button_clicked();
void on_integrate_off_dronex_button_clicked();
void on_integrate_reset_dronex_button_clicked();
......@@ -258,6 +284,7 @@ private:
ros::Timer m_timer_yaml_file_for_remote_controller;
ros::Timer m_timer_yaml_file_for_tuning_controller;
ros::Timer m_timer_yaml_file_for_picker_controller;
ros::Timer m_timer_yaml_file_for_dronex_controller;
int m_student_id;
......@@ -322,6 +349,12 @@ private:
ros::Publisher tuningVerticalGainPublisher;
ros::Publisher tuningHeadingGainPublisher;
// > For the DRONEX CONTROLLER
ros::Publisher dronexButtonPressedPublisher;
ros::Publisher dronexSetpointPublisher;
ros::Subscriber dronexSetpointSubscriber;
ros::Subscriber dronexSetpointToGUISubscriber;
// > For the PICKER CONTROLLER
......@@ -333,7 +366,7 @@ private:
ros::Publisher pickerYAdjustmentPublisher;
ros::Publisher pickerSetpointPublisher;
ros::Subscriber pickerSetpointSubscriber;
ros::Subscriber pickerSetpointToGUISubscriber;
ros::Subscriber pickerSetpointToGUISubscriber;
......@@ -370,6 +403,7 @@ private:
void studentSetpointCallback(const Setpoint& newSetpoint);
void mpcSetpointCallback(const Setpoint& newSetpoint);
void pickerSetpointCallback(const Setpoint& newSetpoint);
void dronexSetpointCallback(const Setpoint& newSetpoint);
void remoteDataCallback(const CrazyflieData& objectData);
......@@ -378,7 +412,8 @@ private:
// > For actually sending the button message
void send_picker_button_clicked_message(int button_index);
void send_dronex_button_clicked_message(int button_index);
void DBChangedCallback(const std_msgs::Int32& msg);
......@@ -390,7 +425,7 @@ private:
void remoteYamlFileTimerCallback(const ros::TimerEvent&);
void tuningYamlFileTimerCallback(const ros::TimerEvent&);
void pickerYamlFileTimerCallback(const ros::TimerEvent&);
void dronexYamlFileTimerCallback(const ros::TimerEvent&);
void requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::Int32& msg);
......@@ -418,6 +453,7 @@ private:
void highlightRemoteControllerTab();
void highlightTuningControllerTab();
void highlightPickerControllerTab();
void highlightDroneXControllerTab();
bool setpointInsideBox(Setpoint setpoint, CrazyflieContext context);
Setpoint correctSetpointBox(Setpoint setpoint, CrazyflieContext context);
......
// Copyright (C) 2017, ETH Zurich, D-ITET, Paul Beuchat, Angel Romero
//
// This file is part of D-FaLL-System.
//
//
// 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
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// D-FaLL-System is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// 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/>.
//
//
//
// ----------------------------------------------------------------------------------
// DDDD FFFFF L L SSSS Y Y SSSS TTTTT EEEEE M M
......@@ -109,6 +109,16 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) :
pickerSetpointSubscriber = nodeHandle.subscribe("PickerControllerService/Setpoint", 1, &MainWindow::pickerSetpointCallback, this);
pickerSetpointToGUISubscriber = nodeHandle.subscribe("PickerControllerService/SetpointToGUI", 1, &MainWindow::pickerSetpointCallback, this);
//TODO add Publisher and Subscriber for DroneX
dronexButtonPressedPublisher = nodeHandle.advertise<std_msgs::Int32>("DroneXControllerService/ButtonPressed", 1);
dronexSetpointPublisher = nodeHandle.advertise<Setpoint>("DroneXControllerService/Setpoint", 1);
dronexSetpointSubscriber = nodeHandle.subscribe("DroneXControllerService/Setpoint", 1, &MainWindow::dronexSetpointCallback, this);
dronexSetpointToGUISubscriber = nodeHandle.subscribe("DroneXControllerService/SetpointToGUI", 1, &MainWindow::dronexSetpointCallback, this);
// SET ALL SLIDERS AND DIALS TO DEFAULT VALUES
ui->picker_z_slider->setValue( 40 );
ui->picker_mass_slider->setValue( 29 );
......@@ -141,7 +151,7 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) :
//ros::NodeHandle nh_PPSClient(m_ros_namespace + "/PPSClient");
ros::NodeHandle nh_PPSClient("PPSClient");
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
......@@ -231,6 +241,8 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) :
initialize_student_setpoint();
initialize_mpc_setpoint();
initialize_picker_setpoint();
//TODO add initialize_dronex_setpoint();
}
......@@ -258,43 +270,47 @@ void MainWindow::enableGUI()
void MainWindow::highlightSafeControllerTab()
{
ui->tabWidget->tabBar()->setTabTextColor(0, Qt::green);
ui->tabWidget->tabBar()->setTabTextColor(1, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(0, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(1, Qt::green);
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::black);
}
void MainWindow::highlightPickerControllerTab()
{
ui->tabWidget->tabBar()->setTabTextColor(0, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(1, Qt::green);
ui->tabWidget->tabBar()->setTabTextColor(2, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(1, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(2, Qt::green);
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::black);
}
void MainWindow::highlightDemoControllerTab()
{
ui->tabWidget->tabBar()->setTabTextColor(0, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(1, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(2, Qt::green);
ui->tabWidget->tabBar()->setTabTextColor(3, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(2, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(3, Qt::green);
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::black);
}
void MainWindow::highlightStudentControllerTab()
{
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::green);
ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(3, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(4, Qt::green);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::black);
}
void MainWindow::highlightMpcControllerTab()
{
......@@ -302,9 +318,10 @@ void MainWindow::highlightMpcControllerTab()
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::green);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(4, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::green);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::black);
}
void MainWindow::highlightRemoteControllerTab()
{
......@@ -313,8 +330,9 @@ void MainWindow::highlightRemoteControllerTab()
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::green);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(5, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::green);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::black);
}
void MainWindow::highlightTuningControllerTab()
{
......@@ -324,9 +342,20 @@ void MainWindow::highlightTuningControllerTab()
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::green);
ui->tabWidget->tabBar()->setTabTextColor(6, Qt::black);
ui->tabWidget->tabBar()->setTabTextColor(7, Qt::green);
}
void MainWindow::highlightDroneXControllerTab()
{
ui->tabWidget->tabBar()->setTabTextColor(7, 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(0, Qt::green);
}
void MainWindow::DBChangedCallback(const std_msgs::Int32& msg)
{
......@@ -359,7 +388,11 @@ void MainWindow::controllerUsedChangedCallback(const std_msgs::Int32& msg)
case PICKER_CONTROLLER:
highlightPickerControllerTab();
break;
case DRONEX_CONTROLLER:
highlightDroneXControllerTab();
break;
default:
ROS_INFO_STREAM("controllerUsedChangedCallback-Controller Flag not recognised----------------" << msg.data);
break;
}
}
......@@ -410,7 +443,17 @@ void MainWindow::pickerSetpointCallback(const Setpoint& newSetpoint)
// here we get the new setpoint, need to update it in GUI
ui->picker_z_slider->setValue( int(newSetpoint.z*100.0) );
ui->picker_yaw_dial->setValue( int(newSetpoint.yaw * RAD2DEG) );
}
void MainWindow::dronexSetpointCallback(const Setpoint& newSetpoint)
{
m_picker_setpoint = newSetpoint;
ROS_INFO("dronexSetpointCallback");
// here we get the new setpoint, need to update it in GUI
//ui->picker_z_slider->setValue( int(newSetpoint.z*100.0) );
//ui->picker_yaw_dial->setValue( int(newSetpoint.yaw * RAD2DEG) );
}
void MainWindow::flyingStateChangedCallback(const std_msgs::Int32& msg)
......@@ -1128,6 +1171,69 @@ void MainWindow::safeYamlFileTimerCallback(const ros::TimerEvent&)
// Enble the "load safe yaml" button again
ui->load_safe_yaml_button->setEnabled(true);
}
// ----------------------------------------------------------------------------------
// # Load Yaml when acting as the GUI for an Agent
void MainWindow::on_load_dronex_yaml_button_clicked()
{
// Set the "load safe yaml" button to be disabled
ui->load_dronex_yaml_button->setEnabled(false);
// Send a message requesting the parameters from the YAML
// file to be reloaded for the safe controller
std_msgs::Int32 msg;
msg.data = LOAD_YAML_DRONEX_CONTROLLER_AGENT;
this->requestLoadControllerYamlPublisher.publish(msg);
ROS_INFO("Request load of dronex controller YAML published");
// Start a timer which will enable the button in its callback
// > This is required because the agent node waits some time between
// re-loading the values from the YAML file and then assigning then
// to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the
// button in the GUI repeatedly.
ros::NodeHandle nodeHandle("~");
m_timer_yaml_file_for_dronex_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::dronexYamlFileTimerCallback, this, true);
}
void MainWindow::dronexYamlFileTimerCallback(const ros::TimerEvent&)
{
// Enble the "load safe yaml" button again
ui->load_dronex_yaml_button->setEnabled(true);
}
......@@ -1180,7 +1286,7 @@ void MainWindow::on_load_student_yaml_button_clicked()
// > Thus we use this timer to prevent the user from clicking the
// button in the GUI repeatedly.
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&)
......@@ -1323,6 +1429,21 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// Switch between loading for the different controllers
switch(controller_to_load_yaml)
{
case LOAD_YAML_DRONEX_CONTROLLER_AGENT:
case LOAD_YAML_DRONEX_CONTROLLER_COORDINATOR:
// Set the "load safe yaml" button to be disabled
ui->load_dronex_yaml_button->setEnabled(false);
// Start a timer which will enable the button in its callback
// > This is required because the agent node waits some time between
// re-loading the values from the YAML file and then assigning then
// to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the
// button in the GUI repeatedly.
m_timer_yaml_file_for_dronex_controller = nodeHandle.createTimer(ros::Duration(1.5), &MainWindow::dronexYamlFileTimerCallback, this, true);
break;
case LOAD_YAML_SAFE_CONTROLLER_AGENT:
case LOAD_YAML_SAFE_CONTROLLER_COORDINATOR:
// Set the "load safe yaml" button to be disabled
......@@ -1349,7 +1470,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the
// 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;
......@@ -1364,7 +1485,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the
// 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;
......@@ -1379,7 +1500,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the
// 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;
......@@ -1394,7 +1515,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the
// 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;
......@@ -1409,7 +1530,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the
// 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;
......@@ -1424,7 +1545,7 @@ void MainWindow::requestLoadControllerYaml_from_my_GUI_Callback(const std_msgs::
// to the local variable of the agent.
// > Thus we use this timer to prevent the user from clicking the
// 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;
......@@ -1488,6 +1609,23 @@ void MainWindow::on_enable_picker_controller_clicked()
this->PPSClientCommandPublisher.publish(msg);
}
void MainWindow::on_enable_droneX_controller_clicked()
{
std_msgs::Int32 msg;
msg.data = CMD_USE_DRONEX_CONTROLLER;
this->PPSClientCommandPublisher.publish(msg);
}
// # Custom command buttons - FOR DEMO CONTROLLER
......@@ -1785,8 +1923,60 @@ void MainWindow::on_tuning_slider_heading_valueChanged(int value)
// TODO
//-----------------------------------------------------------------------------------------------------------------------------------------------
// # Custom command buttons - FOR DRONEX CONTROLLER
//-----------------------------------------------------------------------------------------------------------------------------------------------
// Publish Message that certain button was clicked
void MainWindow::send_dronex_button_clicked_message(int button_index){
// Initialise the message
std_msgs::Int32 msg;
// Set the msg data
msg.data = button_index;
// Publish the message
this-> dronexButtonPressedPublisher.publish(msg);
}