Commit e82a6b2b authored by tiagos's avatar tiagos
Browse files

added tab 'localisation' and publisher to enable UWB

parent 22da8c6f
...@@ -130,6 +130,8 @@ private slots: ...@@ -130,6 +130,8 @@ private slots:
void on_load_from_DB_button_clicked(); void on_load_from_DB_button_clicked();
void on_checkBox_enable_UWB_toggled(bool checked);
#ifdef CATKIN_MAKE #ifdef CATKIN_MAKE
void updateNewViconData(const ptrToMessage& p_msg); void updateNewViconData(const ptrToMessage& p_msg);
...@@ -175,6 +177,7 @@ private: ...@@ -175,6 +177,7 @@ private:
ros::Publisher emergencyStopPublisher; ros::Publisher emergencyStopPublisher;
ros::Publisher refreshStudents_publisher; ros::Publisher refreshStudents_publisher;
ros::Publisher enableUWB_publisher;
#endif #endif
......
...@@ -38,6 +38,6 @@ std::map<std::string, std::string> channel_LUT ...@@ -38,6 +38,6 @@ std::map<std::string, std::string> channel_LUT
{"PPS_CF09", "0/56/2M/E7E7E7E709"}, {"PPS_CF09", "0/56/2M/E7E7E7E709"},
{"PPS_CF10", "0/56/2M/E7E7E7E70A"}, {"PPS_CF10", "0/56/2M/E7E7E7E70A"},
{"uwbtest", "0/80/2M/E7E7E7E7E7"}, {"uwbtest", "0/80/2M/E7E7E7E7E7"},
//{"UWB_CF01", "0/56/2M/E7E7E7E7E7"}, {"UWB_CF01", "0/80/250K/E7E7E7E7E7"},
{"UWB_CF02", "0/70/2M/E7E7E7E7E7"}, {"UWB_CF02", "0/70/2M/E7E7E7E7E7"},
}; };
...@@ -126,11 +126,6 @@ void MainGUIWindow::doNumCrazyFlyZonesChanged(int n) ...@@ -126,11 +126,6 @@ void MainGUIWindow::doNumCrazyFlyZonesChanged(int n)
updateComboBoxesCFZones(); updateComboBoxesCFZones();
} }
void demo(const std_msgs::Int32MultiArray &ids)
{
ROS_ERROR("Callback");
}
void MainGUIWindow::_init() void MainGUIWindow::_init()
{ {
// initialize checkboxes, spinboxes,.... // initialize checkboxes, spinboxes,....
...@@ -227,6 +222,9 @@ void MainGUIWindow::_init() ...@@ -227,6 +222,9 @@ void MainGUIWindow::_init()
emergencyStopPublisher = nodeHandle.advertise<std_msgs::Int32>("emergencyStop", 1); emergencyStopPublisher = nodeHandle.advertise<std_msgs::Int32>("emergencyStop", 1);
refreshStudents_publisher = nodeHandle.advertise<std_msgs::Int32>("refreshStudents", 1); refreshStudents_publisher = nodeHandle.advertise<std_msgs::Int32>("refreshStudents", 1);
enableUWB_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)));
#endif #endif
} }
...@@ -970,6 +968,14 @@ void MainGUIWindow::on_load_from_DB_button_clicked() ...@@ -970,6 +968,14 @@ void MainGUIWindow::on_load_from_DB_button_clicked()
} }
} }
void MainGUIWindow::on_checkBox_enable_UWB_toggled(bool checked)
{
std_msgs::Int32 msg;
msg.data = checked;
enableUWB_publisher.publish(msg);
}
void MainGUIWindow::on_comboBoxCFs_currentTextChanged(const QString &arg1) void MainGUIWindow::on_comboBoxCFs_currentTextChanged(const QString &arg1)
{ {
std::string key = arg1.toStdString(); std::string key = arg1.toStdString();
......
...@@ -260,6 +260,7 @@ ...@@ -260,6 +260,7 @@
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="links_tab"> <widget class="QWidget" name="links_tab">
<attribute name="title"> <attribute name="title">
<string>Links</string> <string>Links</string>
...@@ -452,6 +453,37 @@ ...@@ -452,6 +453,37 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="localisation_tab">
<attribute name="title">
<string>Localisation</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Change Michael's boolean:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_enable_UWB">
<!--<property name="font">
<font>
<pointsize>7</pointsize>
</font>
</property>-->
<property name="text">
<string>Enable UWB Positioning</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>
......
8,UWB_CF02,0/70/2M/E7E7E7E7E7,0,-0.7,-0.7,-0.2,1.07,0.58,2 8,UWB_CF02,0/70/2M/E7E7E7E7E7,0,-1.96,-1.71,-0.2,1.98,1.64,2
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