Browse Source

Merge branch 'master' of git@pixhawk.ethz.ch:groundcontrol

QGC4.4
pixhawk 15 years ago
parent
commit
451457ba15
  1. 47
      README
  2. 17
      src/comm/MAVLinkSimulationLink.cc
  3. 5
      src/uas/UAS.cc
  4. 10
      src/uas/UASInterface.h
  5. 5
      src/ui/DebugConsole.cc
  6. 2
      src/ui/DebugConsole.h
  7. 3
      src/ui/MainWindow.cc
  8. 65
      src/ui/UASInfo.ui

47
README

@ -2,20 +2,55 @@ QGroundControl Open Source Micro Air Vehicle Ground Control Station @@ -2,20 +2,55 @@ QGroundControl Open Source Micro Air Vehicle Ground Control Station
http://pixhawk.ethz.ch
Mac OS X
========
To build on Mac OS X (10.5 or later):
Install SDL
-----------
1) Download SDL from: <http://www.libsdl.org/release/SDL-1.2.14.dmg>
2) From the SDL disk image, copy the `sdl.framework` bundle to `/Library/Frameworks` directory (if you are not an admin copy to `~/Library/Framewroks`)
Install QT with Cocoa
----------------------
1) Download Qt 4.6.2 with Cocoa from `http://get.qt.nokia.com/qt/source/qt-mac-cocoa-opensource-4.6.2.dmg`
2) Double click the package installer
Get the MAVLINK Library
-----------------------
1) Clone the MAVLINK repository : `git clone git@pixhawk.ethz.ch:mavlink.git` (You need to have emailed your ssh key). **NOTE:** Make sure that the mavlink directory is in the same directory as groundcontrol. QGround control will look for mavlink library in ../mavlink
Build QGroundControl
--------------------
1) From the terminal go to the `groundcontrol` directory
2) Run `qmake`
3) Run `xcodebuild -configuration Release` or open `qgroundcontrol.xcodeproj` in Xcode and build.
Linux
=====
**********************************************************************************************
* PLEASE NOTE: YOU NEED TO DOWNLOAD THE MAVLINK LIBRARY IN ORDER TO COMPILE THIS APPLICATION *
**********************************************************************************************
To build on Mac OS X (10.5 or later):
1) Install http://www.libsdl.org/release/SDL-1.2.14.dmg
2) Install Qt 4.6.2 with Cocoa http://get.qt.nokia.com/qt/source/qt-mac-cocoa-opensource-4.6.2.dmg
3) Run "qmake"
4) Run "xcodebuild -configuration Release" or open "qgroundcontrol.xcodeproj" in Xcode and build.
To build on Linux:
<instructions to be written>
Windows
=======
**********************************************************************************************
* PLEASE NOTE: YOU NEED TO DOWNLOAD THE MAVLINK LIBRARY IN ORDER TO COMPILE THIS APPLICATION *
**********************************************************************************************
To build on Windows:
<instructions to be written>

17
src/comm/MAVLinkSimulationLink.cc

@ -365,6 +365,15 @@ void MAVLinkSimulationLink::mainloop() @@ -365,6 +365,15 @@ void MAVLinkSimulationLink::mainloop()
memcpy(stream+streampointer,buffer, bufferlength);
streampointer += bufferlength;
// Pack debug text message
statustext_t text;
text.severity = 0;
strcpy((char*)(text.text), "DEBUG MESSAGE TEXT");
message_statustext_encode(systemId, componentId, &msg, &text);
bufferlength = message_to_send_buffer(buffer, &msg);
memcpy(stream+streampointer, buffer, bufferlength);
streampointer += bufferlength;
/*
// Pack message and get size of encoded byte string
messageSize = message_boot_pack(systemId, componentId, &msg, version);
@ -529,6 +538,14 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) @@ -529,6 +538,14 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
}
}
break;
case MAVLINK_MSG_ID_MANUAL_CONTROL:
{
manual_control_t control;
message_manual_control_decode(&msg, &control);
qDebug() << "\n" << "ROLL:" << control.roll << "PITCH:" << control.pitch;
}
break;
}

5
src/uas/UAS.cc

@ -171,7 +171,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) @@ -171,7 +171,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
emit modeChanged(this->getUASID(), mode, "");
modeAudio = " is now in " + mode;
}
currentVoltage = state.vbat;
currentVoltage = state.vbat/1000.0f;
lpVoltage = filterVoltage(currentVoltage);
if (startVoltage == 0) startVoltage = currentVoltage;
timeRemaining = calculateTimeRemaining();
@ -353,8 +353,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) @@ -353,8 +353,9 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
//b.append('\0');
QString text = QString(b);
int severity = message_statustext_get_severity(&message);
qDebug() << "RECEIVED STATUS:" << text;
//qDebug() << "RECEIVED STATUS:" << text;
//emit statusTextReceived(severity, text);
emit textMessageReceived(uasId, severity, text);
}
break;
case MAVLINK_MSG_ID_PATTERN_DETECTED:

10
src/uas/UASInterface.h

@ -209,6 +209,16 @@ signals: @@ -209,6 +209,16 @@ signals:
*/
void statusChanged(UASInterface* uas, QString status, QString description);
/**
* @brief Received a plain text message from the robot
* This signal should NOT be used for standard communication, but rather for VERY IMPORTANT
* messages like critical errors.
*
* @param uasid ID of the sending system
* @param text the status text
* @param severity The severity of the message, 0 for plain debug messages, 10 for very critical messages
*/
void textMessageReceived(int uasid, int severity, QString text);
/**
* @brief Drop rate of communication link updated
*
* @param systemId id of the air system

5
src/ui/DebugConsole.cc

@ -161,6 +161,11 @@ void DebugConsole::setAutoHold(bool hold) @@ -161,6 +161,11 @@ void DebugConsole::setAutoHold(bool hold)
autoHold = hold;
}
void DebugConsole::receiveTextMessage(int id, int severity, QString text)
{
m_ui->receiveText->appendHtml(QString("<b color=\"red\">(MAV" + QString::number(id) + QString(":") + QString::number(severity) + QString(") ") + text + QString("</b>")));
}
void DebugConsole::updateTrafficMeasurements()
{
lowpassDataRate = lowpassDataRate * 0.9f + (0.1f * ((float)snapShotBytes / (float)snapShotInterval) * 1000.0f);

2
src/ui/DebugConsole.h

@ -68,6 +68,8 @@ public slots: @@ -68,6 +68,8 @@ public slots:
void hold(bool hold);
/** @brief Enable auto-freeze mode if traffic intensity is too high to display */
void setAutoHold(bool hold);
/** @brief Receive plain text message to output to the user */
void receiveTextMessage(int id, int severity, QString text);
protected slots:
/** @brief Draw information overlay */

3
src/ui/MainWindow.cc

@ -327,6 +327,9 @@ void MainWindow::UASCreated(UASInterface* uas) @@ -327,6 +327,9 @@ void MainWindow::UASCreated(UASInterface* uas)
sysPresent = true;
}
// FIXME Should be not inside the mainwindow
connect(uas, SIGNAL(textMessageReceived(int,int,QString)), debugConsole, SLOT(receiveTextMessage(int,int,QString)));
// Health / System status indicator
info->addUAS(uas);

65
src/ui/UASInfo.ui

@ -6,8 +6,8 @@ @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>462</width>
<height>189</height>
<width>455</width>
<height>220</height>
</rect>
</property>
<property name="windowTitle">
@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
</property>
</widget>
</item>
<item row="0" column="4">
<item row="0" column="4" colspan="4">
<widget class="QProgressBar" name="batteryBar">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@ -109,7 +109,7 @@ @@ -109,7 +109,7 @@
</property>
</widget>
</item>
<item row="0" column="5" rowspan="4">
<item row="0" column="8" rowspan="6">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -171,7 +171,7 @@ @@ -171,7 +171,7 @@
</property>
</widget>
</item>
<item row="1" column="4">
<item row="1" column="4" colspan="4">
<widget class="QProgressBar" name="receiveLossBar">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@ -257,7 +257,7 @@ @@ -257,7 +257,7 @@
</property>
</widget>
</item>
<item row="2" column="4">
<item row="2" column="4" colspan="4">
<widget class="QProgressBar" name="sendLossBar">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@ -343,7 +343,7 @@ @@ -343,7 +343,7 @@
</property>
</widget>
</item>
<item row="3" column="4">
<item row="3" column="4" colspan="4">
<widget class="QProgressBar" name="loadBar">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@ -380,7 +380,56 @@ @@ -380,7 +380,56 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="6">
<item row="4" column="0" colspan="8">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>I2C Errors</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="QLabel" name="i2cErrorLabel">
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QLabel" name="label_5">
<property name="text">
<string>SPI Errors</string>
</property>
</widget>
</item>
<item row="5" column="5">
<widget class="QLabel" name="spiErrorLabel">
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="5" column="6">
<widget class="QLabel" name="label_10">
<property name="text">
<string>UART Errors</string>
</property>
</widget>
</item>
<item row="5" column="7">
<widget class="QLabel" name="uartErrorLabel">
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="9">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>

Loading…
Cancel
Save