Commit f1ef5ce3 authored by mastefan's avatar mastefan
Browse files

-Bug fixes GUI DroneX

parent d6b897fc
......@@ -241,8 +241,8 @@ private slots:
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();
void on_take_off_dronex_button_clicked();
void on_land_on_dronex_button_clicked();
......
......@@ -1520,12 +1520,12 @@ void MainWindow::on_enable_picker_controller_clicked()
// TODO
// # Custom command buttons - FOR DRONEX CONTROLLER
void MainWindow::on_dronex_take_off_button_clicked(){
void MainWindow::on_take_off_dronex_button_clicked(){
ROS_INFO("DroneX: Take off from DroneX! - Please upgrade my function in MainWindow.cpp!!!!!!!!!!!!!!!!!!!");
}
void MainWindow::on_dronex_land_button_clicked(){
void MainWindow::on_land_on_dronex_button_clicked(){
ROS_INFO("DroneX: Land on DroneX - Please upgrade my function in MainWindow.cpp!!!!!!!!!!!!!!!!!!!");
}
......
......@@ -409,14 +409,14 @@
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="QPushButton" name="take_off_mothership_button">
<widget class="QPushButton" name="take_off_dronex_button">
<property name="text">
<string>Take off from Mothership</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="land_on_mothership_button">
<widget class="QPushButton" name="land_on_dronex_button">
<property name="text">
<string>Land on Mothership</string>
</property>
......@@ -4158,36 +4158,6 @@
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QPushButton" name="load_remote_yaml_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>50</height>
</size>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>Remote</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QPushButton" name="load_student_yaml_button">
<property name="sizePolicy">
......@@ -4667,6 +4637,36 @@
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QPushButton" name="load_remote_yaml_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>50</height>
</size>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>Remote</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
......
......@@ -90,7 +90,7 @@
#define REMOTE_CONTROLLER 5
#define TUNING_CONTROLLER 6
#define PICKER_CONTROLLER 7
#define DRONEX_CONTROLLER 8
//#define DRONEX_CONTROLLER 8
// The constants that "command" changes in the
// operation state of this agent
......@@ -101,7 +101,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_USE_DRONEX_CONTROLLER 8
#define CMD_CRAZYFLY_TAKE_OFF 11
......@@ -166,7 +166,7 @@ ros::ServiceClient tuningController;
ros::ServiceClient pickerController;
// The DroneX controller specified in the ClientConfig.yaml
//TODO
ros::ServiceClient droneXController;
//ros::ServiceClient droneXController;
//values for safteyCheck
......@@ -313,7 +313,7 @@ void loadMpcController();
void loadRemoteController();
void loadTuningController();
void loadPickerController();
void loadDroneXController();
//void loadDroneXController();
void sendMessageUsingController(int controller);
void setInstantController(int controller);
......
......@@ -307,10 +307,10 @@ void viconCallback(const ViconData& viconData)
case PICKER_CONTROLLER:
success = pickerController.call(controllerCall);
break;
//TODO
case DRONEX_CONTROLLER:
success = droneXController.call(controllerCall);
break;
//TODO
//case DRONEX_CONTROLLER:
//success = droneXController.call(controllerCall);
//break;
default:
ROS_ERROR("[PPS CLIENT] the current controller was not recognised");
break;
......@@ -477,11 +477,11 @@ void commandCallback(const std_msgs::Int32& commandMsg) {
setControllerUsed(PICKER_CONTROLLER);
break;
//TODO
case CMD_USE_DRONEX_CONTROLLER:
ROS_INFO("[PPS CLIENT] USE_DRONEX_CONTROLLER Command received");
setControllerUsed(DRONEX_CONTROLLER);
break;
//TODO
/*case CMD_USE_DRONEX_CONTROLLER:
ROS_INFO("[PPS CLIENT] USE_DRONEX_CONTROLLER Command received");
setControllerUsed(DRONEX_CONTROLLER);
break;*/
case CMD_CRAZYFLY_TAKE_OFF:
if(flying_state == STATE_MOTORS_OFF)
{
......@@ -907,17 +907,17 @@ void loadPickerController()
// TODO
void loadDroneXController(){
ros::NodeHandle nodeHandle("~");
/*ros::NodeHandle nodeHandle("~");
std::string droneXControllerName;
if(!nodeHandle.getParam("droneXController", droneXControllerName))
if(!nodeHandle.getParam("droneXController", droneXControllerName))
{
ROS_ERROR("[PPS CLIENT] Failed to get droneX controller name");
return;
}
droneXController = ros::service::createClient<Controller>(droneXControllerName, true);
ROS_INFO_STREAM("[PPS CLIENT] Loaded droneX controller " << droneXController.getService());
ROS_INFO_STREAM("[PPS CLIENT] Loaded droneX controller " << droneXController.getService());*/
}
void sendMessageUsingController(int controller)
......@@ -954,8 +954,8 @@ void setInstantController(int controller) //for right now, temporal use
case PICKER_CONTROLLER:
loadPickerController();
break;
case DRONEX_CONTROLLER:
loadDroneXController();
/*case DRONEX_CONTROLLER:
loadDroneXController();*/
default:
break;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment