diff --git a/flight/modules/ManualControl/stabilizedhandler.c b/flight/modules/ManualControl/stabilizedhandler.c index f57e665f5..7de4ae24d 100644 --- a/flight/modules/ManualControl/stabilizedhandler.c +++ b/flight/modules/ManualControl/stabilizedhandler.c @@ -54,14 +54,14 @@ static float sinAngle = 0.0f; static float applyExpo(float value, float expo) { // note: fastPow makes a small error, therefore result needs to be bound - float exp = boundf(fastPow(1.00695f, expo), 0.5f, 2.0f); + float exp = boundf(fastPow(1.01395948f, expo), 0.25f, 4.0f); // magic number scales expo // so that // expo=100 yields value**10 // expo=0 yields value**1 // expo=-100 yields value**(1/10) - // (pow(2.0,1/100)~=1.00695) + // (pow(4.0,1/100)~=1.01395948) if (value > 0.0f) { return boundf(fastPow(value, exp), 0.0f, 1.0f); } else if (value < -0.0f) { diff --git a/ground/gcs/src/plugins/config/configstabilizationwidget.h b/ground/gcs/src/plugins/config/configstabilizationwidget.h index 529a81a0b..7c18d8b4d 100644 --- a/ground/gcs/src/plugins/config/configstabilizationwidget.h +++ b/ground/gcs/src/plugins/config/configstabilizationwidget.h @@ -63,7 +63,7 @@ private: static const int AUTOMATIC_UPDATE_RATE = 500; static const int EXPO_CURVE_POINTS_COUNT = 100; - constexpr static const double EXPO_CURVE_CONSTANT = 1.00695; + constexpr static const double EXPO_CURVE_CONSTANT = 1.01395948; int boardModel; int m_stabSettingsBankCount; diff --git a/ground/gcs/src/plugins/config/stabilization.ui b/ground/gcs/src/plugins/config/stabilization.ui index 95fadca4a..36f9d51fa 100644 --- a/ground/gcs/src/plugins/config/stabilization.ui +++ b/ground/gcs/src/plugins/config/stabilization.ui @@ -149,6 +149,12 @@ + + + 0 + 0 + + ArrowCursor @@ -167,16 +173,22 @@ margin-top: -1px; + + + 0 + 0 + + 0 - 340 + 400 16777215 - 340 + 400 @@ -189,287 +201,32 @@ margin-top: -1px; 0 - - - - Acro+ - - - - - - - 0 - 0 - - - - Qt::StrongFocus - - - <html><head/><body><p>Link roll &amp; pitch sliders to move together</p></body></html> - - - - - - Link Roll and Pitch - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Reset all values to GCS defaults - - - false - - - - - - Default - - - - button:default - buttongroup:77 - - - - - - - - 0 - - - - - - 0 - 25 - - - - <html><head/><body><p>The Acro + slider can be adjusted to change the amount of manual control blending.</p></body></html> - - - 0 - - - 100 - - - 1 - - - 50 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 5 - - - - objname:StabilizationSettingsBankX - fieldname:AcroInsanityFactor - scale:1 - buttongroup:77 - element:Roll - - - - - - - - - 60 - 22 - - - - - 60 - 22 - - - - 0 - - - 100 - - - 50 - - - - objname:StabilizationSettingsBankX - fieldname:AcroInsanityFactor - scale:1 - buttongroup:77 - element:Roll - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - Roll Factor - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 25 - - - - <html><head/><body><p>The Acro + slider can be adjusted to change the amount of manual control blending.</p></body></html> - - - 0 - - - 100 - - - 1 - - - 50 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 5 - - - - objname:StabilizationSettingsBankX - fieldname:AcroInsanityFactor - scale:1 - buttongroup:77 - element:Pitch - - - - - - - - - 60 - 22 - - - - - 60 - 22 - - - - 0 - - - 100 - - - 50 - - - - objname:StabilizationSettingsBankX - fieldname:AcroInsanityFactor - scale:1 - buttongroup:77 - element:Pitch - - - - - - - - - 0 - 0 - - - - - 80 - 0 - - - - Pitch Factor - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - + + 9 + + + 10 + + + true + + + + 0 + 0 + + + + + 0 + 0 + + - 300 + 260 16777215 @@ -627,11 +384,29 @@ margin-top: -1px; - + 0 0 + + + 220 + 220 + + + + + 0 + 0 + + + + + 0 + 0 + + <html><head/><body><p>This graph shows the Expo curves for all axis. The color of the curves corresponds with the colors of the slider labels below.</p></body></html> @@ -934,7 +709,7 @@ margin-top: -1px; - 550 + 450 0 @@ -1018,7 +793,7 @@ margin-top: -1px; 0 - 0 + 6 @@ -1066,7 +841,7 @@ margin-top: -1px; 80 - 16 + 0 @@ -1641,11 +1416,11 @@ border-radius: 5; 80 - 16 + 0 - Rate yaw + Rate Yaw Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -2254,7 +2029,7 @@ border-radius: 5; 100 - 800 + 1000 400 @@ -2326,7 +2101,7 @@ border-radius: 5; 80 - 16 + 0 @@ -3006,6 +2781,288 @@ border-radius: 5; + + + + + 0 + 0 + + + + Acro+ + + + + + + + 0 + 0 + + + + Qt::StrongFocus + + + <html><head/><body><p>Link roll &amp; pitch sliders to move together</p></body></html> + + + + + + Link Roll and Pitch + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Reset all values to GCS defaults + + + false + + + + + + Default + + + + button:default + buttongroup:77 + + + + + + + + 0 + + + + + + 0 + 25 + + + + <html><head/><body><p>The Acro + slider can be adjusted to change the amount of manual control blending.</p></body></html> + + + 0 + + + 100 + + + 1 + + + 50 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 5 + + + + objname:StabilizationSettingsBankX + fieldname:AcroInsanityFactor + scale:1 + buttongroup:77 + element:Roll + + + + + + + + + 60 + 22 + + + + + 60 + 22 + + + + 0 + + + 100 + + + 50 + + + + objname:StabilizationSettingsBankX + fieldname:AcroInsanityFactor + scale:1 + buttongroup:77 + element:Roll + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + Roll Factor + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 25 + + + + <html><head/><body><p>The Acro + slider can be adjusted to change the amount of manual control blending.</p></body></html> + + + 0 + + + 100 + + + 1 + + + 50 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 5 + + + + objname:StabilizationSettingsBankX + fieldname:AcroInsanityFactor + scale:1 + buttongroup:77 + element:Pitch + + + + + + + + + 60 + 22 + + + + + 60 + 22 + + + + 0 + + + 100 + + + 50 + + + + objname:StabilizationSettingsBankX + fieldname:AcroInsanityFactor + scale:1 + buttongroup:77 + element:Pitch + + + + + + + + + 0 + 0 + + + + + 80 + 0 + + + + Pitch Factor + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + @@ -9030,7 +9087,7 @@ response (deg/s) 0 - 1000000.000000000000000 + 2000.000000000000000 1.000000000000000 @@ -9083,7 +9140,7 @@ response (deg/s) 0 - 1000000.000000000000000 + 2000.000000000000000 1.000000000000000 @@ -9700,7 +9757,7 @@ border-radius: 5; 0 - 1000000.000000000000000 + 2000.000000000000000 1.000000000000000 @@ -10358,7 +10415,7 @@ border-radius: 5; 0 - 1000000.000000000000000 + 2000.000000000000000 1.000000000000000 @@ -10411,7 +10468,7 @@ border-radius: 5; 0 - 1000000.000000000000000 + 2000.000000000000000 1.000000000000000 @@ -10464,7 +10521,7 @@ border-radius: 5; 0 - 1000000.000000000000000 + 2000.000000000000000 1.000000000000000