Commit 628d3aa1 authored by Don Gagne's avatar Don Gagne

Merge pull request #1777 from dogmaphobic/hudOnVideo

Enabling the option of using Compass and Attitude Widgets or HUD.
parents a9b28845 d06c1906
...@@ -120,16 +120,16 @@ ...@@ -120,16 +120,16 @@
<file alias="MapDisplay.qml">src/ui/mapdisplay/MapDisplay.qml</file> <file alias="MapDisplay.qml">src/ui/mapdisplay/MapDisplay.qml</file>
<file alias="QGroundControl/FlightControls/QGCAltitudeWidget.qml">src/ui/qmlcommon/QGCAltitudeWidget.qml</file> <file alias="QGroundControl/FlightControls/QGCAltitudeWidget.qml">src/ui/qmlcommon/QGCAltitudeWidget.qml</file>
<file alias="QGroundControl/FlightControls/QGCArtificialHorizon.qml">src/ui/qmlcommon/QGCArtificialHorizon.qml</file> <file alias="QGroundControl/FlightControls/QGCArtificialHorizon.qml">src/ui/qmlcommon/QGCArtificialHorizon.qml</file>
<file alias="QGroundControl/FlightControls/QGCAttitudeInstrument.qml">src/ui/qmlcommon/QGCAttitudeInstrument.qml</file>
<file alias="QGroundControl/FlightControls/QGCAttitudeWidget.qml">src/ui/qmlcommon/QGCAttitudeWidget.qml</file> <file alias="QGroundControl/FlightControls/QGCAttitudeWidget.qml">src/ui/qmlcommon/QGCAttitudeWidget.qml</file>
<file alias="QGroundControl/FlightControls/QGCCompass.qml">src/ui/qmlcommon/QGCCompass.qml</file> <file alias="QGroundControl/FlightControls/QGCAttitudeHUD.qml">src/ui/qmlcommon/QGCAttitudeHUD.qml</file>
<file alias="QGroundControl/FlightControls/QGCCompassInstrument.qml">src/ui/qmlcommon/QGCCompassInstrument.qml</file> <file alias="QGroundControl/FlightControls/QGCCompassWidget.qml">src/ui/qmlcommon/QGCCompassWidget.qml</file>
<file alias="QGroundControl/FlightControls/QGCCompassHUD.qml">src/ui/qmlcommon/QGCCompassHUD.qml</file>
<file alias="QGroundControl/FlightControls/QGCCurrentAltitude.qml">src/ui/qmlcommon/QGCCurrentAltitude.qml</file> <file alias="QGroundControl/FlightControls/QGCCurrentAltitude.qml">src/ui/qmlcommon/QGCCurrentAltitude.qml</file>
<file alias="QGroundControl/FlightControls/QGCCurrentSpeed.qml">src/ui/qmlcommon/QGCCurrentSpeed.qml</file> <file alias="QGroundControl/FlightControls/QGCCurrentSpeed.qml">src/ui/qmlcommon/QGCCurrentSpeed.qml</file>
<file alias="QGroundControl/FlightControls/QGCHudMessage.qml">src/ui/qmlcommon/QGCHudMessage.qml</file> <file alias="QGroundControl/FlightControls/QGCHudMessage.qml">src/ui/qmlcommon/QGCHudMessage.qml</file>
<file alias="QGroundControl/FlightControls/QGCMapBackground.qml">src/ui/qmlcommon/QGCMapBackground.qml</file> <file alias="QGroundControl/FlightControls/QGCMapBackground.qml">src/ui/qmlcommon/QGCMapBackground.qml</file>
<file alias="QGroundControl/FlightControls/QGCMapToolButton.qml">src/ui/qmlcommon/QGCMapToolButton.qml</file> <file alias="QGroundControl/FlightControls/QGCMapToolButton.qml">src/ui/qmlcommon/QGCMapToolButton.qml</file>
<file alias="QGroundControl/FlightControls/QGCPitchWidget.qml">src/ui/qmlcommon/QGCPitchWidget.qml</file> <file alias="QGroundControl/FlightControls/QGCPitchIndicator.qml">src/ui/qmlcommon/QGCPitchIndicator.qml</file>
<file alias="QGroundControl/FlightControls/QGCSlider.qml">src/ui/qmlcommon/QGCSlider.qml</file> <file alias="QGroundControl/FlightControls/QGCSlider.qml">src/ui/qmlcommon/QGCSlider.qml</file>
<file alias="QGroundControl/FlightControls/QGCSpeedWidget.qml">src/ui/qmlcommon/QGCSpeedWidget.qml</file> <file alias="QGroundControl/FlightControls/QGCSpeedWidget.qml">src/ui/qmlcommon/QGCSpeedWidget.qml</file>
<file alias="QGroundControl/FlightControls/QGCVideoBackground.qml">src/ui/qmlcommon/QGCVideoBackground.qml</file> <file alias="QGroundControl/FlightControls/QGCVideoBackground.qml">src/ui/qmlcommon/QGCVideoBackground.qml</file>
......
...@@ -149,19 +149,19 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(), ...@@ -149,19 +149,19 @@ UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
// Initialize HIL sensor noise variances to 0. If user wants corrupted sensor values they will need to set them // Initialize HIL sensor noise variances to 0. If user wants corrupted sensor values they will need to set them
// Note variances calculated from flight case from this log: http://dash.oznet.ch/view/MRjW8NUNYQSuSZkbn8dEjY // Note variances calculated from flight case from this log: http://dash.oznet.ch/view/MRjW8NUNYQSuSZkbn8dEjY
// TODO: calibrate stand-still pixhawk variances // TODO: calibrate stand-still pixhawk variances
xacc_var(1.2914), xacc_var(1.2914f),
yacc_var(0.7048), yacc_var(0.7048f),
zacc_var(1.9577), zacc_var(1.9577f),
rollspeed_var(0.8126), rollspeed_var(0.8126f),
pitchspeed_var(0.6145), pitchspeed_var(0.6145f),
yawspeed_var(0.5852), yawspeed_var(0.5852f),
xmag_var(0.4786), xmag_var(0.4786f),
ymag_var(0.4566), ymag_var(0.4566f),
zmag_var(0.3333), zmag_var(0.3333f),
abs_pressure_var(1.1604), abs_pressure_var(1.1604f),
diff_pressure_var(1.1604), diff_pressure_var(1.1604f),
pressure_alt_var(1.1604), pressure_alt_var(1.1604f),
temperature_var(1.4290), temperature_var(1.4290f),
#ifndef __mobile__ #ifndef __mobile__
simulation(0), simulation(0),
...@@ -3005,7 +3005,7 @@ float UAS::addZeroMeanNoise(float truth_meas, float noise_var) ...@@ -3005,7 +3005,7 @@ float UAS::addZeroMeanNoise(float truth_meas, float noise_var)
/* Calculate normally distributed variable noise with mean = 0 and variance = noise_var. Calculated according to /* Calculate normally distributed variable noise with mean = 0 and variance = noise_var. Calculated according to
Box-Muller transform */ Box-Muller transform */
static const float epsilon = std::numeric_limits<float>::min(); //used to ensure non-zero uniform numbers static const float epsilon = std::numeric_limits<float>::min(); //used to ensure non-zero uniform numbers
static const float two_pi = 2.0*3.14159265358979323846; // 2*pi static const float two_pi = 2.0f * 3.14159265358979323846f; // 2*pi
static float z0; //calculated normal distribution random variables with mu = 0, var = 1; static float z0; //calculated normal distribution random variables with mu = 0, var = 1;
float u1, u2; //random variables generated from c++ rand(); float u1, u2; //random variables generated from c++ rand();
......
This diff is collapsed.
...@@ -23,81 +23,59 @@ This file is part of the QGROUNDCONTROL project ...@@ -23,81 +23,59 @@ This file is part of the QGROUNDCONTROL project
/** /**
* @file * @file
* @brief QGC Attitude Instrument * @brief QGC Attitude Widget
* @author Gus Grubba <mavlink@grubba.com> * @author Gus Grubba <mavlink@grubba.com>
*/ */
import QtQuick 2.4 import QtQuick 2.4
import QGroundControl.Controls 1.0 import QGroundControl.ScreenTools 1.0
QGCMovableItem { Item {
id: root id: root
property real rollAngle: 0 anchors.centerIn: parent
property real rollAngle : 0
property real pitchAngle: 0 property real pitchAngle: 0
property bool showPitch: true property bool showPitch: true
property real size
width: size
height: size
//----------------------------------------------------
//-- Artificial Horizon
QGCArtificialHorizon {
rollAngle: root.rollAngle
pitchAngle: root.pitchAngle
anchors.fill: parent
}
//----------------------------------------------------
//-- Pointer
Image { Image {
id: pointer id: rollDial
source: "/qmlimages/attitudePointer.svg" anchors { bottom: root.verticalCenter; horizontalCenter: parent.horizontalCenter}
source: "/qmlimages/rollDialWhite.svg"
mipmap: true mipmap: true
width: parent.width
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
anchors.fill: parent transform: Rotation {
origin.x: rollDial.width / 2
origin.y: rollDial.height
angle: -rollAngle
}
} }
//----------------------------------------------------
//-- Instrument Dial
Image { Image {
id: instrumentDial id: pointer
source: "/qmlimages/attitudeDial.svg" anchors { bottom: root.verticalCenter; horizontalCenter: parent.horizontalCenter}
source: "/qmlimages/rollPointerWhite.svg"
mipmap: true mipmap: true
width: rollDial.width
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
anchors.fill: parent
transform: Rotation {
origin.x: root.width / 2
origin.y: root.height / 2
angle: -rollAngle
}
} }
//----------------------------------------------------
//-- Pitch
QGCPitchWidget {
id: pitchWidget
visible: root.showPitch
size: root.size * 0.65
anchors.verticalCenter: parent.verticalCenter
pitchAngle: root.pitchAngle
rollAngle: root.rollAngle
color: Qt.rgba(0,0,0,0)
}
//----------------------------------------------------
//-- Cross Hair
Image { Image {
id: crossHair id: crossHair
anchors.centerIn: parent anchors.centerIn: parent
source: "/qmlimages/crossHair.svg" source: "/qmlimages/crossHair.svg"
mipmap: true mipmap: true
width: size * 0.75 width: parent.width
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
} }
//----------------------------------------------------
//-- Instrument Pannel QGCPitchIndicator {
Image { id: pitchIndicator
id: pannel anchors.verticalCenter: parent.verticalCenter
source: "/qmlimages/attitudeInstrument.svg" visible: root.showPitch
mipmap: true pitchAngle: root.pitchAngle
fillMode: Image.PreserveAspectFit rollAngle: root.rollAngle
anchors.fill: parent color: Qt.rgba(0,0,0,0)
size: ScreenTools.defaultFontPixelSize * (10)
} }
} }
...@@ -23,48 +23,81 @@ This file is part of the QGROUNDCONTROL project ...@@ -23,48 +23,81 @@ This file is part of the QGROUNDCONTROL project
/** /**
* @file * @file
* @brief QGC Attitude Widget * @brief QGC Attitude Instrument
* @author Gus Grubba <mavlink@grubba.com> * @author Gus Grubba <mavlink@grubba.com>
*/ */
import QtQuick 2.4 import QtQuick 2.4
import QGroundControl.ScreenTools 1.0 import QGroundControl.Controls 1.0
Item { QGCMovableItem {
id: root id: root
anchors.centerIn: parent property real rollAngle: 0
property real rollAngle : 0
property real pitchAngle: 0 property real pitchAngle: 0
property bool showPitch: true
property real size
width: size
height: size
//----------------------------------------------------
//-- Artificial Horizon
QGCArtificialHorizon {
rollAngle: root.rollAngle
pitchAngle: root.pitchAngle
anchors.fill: parent
}
//----------------------------------------------------
//-- Pointer
Image { Image {
id: rollDial id: pointer
anchors { bottom: root.verticalCenter; horizontalCenter: parent.horizontalCenter} source: "/qmlimages/attitudePointer.svg"
source: "/qmlimages/rollDialWhite.svg"
mipmap: true mipmap: true
width: parent.width
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
transform: Rotation { anchors.fill: parent
origin.x: rollDial.width / 2
origin.y: rollDial.height
angle: -rollAngle
}
} }
//----------------------------------------------------
//-- Instrument Dial
Image { Image {
id: pointer id: instrumentDial
anchors { bottom: root.verticalCenter; horizontalCenter: parent.horizontalCenter} source: "/qmlimages/attitudeDial.svg"
source: "/qmlimages/rollPointerWhite.svg"
mipmap: true mipmap: true
width: rollDial.width
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
anchors.fill: parent
transform: Rotation {
origin.x: root.width / 2
origin.y: root.height / 2
angle: -rollAngle
}
} }
//----------------------------------------------------
//-- Pitch
QGCPitchIndicator {
id: pitchWidget
visible: root.showPitch
size: root.size * 0.65
anchors.verticalCenter: parent.verticalCenter
pitchAngle: root.pitchAngle
rollAngle: root.rollAngle
color: Qt.rgba(0,0,0,0)
}
//----------------------------------------------------
//-- Cross Hair
Image { Image {
id: crossHair id: crossHair
anchors.centerIn: parent anchors.centerIn: parent
source: "/qmlimages/crossHair.svg" source: "/qmlimages/crossHair.svg"
mipmap: true mipmap: true
width: parent.width width: size * 0.75
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
} }
//----------------------------------------------------
//-- Instrument Pannel
Image {
id: pannel
source: "/qmlimages/attitudeInstrument.svg"
mipmap: true
fillMode: Image.PreserveAspectFit
anchors.fill: parent
}
} }
...@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project
/** /**
* @file * @file
* @brief QGC Compass * @brief QGC Compass HUD
* @author Gus Grubba <mavlink@grubba.com> * @author Gus Grubba <mavlink@grubba.com>
*/ */
...@@ -70,5 +70,3 @@ Item { ...@@ -70,5 +70,3 @@ Item {
} }
} }
} }
...@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project
/** /**
* @file * @file
* @brief QGC Compass * @brief QGC Compass Widget
* @author Gus Grubba <mavlink@grubba.com> * @author Gus Grubba <mavlink@grubba.com>
*/ */
......
Module QGroundControl.FlightControls Module QGroundControl.FlightControls
QGCAltitudeWidget 1.0 QGCAltitudeWidget.qml QGCAltitudeWidget 1.0 QGCAltitudeWidget.qml
QGCArtificialHorizon 1.0 QGCArtificialHorizon.qml
QGCAttitudeHUD 1.0 QGCAttitudeHUD.qml
QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml QGCAttitudeWidget 1.0 QGCAttitudeWidget.qml
QGCCompass 1.0 QGCCompass.qml QGCCompassHUD 1.0 QGCCompassHUD.qml
QGCCompassWidget 1.0 QGCCompassWidget.qml
QGCCurrentAltitude 1.0 QGCCurrentAltitude.qml QGCCurrentAltitude 1.0 QGCCurrentAltitude.qml
QGCCurrentSpeed 1.0 QGCCurrentSpeed.qml QGCCurrentSpeed 1.0 QGCCurrentSpeed.qml
QGCHudMessage 1.0 QGCHudMessage.qml
QGCMapBackground 1.0 QGCMapBackground.qml QGCMapBackground 1.0 QGCMapBackground.qml
QGCPitchWidget 1.0 QGCPitchWidget.qml
QGCSpeedWidget 1.0 QGCSpeedWidget.qml
QGCSlider 1.0 QGCSlider.qml
QGCWaypointEditor 1.0 QGCWaypointEditor.qml
QGCMapToolButton 1.0 QGCMapToolButton.qml QGCMapToolButton 1.0 QGCMapToolButton.qml
QGCAttitudeInstrument 1.0 QGCAttitudeInstrument.qml QGCPitchIndicator 1.0 QGCPitchIndicator.qml
QGCCompassInstrument 1.0 QGCCompassInstrument.qml QGCSlider 1.0 QGCSlider.qml
QGCArtificialHorizon 1.0 QGCArtificialHorizon.qml QGCSpeedWidget 1.0 QGCSpeedWidget.qml
QGCWaypoint 1.0 QGCWaypoint.qml
QGCHudMessage 1.0 QGCHudMessage.qml
QGCVideoBackground 1.0 QGCVideoBackground.qml QGCVideoBackground 1.0 QGCVideoBackground.qml
QGCWaypoint 1.0 QGCWaypoint.qml
QGCWaypointEditor 1.0 QGCWaypointEditor.qml
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