From 6e431c29baee5531e86bd0c5342fe3b1acb7bba4 Mon Sep 17 00:00:00 2001 From: edouard Date: Fri, 25 Feb 2011 23:05:23 +0000 Subject: [PATCH] OP-146 Max angles can now be adjusted from the stabilization config dialog. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2881 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../config/configstabilizationwidget.cpp | 8 + .../src/plugins/config/stabilization.ui | 143 +++++++++++++++++- 2 files changed, 145 insertions(+), 6 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index 48ab560ce..c27e1f34f 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -206,6 +206,10 @@ void ConfigStabilizationWidget::requestStabilizationUpdate() m_stabilization->yawKi->setValue(stabData.YawPI[StabilizationSettings::YAWPI_KI]); m_stabilization->yawILimit->setValue(stabData.YawPI[StabilizationSettings::YAWPI_ILIMIT]); + m_stabilization->rollMax->setValue(stabData.RollMax); + m_stabilization->pitchMax->setValue(stabData.PitchMax); + m_stabilization->yawMax->setValue(stabData.YawMax); + } @@ -241,6 +245,10 @@ void ConfigStabilizationWidget::sendStabilizationUpdate() stabData.YawPI[StabilizationSettings::YAWPI_KI] = m_stabilization->yawKi->value(); stabData.YawPI[StabilizationSettings::YAWPI_ILIMIT] = m_stabilization->yawILimit->value(); + stabData.RollMax = m_stabilization->rollMax->value(); + stabData.PitchMax = m_stabilization->pitchMax->value(); + stabData.YawMax = m_stabilization->yawMax->value(); + stabSettings->setData(stabData); // this is atomic } diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index 89e983f6d..8db907256 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -27,11 +27,35 @@ - - - Rate Stabilization (inner loop) - - + + + + + Rate Stabilization (inner loop) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Hint: read the toolips! + + + + @@ -55,7 +79,8 @@ - Slowly raise Kp until you start seeing clear oscillations when you fly. + Slowly raise Kp until you start seeing clear oscillations when you fly. +Then lower the value by 20% or so. 6 @@ -245,6 +270,9 @@ + + Once Rate stabilization is done, you should increase the Kp factor until the airframe oscillates again, and go back down 20% + 6 @@ -394,6 +422,103 @@ Limits + + + + + Angle limits + + + + + + In this area, you can setup the limits for roll, pitch and yaw in attitude mode, i.e. what max attitude the airframe will reach if the sticks are pushed to the max. + + + QFrame::StyledPanel + + + QFrame::Raised + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + RollMax + + + + + + + 180 + + + + + + + PitchMax + + + + + + + 180 + + + + + + + YawMax + + + + + + + 180 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + @@ -414,6 +539,12 @@ + + false + + + Not implemented yet. + Reset to defaults