From 6174fa2d7f250e6aca5a3fc8ad262364d04a3c7c Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Thu, 20 Sep 2012 09:17:10 +1000 Subject: [PATCH] PFD: display the side-slip indicator --- .../share/openpilotgcs/pfd/default/Pfd.qml | 22 +++++++++++++++++++ .../src/plugins/pfdqml/pfdqmlgadgetwidget.cpp | 1 + 2 files changed, 23 insertions(+) diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml index c0456dd76..e393b185e 100644 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/Pfd.qml @@ -48,6 +48,28 @@ Rectangle { anchors.centerIn: parent } + SvgElementImage { + id: side_slip + elementName: "sideslip" + sceneSize: background.sceneSize + smooth: true + + property real sideSlip: Accels.y + //smooth side slip changes, a low pass filter replacement + //accels are updated once per second + Behavior on sideSlip { + SmoothedAnimation { + duration: 1000 + velocity: -1 + } + } + + anchors.horizontalCenter: foreground.horizontalCenter + //0.5 coefficient is empirical to limit indicator movement + anchors.horizontalCenterOffset: -sideSlip*width*0.5 + y: scaledBounds.y * sceneItem.height + } + Compass { anchors.fill: parent sceneSize: background.sceneSize diff --git a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp index 0c0ff6e36..7ef3612aa 100644 --- a/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/pfdqml/pfdqmlgadgetwidget.cpp @@ -51,6 +51,7 @@ PfdQmlGadgetWidget::PfdQmlGadgetWidget(QWidget *parent) : objectsToExport << "VelocityActual" << "PositionActual" << "AttitudeActual" << + "Accels" << "VelocityDesired" << "PositionDesired" << "AttitudeHoldDesired" <<