Skip to content
Snippets Groups Projects
Commit 97d7101d authored by beuchatp's avatar beuchatp
Browse files

Small adjusts to flying agent GUI, layout and button naming

parent d17639bf
No related branches found
No related tags found
No related merge requests found
Showing
with 327 additions and 38 deletions
......@@ -39,7 +39,8 @@ HEADERS += include/mainwindow.h \
include/coordinatorrow.h \
include/studentcontrollertab.h \
include/defaultcontrollertab.h \
include/pickercontrollertab.h
include/pickercontrollertab.h \
include/Constants_for_Qt_compile.h
FORMS += forms/mainwindow.ui \
forms/topbanner.ui \
......
......@@ -22,19 +22,19 @@
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>6</number>
<number>12</number>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>6</number>
<number>0</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>6</number>
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="rf_disconnect_button">
......@@ -113,6 +113,9 @@
</item>
<item>
<widget class="QLineEdit" name="battery_voltage_lineEdit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -144,6 +147,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -172,7 +178,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="take_off_button">
<widget class="QPushButton" name="enable_flying_button">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -197,7 +203,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="land_button">
<widget class="QPushButton" name="disable_flying_button">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>660</width>
<width>740</width>
<height>45</height>
</rect>
</property>
......@@ -193,6 +193,9 @@
<property name="text">
<string>-.-- V</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......
......@@ -27,6 +27,9 @@
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_3">
<property name="spacing">
<number>12</number>
</property>
<item row="0" column="4">
<widget class="QPushButton" name="enable_safe_button">
<property name="sizePolicy">
......@@ -38,13 +41,13 @@
<property name="minimumSize">
<size>
<width>60</width>
<height>40</height>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>40</height>
<height>70</height>
</size>
</property>
<property name="font">
......@@ -61,21 +64,21 @@
<item row="0" column="0">
<widget class="QLabel" name="enable_controller_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>20</height>
<width>0</width>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>20</height>
<width>16777215</width>
<height>70</height>
</size>
</property>
<property name="font">
......@@ -103,13 +106,13 @@
<property name="minimumSize">
<size>
<width>60</width>
<height>40</height>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>40</height>
<height>70</height>
</size>
</property>
<property name="font">
......@@ -126,21 +129,21 @@
<item row="1" column="0">
<widget class="QLabel" name="load_yaml_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>20</height>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>20</height>
<width>16777215</width>
<height>50</height>
</size>
</property>
<property name="font">
......@@ -168,13 +171,13 @@
<property name="minimumSize">
<size>
<width>60</width>
<height>40</height>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>40</height>
<height>50</height>
</size>
</property>
<property name="text">
......@@ -193,13 +196,13 @@
<property name="minimumSize">
<size>
<width>60</width>
<height>40</height>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>40</height>
<height>50</height>
</size>
</property>
<property name="text">
......@@ -218,13 +221,13 @@
<property name="minimumSize">
<size>
<width>60</width>
<height>40</height>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>40</height>
<height>50</height>
</size>
</property>
<property name="text">
......@@ -243,13 +246,13 @@
<property name="minimumSize">
<size>
<width>60</width>
<height>40</height>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>40</height>
<height>70</height>
</size>
</property>
<property name="font">
......@@ -274,13 +277,13 @@
<property name="minimumSize">
<size>
<width>60</width>
<height>40</height>
<height>70</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>40</height>
<height>70</height>
</size>
</property>
<property name="font">
......@@ -305,13 +308,13 @@
<property name="minimumSize">
<size>
<width>60</width>
<height>40</height>
<height>50</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>180</width>
<height>40</height>
<height>50</height>
</size>
</property>
<property name="text">
......
......@@ -73,20 +73,44 @@
</property>
<item>
<widget class="TopBanner" name="customWidget_topBanner" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="ConnectStartStopBar" name="customWidget_connectStartStopBar" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>80</height>
<height>16777215</height>
</size>
</property>
</widget>
......@@ -97,7 +121,7 @@
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -111,7 +135,7 @@
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
<height>16777215</height>
</size>
</property>
</widget>
......
// Copyright (C) 2017, ETH Zurich, D-ITET, Paul Beuchat
//
// 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
// D D F aaa L L S Y Y S T E MM MM
// D D --- FFFF a a L L --- SSS Y SSS T EEE M M M
// D D F a aa L L S Y S T E M M
// DDDD F aa a LLLL LLLL SSSS Y SSSS T EEEEE M M
//
//
// DESCRIPTION:
// Constants that are used across multiple files
//
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
// U U
// U U
// U U
// U U
// UUU
// ----------------------------------------------------------------------------------
// Conversions between degrees and radians
#define RAD2DEG 180.0/PI
#define DEG2RAD PI/180.0
// PI
#define PI 3.141592653589
// Types PPS firmware
#define CF_COMMAND_TYPE_MOTORS 6
#define CF_COMMAND_TYPE_RATE 7
#define CF_COMMAND_TYPE_ANGLE 8
// Types of controllers being used:
#define SAFE_CONTROLLER 1
#define DEMO_CONTROLLER 2
#define STUDENT_CONTROLLER 3
#define MPC_CONTROLLER 4
#define REMOTE_CONTROLLER 5
#define TUNING_CONTROLLER 6
#define PICKER_CONTROLLER 7
// The constants that "command" changes in the
// operation state of this agent
#define CMD_USE_SAFE_CONTROLLER 1
#define CMD_USE_DEMO_CONTROLLER 2
#define CMD_USE_STUDENT_CONTROLLER 3
#define CMD_USE_MPC_CONTROLLER 4
#define CMD_USE_REMOTE_CONTROLLER 5
#define CMD_USE_TUNING_CONTROLLER 6
#define CMD_USE_PICKER_CONTROLLER 7
#define CMD_CRAZYFLY_TAKE_OFF 11
#define CMD_CRAZYFLY_LAND 12
#define CMD_CRAZYFLY_MOTORS_OFF 13
// Flying states
#define STATE_MOTORS_OFF 1
#define STATE_TAKE_OFF 2
#define STATE_FLYING 3
#define STATE_LAND 4
// Commands for CrazyRadio
#define CMD_RECONNECT 0
#define CMD_DISCONNECT 1
// CrazyRadio states:
#define CRAZY_RADIO_STATE_CONNECTED 0
#define CRAZY_RADIO_STATE_CONNECTING 1
#define CRAZY_RADIO_STATE_DISCONNECTED 2
// ----------------------------------------------------------------------------------
// BBBB A TTTTT TTTTT EEEEE RRRR Y Y
// B B A A T T E R R Y Y
// BBBB A A T T EEE RRRR Y
// B B AAAAA T T E R R Y
// BBBB A A T T EEEEE R R Y
// ----------------------------------------------------------------------------------
// Battery levels
#define BATTERY_LEVEL_000 0
#define BATTERY_LEVEL_010 1
#define BATTERY_LEVEL_020 2
#define BATTERY_LEVEL_030 3
#define BATTERY_LEVEL_040 4
#define BATTERY_LEVEL_050 5
#define BATTERY_LEVEL_060 6
#define BATTERY_LEVEL_070 7
#define BATTERY_LEVEL_080 8
#define BATTERY_LEVEL_090 9
#define BATTERY_LEVEL_100 10
#define BATTERY_LEVEL_UNAVAILABLE -1
// Battery states
#define BATTERY_STATE_NORMAL 0
#define BATTERY_STATE_LOW 1
// ----------------------------------------------------------------------------------
// Y Y A M M L
// Y Y A A MM MM L
// Y A A M M M L
// Y AAAAA M M L
// Y A A M M LLLLL
// ----------------------------------------------------------------------------------
// For where to load the yaml file from
#define LOAD_YAML_FROM_AGENT 1
#define LOAD_YAML_FROM_COORDINATOR 2
// The types, i.e., agent or coordinator
#define TYPE_INVALID -1
#define TYPE_COORDINATOR 1
#define TYPE_AGENT 2
// OLD STUFF FOR LOADING YAML FILES
// For which controller parameters to load from file
#define LOAD_YAML_SAFE_CONTROLLER_AGENT 1
#define LOAD_YAML_DEMO_CONTROLLER_AGENT 2
#define LOAD_YAML_STUDENT_CONTROLLER_AGENT 3
#define LOAD_YAML_MPC_CONTROLLER_AGENT 4
#define LOAD_YAML_REMOTE_CONTROLLER_AGENT 5
#define LOAD_YAML_TUNING_CONTROLLER_AGENT 6
#define LOAD_YAML_PICKER_CONTROLLER_AGENT 7
#define LOAD_YAML_SAFE_CONTROLLER_COORDINATOR 11
#define LOAD_YAML_DEMO_CONTROLLER_COORDINATOR 12
#define LOAD_YAML_STUDENT_CONTROLLER_COORDINATOR 13
#define LOAD_YAML_MPC_CONTROLLER_COORDINATOR 14
#define LOAD_YAML_REMOTE_CONTROLLER_COORDINATOR 15
#define LOAD_YAML_TUNING_CONTROLLER_COORDINATOR 16
#define LOAD_YAML_PICKER_CONTROLLER_COORDINATOR 17
// For sending commands to the controller node informing
// which parameters to fetch
// > NOTE: these are identical to the #defines above, but
// used because they have the name distinguishes
// between:
// - "loading" a yaml file into ram
// - "fetching" the values that were loaded into ram
#define FETCH_YAML_SAFE_CONTROLLER_FROM_OWN_AGENT 1
#define FETCH_YAML_DEMO_CONTROLLER_FROM_OWN_AGENT 2
#define FETCH_YAML_STUDENT_CONTROLLER_FROM_OWN_AGENT 3
#define FETCH_YAML_MPC_CONTROLLER_FROM_OWN_AGENT 4
#define FETCH_YAML_REMOTE_CONTROLLER_FROM_OWN_AGENT 5
#define FETCH_YAML_TUNING_CONTROLLER_FROM_OWN_AGENT 6
#define FETCH_YAML_PICKER_CONTROLLER_FROM_OWN_AGENT 7
#define FETCH_YAML_SAFE_CONTROLLER_FROM_COORDINATOR 11
#define FETCH_YAML_DEMO_CONTROLLER_FROM_COORDINATOR 12
#define FETCH_YAML_STUDENT_CONTROLLER_FROM_COORDINATOR 13
#define FETCH_YAML_MPC_CONTROLLER_FROM_COORDINATOR 14
#define FETCH_YAML_REMOTE_CONTROLLER_FROM_COORDINATOR 15
#define FETCH_YAML_TUNING_CONTROLLER_FROM_COORDINATOR 16
#define FETCH_YAML_PICKER_CONTROLLER_FROM_COORDINATOR 17
\ No newline at end of file
......@@ -26,6 +26,11 @@
// SPECIFY THE PACKAGE NAMESPACE
//using namespace d_fall_pps;
#else
// Include the shared definitions
#include "include/Constants_for_Qt_compile.h"
#endif
// BATTERY LABEL IMAGE INDEX
......
......@@ -58,6 +58,11 @@
// SPECIFY THE PACKAGE NAMESPACE
using namespace d_fall_pps;
#else
// Include the shared definitions
#include "include/Constants_for_Qt_compile.h"
#endif
// BATTERY LABEL IMAGE INDEX
......
......@@ -25,6 +25,11 @@
#include "nodes/Constants.h"
// using namespace d_fall_pps;
#else
// Include the shared definitions
#include "include/Constants_for_Qt_compile.h"
#endif
......
......@@ -56,6 +56,10 @@
using namespace d_fall_pps;
//using namespace std;
#else
// Include the shared definitions
#include "include/Constants_for_Qt_compile.h"
#endif
......
......@@ -504,20 +504,24 @@ void ConnectStartStopBar::setFlyingState(int new_flying_state)
void ConnectStartStopBar::on_rf_connect_button_clicked()
{
#ifdef CATKIN_MAKE
d_fall_pps::IntWithHeader msg;
fillIntMessageHeader(msg);
msg.data = CMD_RECONNECT;
this->crazyRadioCommandPublisher.publish(msg);
ROS_INFO("[ENABLE CONTROLLER LOAD YAML GUI BAR] Enable Safe Controller");
#endif
}
void ConnectStartStopBar::on_rf_disconnect_button_clicked()
{
#ifdef CATKIN_MAKE
d_fall_pps::IntWithHeader msg;
fillIntMessageHeader(msg);
msg.data = CMD_DISCONNECT;
this->crazyRadioCommandPublisher.publish(msg);
ROS_INFO("[ENABLE CONTROLLER LOAD YAML GUI BAR] Enable Safe Controller");
#endif
}
void ConnectStartStopBar::on_enable_flying_button_clicked()
......@@ -693,4 +697,4 @@ bool ConnectStartStopBar::getTypeAndIDParameters()
// Return
return return_was_successful;
}
#endif
\ No newline at end of file
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment