Commit bb350243 authored by Bryan Godbolt's avatar Bryan Godbolt

Merge branch 'master' of git://github.com/pixhawk/qgroundcontrol into dev

parents 7cee3ba2 1755f202
* { font-family: "Bitstream Vera Sans"; font: "Roman"; font-size: 12px; }
QWidget#colorIcon {} QWidget#colorIcon {}
QWidget { QWidget {
......
...@@ -72,6 +72,8 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv) ...@@ -72,6 +72,8 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
// Show splash screen // Show splash screen
QPixmap splashImage(":images/splash.png"); QPixmap splashImage(":images/splash.png");
QSplashScreen* splashScreen = new QSplashScreen(splashImage, Qt::WindowStaysOnTopHint); QSplashScreen* splashScreen = new QSplashScreen(splashImage, Qt::WindowStaysOnTopHint);
// Delete splash screen after mainWindow was displayed
splashScreen->setAttribute(Qt::WA_DeleteOnClose);
splashScreen->show(); splashScreen->show();
splashScreen->showMessage(tr("Loading application fonts"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); splashScreen->showMessage(tr("Loading application fonts"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
...@@ -79,13 +81,15 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv) ...@@ -79,13 +81,15 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv)
// Exit main application when last window is closed // Exit main application when last window is closed
connect(this, SIGNAL(lastWindowClosed()), this, SLOT(quit())); connect(this, SIGNAL(lastWindowClosed()), this, SLOT(quit()));
// Set application font // Load application font
QFontDatabase fontDatabase = QFontDatabase(); QFontDatabase fontDatabase = QFontDatabase();
const QString fontFileName = ":/general/vera.ttf"; ///< Font file is part of the QRC file and compiled into the app const QString fontFileName = ":/general/vera.ttf"; ///< Font file is part of the QRC file and compiled into the app
const QString fontFamilyName = "Bitstream Vera Sans"; const QString fontFamilyName = "Bitstream Vera Sans";
if(!QFile::exists(fontFileName)) printf("ERROR! font file: %s DOES NOT EXIST!\n", fontFileName.toStdString().c_str()); if(!QFile::exists(fontFileName)) printf("ERROR! font file: %s DOES NOT EXIST!\n", fontFileName.toStdString().c_str());
fontDatabase.addApplicationFont(fontFileName); fontDatabase.addApplicationFont(fontFileName);
setFont(fontDatabase.font(fontFamilyName, "Roman", 12)); // Avoid Using setFont(). In the Qt docu you can read the following:
// "Warning: Do not use this function in conjunction with Qt Style Sheets."
// setFont(fontDatabase.font(fontFamilyName, "Roman", 12));
// Start the comm link manager // Start the comm link manager
splashScreen->showMessage(tr("Starting Communication Links"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); splashScreen->showMessage(tr("Starting Communication Links"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
......
...@@ -139,7 +139,6 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -139,7 +139,6 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit errCountChanged(uasId, "IMU", "SPI0", status.spi0_err_count); emit errCountChanged(uasId, "IMU", "SPI0", status.spi0_err_count);
emit errCountChanged(uasId, "IMU", "SPI1", status.spi1_err_count); emit errCountChanged(uasId, "IMU", "SPI1", status.spi1_err_count);
emit errCountChanged(uasId, "IMU", "UART", status.uart_total_err_count); emit errCountChanged(uasId, "IMU", "UART", status.uart_total_err_count);
qDebug() << "System Load:" << status.load;
emit UAS::valueChanged(this, "Load", ((float)status.load)/1000.0f, MG::TIME::getGroundTimeNow()); emit UAS::valueChanged(this, "Load", ((float)status.load)/1000.0f, MG::TIME::getGroundTimeNow());
} }
break; break;
......
...@@ -391,6 +391,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -391,6 +391,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
{ {
mavlink_rc_channels_t channels; mavlink_rc_channels_t channels;
mavlink_msg_rc_channels_decode(&message, &channels); mavlink_msg_rc_channels_decode(&message, &channels);
emit remoteControlRSSIChanged(channels.rssi/255.0f);
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
{ {
switch (i) switch (i)
...@@ -576,6 +577,43 @@ void UAS::setLocalPositionSetpoint(float x, float y, float z, float yaw) ...@@ -576,6 +577,43 @@ void UAS::setLocalPositionSetpoint(float x, float y, float z, float yaw)
#endif #endif
} }
void UAS::setLocalPositionOffset(float x, float y, float z, float yaw)
{
#ifdef MAVLINK_ENABLED_PIXHAWK_MESSAGES
mavlink_message_t msg;
mavlink_msg_position_control_offset_set_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, uasId, 0, x, y, z, yaw);
sendMessage(msg);
#endif
}
void UAS::startRadioControlCalibration()
{
mavlink_message_t msg;
mavlink_msg_action_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, uasId, MAV_COMP_ID_IMU, MAV_ACTION_CALIBRATE_RC);
sendMessage(msg);
}
void UAS::startMagnetometerCalibration()
{
mavlink_message_t msg;
mavlink_msg_action_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, uasId, MAV_COMP_ID_IMU, MAV_ACTION_CALIBRATE_MAG);
sendMessage(msg);
}
void UAS::startGyroscopeCalibration()
{
mavlink_message_t msg;
mavlink_msg_action_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, uasId, MAV_COMP_ID_IMU, MAV_ACTION_CALIBRATE_GYRO);
sendMessage(msg);
}
void UAS::startPressureCalibration()
{
mavlink_message_t msg;
mavlink_msg_action_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, uasId, MAV_COMP_ID_IMU, MAV_ACTION_CALIBRATE_PRESSURE);
sendMessage(msg);
}
quint64 UAS::getUnixTime(quint64 time) quint64 UAS::getUnixTime(quint64 time)
{ {
if (time == 0) if (time == 0)
......
...@@ -221,6 +221,13 @@ public slots: ...@@ -221,6 +221,13 @@ public slots:
/** @brief Set local position setpoint */ /** @brief Set local position setpoint */
void setLocalPositionSetpoint(float x, float y, float z, float yaw); void setLocalPositionSetpoint(float x, float y, float z, float yaw);
/** @brief Add an offset in body frame to the setpoint */
void setLocalPositionOffset(float x, float y, float z, float yaw);
void startRadioControlCalibration();
void startMagnetometerCalibration();
void startGyroscopeCalibration();
void startPressureCalibration();
signals: signals:
......
...@@ -211,6 +211,12 @@ public slots: ...@@ -211,6 +211,12 @@ public slots:
virtual void enableRawSensorFusionTransmission(bool enabled) = 0; virtual void enableRawSensorFusionTransmission(bool enabled) = 0;
virtual void setLocalPositionSetpoint(float x, float y, float z, float yaw) = 0; virtual void setLocalPositionSetpoint(float x, float y, float z, float yaw) = 0;
virtual void setLocalPositionOffset(float x, float y, float z, float yaw) = 0;
virtual void startRadioControlCalibration() = 0;
virtual void startMagnetometerCalibration() = 0;
virtual void startGyroscopeCalibration() = 0;
virtual void startPressureCalibration() = 0;
protected: protected:
QColor color; QColor color;
...@@ -331,6 +337,8 @@ signals: ...@@ -331,6 +337,8 @@ signals:
void positionYawControlEnabled(bool enabled); void positionYawControlEnabled(bool enabled);
/** @brief Value of a remote control channel */ /** @brief Value of a remote control channel */
void remoteControlChannelChanged(int channelId, float raw, float normalized); void remoteControlChannelChanged(int channelId, float raw, float normalized);
/** @brief Remote control RSSI changed */
void remoteControlRSSIChanged(float rssi);
/** /**
* @brief Localization quality changed * @brief Localization quality changed
......
This diff is collapsed.
...@@ -154,24 +154,26 @@ protected: ...@@ -154,24 +154,26 @@ protected:
LinkInterface* udpLink; LinkInterface* udpLink;
QSettings settings; QSettings settings;
UASControlWidget* control; // Center widgets
Linecharts* linechart; QPointer<Linecharts> linechartWidget;
UASInfoWidget* info; QPointer<HUD> hudWidget;
CameraView* camera; QPointer<MapWidget> mapWidget;
UASListWidget* list; QPointer<XMLCommProtocolWidget> protocolWidget;
WaypointList* waypoints; QPointer<QGCDataPlot2D> dataplotWidget;
ObjectDetectionView* detection; // Dock widgets
HUD* hud; QPointer<QDockWidget> controlDockWidget;
DebugConsole* debugConsole; QPointer<QDockWidget> infoDockWidget;
MapWidget* map; QPointer<QDockWidget> cameraDockWidget;
ParameterInterface* parameters; QPointer<QDockWidget> listDockWidget;
XMLCommProtocolWidget* protocol; QPointer<QDockWidget> waypointsDockWidget;
HDDisplay* headDown1; QPointer<QDockWidget> detectionDockWidget;
HDDisplay* headDown2; QPointer<QDockWidget> debugConsoleDockWidget;
WatchdogControl* watchdogControl; QPointer<QDockWidget> parametersDockWidget;
HSIDisplay* hsi; QPointer<QDockWidget> headDown1DockWidget;
QGCDataPlot2D* dataplot; QPointer<QDockWidget> headDown2DockWidget;
QGCRemoteControlView* rcView; QPointer<QDockWidget> watchdogControlDockWidget;
QPointer<QDockWidget> hsiDockWidget;
QPointer<QDockWidget> rcViewDockWidget;
// Popup widgets // Popup widgets
JoystickWidget* joystickWidget; JoystickWidget* joystickWidget;
...@@ -187,9 +189,6 @@ protected: ...@@ -187,9 +189,6 @@ protected:
QAction* killUASAct; QAction* killUASAct;
QAction* simulateUASAct; QAction* simulateUASAct;
QDockWidget* controlDock;
QStackedWidget* centerStack;
LogCompressor* comp; LogCompressor* comp;
QString screenFileName; QString screenFileName;
QTimer* videoTimer; QTimer* videoTimer;
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
QGroundControl Open Source Ground Control Station QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL/PIXHAWK PROJECT (c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
<http://www.qgroundcontrol.org>
<http://pixhawk.ethz.ch>
This file is part of the QGROUNDCONTROL project This file is part of the QGROUNDCONTROL project
...@@ -22,7 +20,6 @@ This file is part of the QGROUNDCONTROL project ...@@ -22,7 +20,6 @@ This file is part of the QGROUNDCONTROL project
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>. along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/ ======================================================================*/
/** /**
* @file * @file
* @brief Implementation of class QGCParamWidget * @brief Implementation of class QGCParamWidget
......
...@@ -52,18 +52,21 @@ QGCRemoteControlView::QGCRemoteControlView(QWidget *parent) : ...@@ -52,18 +52,21 @@ QGCRemoteControlView::QGCRemoteControlView(QWidget *parent) :
nameLabel = new QLabel(this); nameLabel = new QLabel(this);
nameLabel->setText("No MAV selected yet.."); nameLabel->setText("No MAV selected yet..");
layout->addWidget(nameLabel, 0, 0, 1, 2); layout->addWidget(nameLabel, 0, 0, 1, 2);
// Add spacer left of button
layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 2, 0); // RSSI bar
// Set stretch to maximize spacer, not button // Create new layout
layout->setColumnStretch(0, 100); QHBoxLayout* rssiLayout = new QHBoxLayout();
layout->setColumnStretch(1, 1); rssiLayout->setSpacing(5);
// Calibrate button // Add content
QPushButton* calibrateButton = new QPushButton(this); rssiLayout->addWidget(new QLabel(tr("Signal"), this));
calibrateButton->setText(tr("Calibrate")); // Append raw label
// Connect to calibration slot // Append progress bar
connect(calibrateButton, SIGNAL(clicked()), this, SLOT(calibrate())); rssiBar = new QProgressBar(this);
// Add button rssiBar->setMinimum(0);
layout->addWidget(calibrateButton, 2, 1); rssiBar->setMaximum(100);
rssiBar->setValue(0);
rssiLayout->addWidget(rssiBar);
layout->addItem(rssiLayout, 2, 0, 1, 2);
setVisible(false); setVisible(false);
connect(UASManager::instance(), SIGNAL(activeUASSet(int)), this, SLOT(setUASId(int))); connect(UASManager::instance(), SIGNAL(activeUASSet(int)), this, SLOT(setUASId(int)));
...@@ -75,11 +78,6 @@ QGCRemoteControlView::~QGCRemoteControlView() ...@@ -75,11 +78,6 @@ QGCRemoteControlView::~QGCRemoteControlView()
delete channelLayout; delete channelLayout;
} }
void QGCRemoteControlView::calibrate()
{
// Run auto-calibration
}
void QGCRemoteControlView::setUASId(int id) void QGCRemoteControlView::setUASId(int id)
{ {
if (uasId != -1) if (uasId != -1)
...@@ -89,6 +87,7 @@ void QGCRemoteControlView::setUASId(int id) ...@@ -89,6 +87,7 @@ void QGCRemoteControlView::setUASId(int id)
{ {
// The UAS exists, disconnect any existing connections // The UAS exists, disconnect any existing connections
disconnect(uas, SIGNAL(remoteControlChannelChanged(int,float,float)), this, SLOT(setChannel(int,float,float))); disconnect(uas, SIGNAL(remoteControlChannelChanged(int,float,float)), this, SLOT(setChannel(int,float,float)));
disconnect(uas, SIGNAL(remoteControlRSSIChanged(float)), this, SLOT(setRemoteRSSI(float)));
} }
} }
...@@ -99,6 +98,7 @@ void QGCRemoteControlView::setUASId(int id) ...@@ -99,6 +98,7 @@ void QGCRemoteControlView::setUASId(int id)
// New UAS exists, connect // New UAS exists, connect
nameLabel->setText(QString("RC Input of %1").arg(newUAS->getUASName())); nameLabel->setText(QString("RC Input of %1").arg(newUAS->getUASName()));
connect(newUAS, SIGNAL(remoteControlChannelChanged(int,float,float)), this, SLOT(setChannel(int,float,float))); connect(newUAS, SIGNAL(remoteControlChannelChanged(int,float,float)), this, SLOT(setChannel(int,float,float)));
connect(newUAS, SIGNAL(remoteControlRSSIChanged(float)), this, SLOT(setRemoteRSSI(float)));
} }
} }
...@@ -132,7 +132,7 @@ void QGCRemoteControlView::setRemoteRSSI(float rssiNormalized) ...@@ -132,7 +132,7 @@ void QGCRemoteControlView::setRemoteRSSI(float rssiNormalized)
void QGCRemoteControlView::appendChannelWidget(int channelId) void QGCRemoteControlView::appendChannelWidget(int channelId)
{ {
// Create new layout // Create new layout
QHBoxLayout* layout = new QHBoxLayout(this); QHBoxLayout* layout = new QHBoxLayout();
// Add content // Add content
layout->addWidget(new QLabel(QString("Channel %1").arg(channelId + 1), this)); layout->addWidget(new QLabel(QString("Channel %1").arg(channelId + 1), this));
QLabel* raw = new QLabel(this); QLabel* raw = new QLabel(this);
......
...@@ -51,7 +51,6 @@ public slots: ...@@ -51,7 +51,6 @@ public slots:
void setUASId(int id); void setUASId(int id);
void setChannel(int channelId, float raw, float normalized); void setChannel(int channelId, float raw, float normalized);
void setRemoteRSSI(float rssiNormalized); void setRemoteRSSI(float rssiNormalized);
void calibrate();
void redraw(); void redraw();
protected slots: protected slots:
...@@ -67,6 +66,7 @@ protected: ...@@ -67,6 +66,7 @@ protected:
QVector<float> normalized; QVector<float> normalized;
QVector<QLabel*> rawLabels; QVector<QLabel*> rawLabels;
QVector<QProgressBar*> progressBars; QVector<QProgressBar*> progressBars;
QProgressBar* rssiBar;
QLabel* nameLabel; QLabel* nameLabel;
private: private:
......
...@@ -46,6 +46,12 @@ QGCSensorSettingsWidget::QGCSensorSettingsWidget(UASInterface* uas, QWidget *par ...@@ -46,6 +46,12 @@ QGCSensorSettingsWidget::QGCSensorSettingsWidget(UASInterface* uas, QWidget *par
connect(ui->sendExtra1CheckBox, SIGNAL(toggled(bool)), mav, SLOT(enableExtra1Transmission(bool))); connect(ui->sendExtra1CheckBox, SIGNAL(toggled(bool)), mav, SLOT(enableExtra1Transmission(bool)));
connect(ui->sendExtra2CheckBox, SIGNAL(toggled(bool)), mav, SLOT(enableExtra2Transmission(bool))); connect(ui->sendExtra2CheckBox, SIGNAL(toggled(bool)), mav, SLOT(enableExtra2Transmission(bool)));
connect(ui->sendExtra3CheckBox, SIGNAL(toggled(bool)), mav, SLOT(enableExtra3Transmission(bool))); connect(ui->sendExtra3CheckBox, SIGNAL(toggled(bool)), mav, SLOT(enableExtra3Transmission(bool)));
// Calibration
connect(ui->rcCalButton, SIGNAL(clicked()), mav, SLOT(startRadioControlCalibration()));
connect(ui->magCalButton, SIGNAL(clicked()), mav, SLOT(startMagnetometerCalibration()));
connect(ui->pressureCalButton, SIGNAL(clicked()), mav, SLOT(startPressureCalibration()));
connect(ui->gyroCalButton, SIGNAL(clicked()), mav, SLOT(startGyroscopeCalibration()));
} }
QGCSensorSettingsWidget::~QGCSensorSettingsWidget() QGCSensorSettingsWidget::~QGCSensorSettingsWidget()
......
...@@ -90,38 +90,51 @@ ...@@ -90,38 +90,51 @@
<property name="title"> <property name="title">
<string>Calibration Wizards</string> <string>Calibration Wizards</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout" columnstretch="0,50">
<property name="margin"> <property name="margin">
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="0"> <item row="1" column="0">
<widget class="QPushButton" name="gyroCalButton"> <widget class="QPushButton" name="magCalButton">
<property name="text"> <property name="text">
<string>Start dynamic calibration</string> <string>Start Mag. Calibration</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="4" column="0">
<widget class="QLabel" name="gyroCalDate"> <widget class="QPushButton" name="gyroCalButton">
<property name="text"> <property name="text">
<string>Date unknown</string> <string>Start Gyro Calibration</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="0" column="0">
<widget class="QPushButton" name="magCalButton"> <widget class="QPushButton" name="rcCalButton">
<property name="text"> <property name="text">
<string>Start static calibration</string> <string>Start RC Calibration</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="2" column="0">
<widget class="QLabel" name="magCalLabel"> <widget class="QPushButton" name="pressureCalButton">
<property name="text"> <property name="text">
<string>Date unknown</string> <string>Start Pressure Calibration</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
......
...@@ -51,13 +51,13 @@ This file is part of the PIXHAWK project ...@@ -51,13 +51,13 @@ This file is part of the PIXHAWK project
#define CONTROL_MODE_TEST2 "MODE TEST2" #define CONTROL_MODE_TEST2 "MODE TEST2"
#define CONTROL_MODE_TEST3 "MODE TEST3" #define CONTROL_MODE_TEST3 "MODE TEST3"
#define CONTROL_MODE_LOCKED_INDEX 2 #define CONTROL_MODE_LOCKED_INDEX 1
#define CONTROL_MODE_MANUAL_INDEX 3 #define CONTROL_MODE_MANUAL_INDEX 2
#define CONTROL_MODE_GUIDED_INDEX 4 #define CONTROL_MODE_GUIDED_INDEX 3
#define CONTROL_MODE_AUTO_INDEX 5 #define CONTROL_MODE_AUTO_INDEX 4
#define CONTROL_MODE_TEST1_INDEX 6 #define CONTROL_MODE_TEST1_INDEX 5
#define CONTROL_MODE_TEST2_INDEX 7 #define CONTROL_MODE_TEST2_INDEX 6
#define CONTROL_MODE_TEST3_INDEX 8 #define CONTROL_MODE_TEST3_INDEX 7
UASControlWidget::UASControlWidget(QWidget *parent) : QWidget(parent), UASControlWidget::UASControlWidget(QWidget *parent) : QWidget(parent),
uas(0), uas(0),
......
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