mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Merge branch 'next' into camera_stabilization
This commit is contained in:
commit
bbe3c1533a
@ -82,6 +82,7 @@ uint8_t max_axis_lock = 0;
|
||||
uint8_t max_axislock_rate = 0;
|
||||
float weak_leveling_kp = 0;
|
||||
uint8_t weak_leveling_max = 0;
|
||||
bool lowThrottleZeroIntegral;
|
||||
|
||||
pid_type pids[PID_MAX];
|
||||
|
||||
@ -335,6 +336,7 @@ static void stabilizationTask(void* parameters)
|
||||
}
|
||||
|
||||
if(flightStatus.Armed != FLIGHTSTATUS_ARMED_ARMED ||
|
||||
(lowThrottleZeroIntegral && stabDesired.Throttle < 0) ||
|
||||
!shouldUpdate)
|
||||
{
|
||||
ZeroPids();
|
||||
@ -433,6 +435,9 @@ static void SettingsUpdatedCb(UAVObjEvent * ev)
|
||||
weak_leveling_kp = settings.WeakLevelingKp;
|
||||
weak_leveling_max = settings.MaxWeakLevelingRate;
|
||||
|
||||
// Whether to zero the PID integrals while throttle is low
|
||||
lowThrottleZeroIntegral = settings.LowThrottleZeroIntegral == STABILIZATIONSETTINGS_LOWTHROTTLEZEROINTEGRAL_TRUE;
|
||||
|
||||
// The dT has some jitter iteration to iteration that we don't want to
|
||||
// make thie result unpredictable. Still, it's nicer to specify the constant
|
||||
// based on a time (in ms) rather than a fixed multiplier. The error between
|
||||
|
@ -230,6 +230,8 @@ void ConfigStabilizationWidget::refreshValues()
|
||||
m_stabilization->maximumPitch->setValue(stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_PITCH]);
|
||||
m_stabilization->maximumYaw->setValue(stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_YAW]);
|
||||
|
||||
m_stabilization->lowThrottleZeroIntegral->setChecked(
|
||||
stabData.LowThrottleZeroIntegral == StabilizationSettings::LOWTHROTTLEZEROINTEGRAL_TRUE);
|
||||
}
|
||||
|
||||
|
||||
@ -277,6 +279,10 @@ void ConfigStabilizationWidget::sendStabilizationUpdate()
|
||||
stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_PITCH] = m_stabilization->maximumPitch->value();
|
||||
stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_YAW] = m_stabilization->maximumYaw->value();
|
||||
|
||||
stabData.LowThrottleZeroIntegral = m_stabilization->lowThrottleZeroIntegral->isChecked() ?
|
||||
StabilizationSettings::LOWTHROTTLEZEROINTEGRAL_TRUE :
|
||||
StabilizationSettings::LOWTHROTTLEZEROINTEGRAL_FALSE;
|
||||
|
||||
stabSettings->setData(stabData); // this is atomic
|
||||
}
|
||||
|
||||
|
@ -629,6 +629,13 @@ When you change one, the other is updated.</string>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="lowThrottleZeroIntegral">
|
||||
<property name="text">
|
||||
<string>Zero the integral when throttle is low</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
@ -218,8 +218,6 @@ void Telemetry::transactionCompleted(UAVObject* obj, bool success)
|
||||
transPending = false;
|
||||
// Send signal
|
||||
obj->emitTransactionCompleted(success);
|
||||
// Process new object updates from queue
|
||||
processObjectQueue();
|
||||
} else
|
||||
{
|
||||
// qDebug() << "Error: received a transaction completed when did not expect it.";
|
||||
|
@ -22,6 +22,8 @@
|
||||
<field name="WeakLevelingKp" units="(deg/s)/deg" type="float" elements="1" defaultvalue="0.1"/>
|
||||
<field name="MaxWeakLevelingRate" units="deg/s" type="uint8" elements="1" defaultvalue="5"/>
|
||||
|
||||
<field name="LowThrottleZeroIntegral" units="" type="enum" elements="1" options="FALSE,TRUE" defaultvalue="TRUE"/>
|
||||
|
||||
<access gcs="readwrite" flight="readwrite"/>
|
||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
||||
<telemetryflight acked="true" updatemode="onchange" period="0"/>
|
||||
|
Loading…
Reference in New Issue
Block a user