To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 00cbae1e authored by Yvan Bosshard's avatar Yvan Bosshard
Browse files

Added shortcuts and clean closing of GUI

parent 960f3234
......@@ -19,6 +19,8 @@
#include "ui_MainWindow.h"
#include <string>
#include <QShortcut>
#include <ros/ros.h>
#include <ros/network.h>
#include <ros/package.h>
......@@ -121,6 +123,9 @@ MainWindow::MainWindow(int argc, char **argv, QWidget *parent) :
UWBChangedSubscriber = nodeHandle.subscribe("/my_GUI/enableUWB", 1, &MainWindow::uwbChangedCallback, this);
QObject::connect(ui->checkBox_enable_UWB, SIGNAL(stateChanged(int)), this, SLOT(on_checkBox_enable_UWB_toggled(int)));
ui->motors_OFF_button->setShortcut(tr("Space"));
QShortcut* sk = new QShortcut(QKeySequence(tr("CTRL+C")), this, SLOT(close()));
}
......@@ -288,6 +293,7 @@ void MainWindow::on_land_button_clicked()
void MainWindow::on_motors_OFF_button_clicked()
{
ROS_ERROR("[GUI] Motors off!");
std_msgs::Int32 msg;
msg.data = CMD_CRAZYFLY_MOTORS_OFF;
this->PPSClientCommandPublisher.publish(msg);
......
......@@ -34,12 +34,14 @@ rosNodeThread::rosNodeThread(int argc, char** pArgv, const char * node_name, QOb
rosNodeThread::~rosNodeThread()
{
m_pThread->exit();
if (ros::isStarted())
{
ros::shutdown();
ros::waitForShutdown();
} // end if
m_pThread->wait();
//m_pThread->wait();
} // end destructor
bool rosNodeThread::init()
......
Markdown is supported
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