Commit 6ba52995 authored by Lorenz Meier's avatar Lorenz Meier

Threading fixes

parent faab2eb2
...@@ -138,7 +138,7 @@ UAS::UAS(MAVLinkProtocol* protocol, QThread* thread, int id) : UASInterface(), ...@@ -138,7 +138,7 @@ UAS::UAS(MAVLinkProtocol* protocol, QThread* thread, int id) : UASInterface(),
airSpeed(std::numeric_limits<double>::quiet_NaN()), airSpeed(std::numeric_limits<double>::quiet_NaN()),
groundSpeed(std::numeric_limits<double>::quiet_NaN()), groundSpeed(std::numeric_limits<double>::quiet_NaN()),
waypointManager(), waypointManager(this),
attitudeKnown(false), attitudeKnown(false),
attitudeStamped(false), attitudeStamped(false),
...@@ -153,7 +153,7 @@ UAS::UAS(MAVLinkProtocol* protocol, QThread* thread, int id) : UASInterface(), ...@@ -153,7 +153,7 @@ UAS::UAS(MAVLinkProtocol* protocol, QThread* thread, int id) : UASInterface(),
paramsOnceRequested(false), paramsOnceRequested(false),
paramMgr(), paramMgr(this),
simulation(0), simulation(0),
// The protected members. // The protected members.
...@@ -168,9 +168,6 @@ UAS::UAS(MAVLinkProtocol* protocol, QThread* thread, int id) : UASInterface(), ...@@ -168,9 +168,6 @@ UAS::UAS(MAVLinkProtocol* protocol, QThread* thread, int id) : UASInterface(),
_thread(thread) _thread(thread)
{ {
moveToThread(thread); moveToThread(thread);
waypointManager.moveToThread(thread);
paramMgr.moveToThread(thread);
statusTimeout.moveToThread(thread);
for (unsigned int i = 0; i<255;++i) for (unsigned int i = 0; i<255;++i)
{ {
...@@ -196,42 +193,42 @@ UAS::UAS(MAVLinkProtocol* protocol, QThread* thread, int id) : UASInterface(), ...@@ -196,42 +193,42 @@ UAS::UAS(MAVLinkProtocol* protocol, QThread* thread, int id) : UASInterface(),
connect(newAction, SIGNAL(triggered()), this, SLOT(toggleAutonomy())); connect(newAction, SIGNAL(triggered()), this, SLOT(toggleAutonomy()));
actions.append(newAction); actions.append(newAction);
newAction = new QAction(tr("Go home"), this); newAction = new QAction(tr("Go home"), thread);
newAction->setToolTip(tr("Command the UAS to return to its home position")); newAction->setToolTip(tr("Command the UAS to return to its home position"));
connect(newAction, SIGNAL(triggered()), this, SLOT(home())); connect(newAction, SIGNAL(triggered()), this, SLOT(home()));
actions.append(newAction); actions.append(newAction);
newAction = new QAction(tr("Land"), this); newAction = new QAction(tr("Land"), thread);
newAction->setToolTip(tr("Command the UAS to land")); newAction->setToolTip(tr("Command the UAS to land"));
connect(newAction, SIGNAL(triggered()), this, SLOT(land())); connect(newAction, SIGNAL(triggered()), this, SLOT(land()));
actions.append(newAction); actions.append(newAction);
newAction = new QAction(tr("Launch"), this); newAction = new QAction(tr("Launch"), thread);
newAction->setToolTip(tr("Command the UAS to launch itself and begin its mission")); newAction->setToolTip(tr("Command the UAS to launch itself and begin its mission"));
connect(newAction, SIGNAL(triggered()), this, SLOT(launch())); connect(newAction, SIGNAL(triggered()), this, SLOT(launch()));
actions.append(newAction); actions.append(newAction);
newAction = new QAction(tr("Resume"), this); newAction = new QAction(tr("Resume"), thread);
newAction->setToolTip(tr("Command the UAS to continue its mission")); newAction->setToolTip(tr("Command the UAS to continue its mission"));
connect(newAction, SIGNAL(triggered()), this, SLOT(go())); connect(newAction, SIGNAL(triggered()), this, SLOT(go()));
actions.append(newAction); actions.append(newAction);
newAction = new QAction(tr("Stop"), this); newAction = new QAction(tr("Stop"), thread);
newAction->setToolTip(tr("Command the UAS to halt and hold position")); newAction->setToolTip(tr("Command the UAS to halt and hold position"));
connect(newAction, SIGNAL(triggered()), this, SLOT(halt())); connect(newAction, SIGNAL(triggered()), this, SLOT(halt()));
actions.append(newAction); actions.append(newAction);
newAction = new QAction(tr("Go autonomous"), this); newAction = new QAction(tr("Go autonomous"), thread);
newAction->setToolTip(tr("Set the UAS into an autonomous control mode")); newAction->setToolTip(tr("Set the UAS into an autonomous control mode"));
connect(newAction, SIGNAL(triggered()), this, SLOT(goAutonomous())); connect(newAction, SIGNAL(triggered()), this, SLOT(goAutonomous()));
actions.append(newAction); actions.append(newAction);
newAction = new QAction(tr("Go manual"), this); newAction = new QAction(tr("Go manual"), thread);
newAction->setToolTip(tr("Set the UAS into a manual control mode")); newAction->setToolTip(tr("Set the UAS into a manual control mode"));
connect(newAction, SIGNAL(triggered()), this, SLOT(goManual())); connect(newAction, SIGNAL(triggered()), this, SLOT(goManual()));
actions.append(newAction); actions.append(newAction);
newAction = new QAction(tr("Toggle autonomy"), this); newAction = new QAction(tr("Toggle autonomy"), thread);
newAction->setToolTip(tr("Toggle between manual and full-autonomy")); newAction->setToolTip(tr("Toggle between manual and full-autonomy"));
connect(newAction, SIGNAL(triggered()), this, SLOT(toggleAutonomy())); connect(newAction, SIGNAL(triggered()), this, SLOT(toggleAutonomy()));
actions.append(newAction); actions.append(newAction);
...@@ -373,7 +370,6 @@ void UAS::updateState() ...@@ -373,7 +370,6 @@ void UAS::updateState()
GAudioOutput::instance()->notifyNegative(); GAudioOutput::instance()->notifyNegative();
} }
} }
qDebug() << "UPDATE STATE:" << (heartbeatInterval / 1000) << "milliseconds, LOST:" << connectionLost;
} }
/** /**
......
...@@ -760,6 +760,7 @@ void MainWindow::loadDockWidget(const QString& name) ...@@ -760,6 +760,7 @@ void MainWindow::loadDockWidget(const QString& name)
{ {
if(menuActionHelper->containsDockWidget(currentView, name)) if(menuActionHelper->containsDockWidget(currentView, name))
return; return;
if (name.startsWith("HIL_CONFIG")) if (name.startsWith("HIL_CONFIG"))
{ {
//It's a HIL widget. //It's a HIL widget.
...@@ -826,7 +827,7 @@ void MainWindow::loadDockWidget(const QString& name) ...@@ -826,7 +827,7 @@ void MainWindow::loadDockWidget(const QString& name)
} }
else if (name == "HEAD_UP_DISPLAY_DOCKWIDGET") else if (name == "HEAD_UP_DISPLAY_DOCKWIDGET")
{ {
createDockWidget(centerStack->currentWidget(),new HUD(320,240,this),tr("Head Up Display"),"HEAD_UP_DISPLAY_DOCKWIDGET",currentView,Qt::RightDockWidgetArea); createDockWidget(centerStack->currentWidget(),new HUD(320,240,this),tr("Video Downlink"),"HEAD_UP_DISPLAY_DOCKWIDGET",currentView,Qt::RightDockWidgetArea);
} }
else if (name == "UAS_INFO_QUICKVIEW_DOCKWIDGET") else if (name == "UAS_INFO_QUICKVIEW_DOCKWIDGET")
{ {
......
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