mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
Add support for Gyro bias calibration upon arming configuration in the CC Attitude config gadget.
This commit is contained in:
parent
f59e7f3410
commit
2b11fa6ee6
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>307</height>
|
||||
<height>343</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -142,6 +142,18 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="zeroGyroBiasOnArming">
|
||||
<property name="toolTip">
|
||||
<string>If enabled, a fast recalibration of gyro zero point will be done
|
||||
whenever the frame is armed. Do not move the airframe while
|
||||
arming it in that case!</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Zero gyro bias upon airframe arming</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
@ -241,6 +253,19 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
|
@ -53,7 +53,6 @@ ConfigCCAttitudeWidget::~ConfigCCAttitudeWidget()
|
||||
|
||||
void ConfigCCAttitudeWidget::attitudeRawUpdated(UAVObject * obj) {
|
||||
QMutexLocker locker(&startStop);
|
||||
UAVDataObject * attitudeRaw = dynamic_cast<UAVDataObject*>(obj);
|
||||
|
||||
ui->zeroBiasProgress->setValue((float) updates / NUM_ACCEL_UPDATES * 100);
|
||||
|
||||
@ -87,7 +86,6 @@ void ConfigCCAttitudeWidget::attitudeRawUpdated(UAVObject * obj) {
|
||||
|
||||
void ConfigCCAttitudeWidget::timeout() {
|
||||
QMutexLocker locker(&startStop);
|
||||
UAVObjectManager * objMngr = getObjectManager();
|
||||
UAVDataObject * obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AttitudeRaw")));
|
||||
disconnect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(attitudeRawUpdated(UAVObject*)));
|
||||
disconnect(&timer,SIGNAL(timeout()),this,SLOT(timeout()));
|
||||
@ -108,6 +106,11 @@ void ConfigCCAttitudeWidget::applyAttitudeSettings() {
|
||||
field->setValue(ui->pitchBias->value(),1);
|
||||
field->setValue(ui->yawBias->value(),2);
|
||||
|
||||
field = settings->getField("ZeroDuringArming");
|
||||
// Handling of boolean values is done through enums on
|
||||
// uavobjects...
|
||||
field->setValue((ui->zeroGyroBiasOnArming->isChecked()) ? "TRUE": "FALSE");
|
||||
|
||||
settings->updated();
|
||||
}
|
||||
|
||||
@ -118,6 +121,12 @@ void ConfigCCAttitudeWidget::getCurrentAttitudeSettings() {
|
||||
ui->rollBias->setValue(field->getDouble(0));
|
||||
ui->pitchBias->setValue(field->getDouble(1));
|
||||
ui->yawBias->setValue(field->getDouble(2));
|
||||
field = settings->getField("ZeroDuringArming");
|
||||
// Handling of boolean values is done through enums on
|
||||
// uavobjects...
|
||||
bool enabled = (field->getValue().toString() == "FALSE") ? false : true;
|
||||
ui->zeroGyroBiasOnArming->setChecked(enabled);
|
||||
|
||||
}
|
||||
|
||||
void ConfigCCAttitudeWidget::startAccelCalibration() {
|
||||
|
Loading…
Reference in New Issue
Block a user