mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
AHRS: Get calibration working again
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1842 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
0c30101f54
commit
5c9b5f4a99
@ -779,12 +779,6 @@ void calibration_callback(AhrsObjHandle obj)
|
||||
}
|
||||
}else if(cal.measure_var == AHRSCALIBRATION_MEASURE_VAR_MEASURE){
|
||||
calibrate_sensors();
|
||||
AHRSCalibrationData cal;
|
||||
AHRSCalibrationGet(&cal);
|
||||
cal.measure_var = AHRSCALIBRATION_MEASURE_VAR_SET;
|
||||
AHRSCalibrationSet(&cal);
|
||||
|
||||
}else if(cal.measure_var == AHRSCALIBRATION_MEASURE_VAR_ECHO){
|
||||
send_calibration();
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ typedef struct {
|
||||
// Field information
|
||||
// Field measure_var information
|
||||
/* Enumeration options for field measure_var */
|
||||
typedef enum { AHRSCALIBRATION_MEASURE_VAR_SET=0, AHRSCALIBRATION_MEASURE_VAR_MEASURE=1, AHRSCALIBRATION_MEASURE_VAR_ECHO=2 } AHRSCalibrationmeasure_varOptions;
|
||||
typedef enum { AHRSCALIBRATION_MEASURE_VAR_SET=0, AHRSCALIBRATION_MEASURE_VAR_MEASURE=1 } AHRSCalibrationmeasure_varOptions;
|
||||
// Field accel_bias information
|
||||
/* Array element names for field accel_bias */
|
||||
typedef enum { AHRSCALIBRATION_ACCEL_BIAS_X=0, AHRSCALIBRATION_ACCEL_BIAS_Y=1, AHRSCALIBRATION_ACCEL_BIAS_Z=2 } AHRSCalibrationaccel_biasElem;
|
||||
|
@ -279,13 +279,9 @@ void ConfigAHRSWidget::calibPhase2()
|
||||
m_ahrs->calibInstructions->setText("Getting results...");
|
||||
connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(calibPhase2()));
|
||||
// We need to echo back the results of calibration before changing to set mode
|
||||
field->setValue("ECHO");
|
||||
obj->updated();
|
||||
obj->requestUpdate();
|
||||
break;
|
||||
case 1: // this is where we end up with the update just above
|
||||
phaseCounter++;
|
||||
break;
|
||||
case 2: // This is the update with the right values (coming from the board)
|
||||
case 1: // This is the update with the right values (coming from the board)
|
||||
disconnect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(calibPhase2()));
|
||||
// Now update size of all the graphs
|
||||
drawVariancesGraph();
|
||||
|
@ -47,7 +47,6 @@ AHRSCalibration::AHRSCalibration(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTING
|
||||
QStringList measure_varEnumOptions;
|
||||
measure_varEnumOptions.append("SET");
|
||||
measure_varEnumOptions.append("MEASURE");
|
||||
measure_varEnumOptions.append("ECHO");
|
||||
fields.append( new UAVObjectField(QString("measure_var"), QString(""), UAVObjectField::ENUM, measure_varElemNames, measure_varEnumOptions) );
|
||||
QStringList accel_biasElemNames;
|
||||
accel_biasElemNames.append("X");
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
// Field information
|
||||
// Field measure_var information
|
||||
/* Enumeration options for field measure_var */
|
||||
typedef enum { MEASURE_VAR_SET=0, MEASURE_VAR_MEASURE=1, MEASURE_VAR_ECHO=2 } measure_varOptions;
|
||||
typedef enum { MEASURE_VAR_SET=0, MEASURE_VAR_MEASURE=1 } measure_varOptions;
|
||||
// Field accel_bias information
|
||||
/* Array element names for field accel_bias */
|
||||
typedef enum { ACCEL_BIAS_X=0, ACCEL_BIAS_Y=1, ACCEL_BIAS_Z=2 } accel_biasElem;
|
||||
|
@ -47,7 +47,6 @@ _fields = [ \
|
||||
{
|
||||
'0' : 'SET',
|
||||
'1' : 'MEASURE',
|
||||
'2' : 'ECHO',
|
||||
}
|
||||
),
|
||||
uavobject.UAVObjectField(
|
||||
|
@ -1,7 +1,7 @@
|
||||
<xml>
|
||||
<object name="AHRSCalibration" singleinstance="true" settings="true">
|
||||
<description>Contains the calibration settings for the @ref AHRSCommsModule</description>
|
||||
<field name="measure_var" units="" type="enum" elements="1" options="SET,MEASURE,ECHO" defaultvalue="SET"/>
|
||||
<field name="measure_var" units="" type="enum" elements="1" options="SET,MEASURE" defaultvalue="SET"/>
|
||||
<field name="accel_bias" units="raw" type="float" elementnames="X,Y,Z" defaultvalue="24"/>
|
||||
<field name="accel_scale" units="m/s" type="float" elementnames="X,Y,Z" defaultvalue="0.012"/>
|
||||
<field name="accel_var" units="m^2/s^s" type="float" elementnames="X,Y,Z" defaultvalue="5e-5"/>
|
||||
|
Loading…
Reference in New Issue
Block a user