Commit 11fa94a7 authored by tiagos's avatar tiagos
Browse files

List for Anchors added

parent 17aed950
......@@ -132,6 +132,8 @@ private slots:
void on_checkBox_enable_UWB_toggled(bool checked);
void on_reloadAnchors_button_pressed();
#ifdef CATKIN_MAKE
void updateNewViconData(const ptrToMessage& p_msg);
......@@ -177,7 +179,7 @@ private:
ros::Publisher emergencyStopPublisher;
ros::Publisher refreshStudents_publisher;
ros::Publisher enableUWB_publisher;
ros::Publisher UWBSettings_publisher;
#endif
......
......@@ -47,6 +47,10 @@
#define N_MAX_CRAZYFLIES 20 // protection number
#define UWB_UPDATE_DISABLE 0
#define UWB_UPDATE_ENABLE 1
#define UWB_UPDATE_ANCHORS 5
#ifdef CATKIN_MAKE
using namespace d_fall_pps;
#endif
......@@ -222,9 +226,12 @@ void MainGUIWindow::_init()
emergencyStopPublisher = nodeHandle.advertise<std_msgs::Int32>("emergencyStop", 1);
refreshStudents_publisher = nodeHandle.advertise<std_msgs::Int32>("refreshStudents", 1);
enableUWB_publisher = nodeHandle.advertise<std_msgs::Int32>("enableUWB", 1);
UWBServiceClientUpdate_publisher = nodeHandle.advertise<std_msgs::Int32>("UWBUpdate", 1);
// TODO RENAME
UWBSettings_publisher = nodeHandle.advertise<std_msgs::Int32>("enableUWB", 1);
QObject::connect(ui->checkBox_enable_UWB, SIGNAL(stateChanged(int)), this, SLOT(on_checkBox_enable_UWB_toggled(bool)));
QObject::connect(ui->reloadAnchors_button, SIGNAL(pressed()), this, SLOT(on_reloadAnchors_button_pressed()));
#endif
}
......@@ -728,8 +735,6 @@ void MainGUIWindow::on_refresh_student_ids_button_clicked()
#endif
}
void MainGUIWindow::on_link_button_clicked()
{
#ifdef CATKIN_MAKE
......@@ -970,10 +975,27 @@ void MainGUIWindow::on_load_from_DB_button_clicked()
void MainGUIWindow::on_checkBox_enable_UWB_toggled(bool checked)
{
std_msgs::Int32 msg;
msg.data = checked;
// Send Command to enable UWB to UWBServiceClient
std_msgs::Int32 server_msg;
server_msg.data = UWB_UPDATE_ENABLE;
UWBServiceClientUpdate_publisher.publish(server_msg);
enableUWB_publisher.publish(msg);
// Publish message that clients have to reload data from UWBServiceClient
//std_msgs::Int32 msg;
//msg.data = 1;
// UWBSettings_publisher.publish(msg);
}
void MainGUIWindow::on_reloadAnchors_button_pressed()
{
// Load Data from UWBServiceClient
// Publish message that clients have to reload data from UWBServiceClient
std_msgs::Int32 msg;
msg.data = 1;
UWBSettings_publisher.publish(msg);
}
void MainGUIWindow::on_comboBoxCFs_currentTextChanged(const QString &arg1)
......
......@@ -460,13 +460,64 @@
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="label_anchors">
<property name="text">
<string>Change Michael's boolean:</string>
<string>Anchor Positions</string>
</property>
</widget>
</widget>
</item>
<item row="2" column="1">
<widget class="QListWidget" name="list_anchors">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QPushButton" name="reloadAnchors_button">
<property name="text">
<string>Reload Anchors</string>
</property>
</widget>
</item>
<item row="3" column="1"><widget class="QLabel" name="label_5">
<property name="text">
<string>Change Michael's boolean:</string>
</property>
</widget></item>
<item row="4" column="1"><widget class="QLabel" name="label_5">
<property name="text">
<string>Change Michael's boolean:</string>
</property>
</widget></item>
<item row="5" column="1"><widget class="QLabel" name="label_5">
<property name="text">
<string>Change Michael's boolean:</string>
</property>
</widget></item>
<item row="6" column="1"><widget class="QLabel" name="label_5">
<property name="text">
<string>Change Michael's boolean:</string>
</property>
</widget></item>
<item row="7" column="1"><widget class="QLabel" name="label_5">
<property name="text">
<string>Change Michael's boolean:</string>
</property>
</widget></item>
<item row="8" column="1"><widget class="QLabel" name="label_5">
<property name="text">
<string>Change Michael's boolean:</string>
</property>
</widget></item>
<item row="4" column="1">
<widget class="QCheckBox" name="checkBox_enable_UWB">
<!--<property name="font">
<font>
......
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