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){
|
}else if(cal.measure_var == AHRSCALIBRATION_MEASURE_VAR_MEASURE){
|
||||||
calibrate_sensors();
|
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();
|
send_calibration();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ typedef struct {
|
|||||||
// Field information
|
// Field information
|
||||||
// Field measure_var information
|
// Field measure_var information
|
||||||
/* Enumeration options for field measure_var */
|
/* 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
|
// Field accel_bias information
|
||||||
/* Array element names for field accel_bias */
|
/* 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;
|
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...");
|
m_ahrs->calibInstructions->setText("Getting results...");
|
||||||
connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(calibPhase2()));
|
connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(calibPhase2()));
|
||||||
// We need to echo back the results of calibration before changing to set mode
|
// We need to echo back the results of calibration before changing to set mode
|
||||||
field->setValue("ECHO");
|
obj->requestUpdate();
|
||||||
obj->updated();
|
|
||||||
break;
|
break;
|
||||||
case 1: // this is where we end up with the update just above
|
case 1: // This is the update with the right values (coming from the board)
|
||||||
phaseCounter++;
|
|
||||||
break;
|
|
||||||
case 2: // This is the update with the right values (coming from the board)
|
|
||||||
disconnect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(calibPhase2()));
|
disconnect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(calibPhase2()));
|
||||||
// Now update size of all the graphs
|
// Now update size of all the graphs
|
||||||
drawVariancesGraph();
|
drawVariancesGraph();
|
||||||
|
@ -47,7 +47,6 @@ AHRSCalibration::AHRSCalibration(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTING
|
|||||||
QStringList measure_varEnumOptions;
|
QStringList measure_varEnumOptions;
|
||||||
measure_varEnumOptions.append("SET");
|
measure_varEnumOptions.append("SET");
|
||||||
measure_varEnumOptions.append("MEASURE");
|
measure_varEnumOptions.append("MEASURE");
|
||||||
measure_varEnumOptions.append("ECHO");
|
|
||||||
fields.append( new UAVObjectField(QString("measure_var"), QString(""), UAVObjectField::ENUM, measure_varElemNames, measure_varEnumOptions) );
|
fields.append( new UAVObjectField(QString("measure_var"), QString(""), UAVObjectField::ENUM, measure_varElemNames, measure_varEnumOptions) );
|
||||||
QStringList accel_biasElemNames;
|
QStringList accel_biasElemNames;
|
||||||
accel_biasElemNames.append("X");
|
accel_biasElemNames.append("X");
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
// Field information
|
// Field information
|
||||||
// Field measure_var information
|
// Field measure_var information
|
||||||
/* Enumeration options for field measure_var */
|
/* 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
|
// Field accel_bias information
|
||||||
/* Array element names for field accel_bias */
|
/* Array element names for field accel_bias */
|
||||||
typedef enum { ACCEL_BIAS_X=0, ACCEL_BIAS_Y=1, ACCEL_BIAS_Z=2 } accel_biasElem;
|
typedef enum { ACCEL_BIAS_X=0, ACCEL_BIAS_Y=1, ACCEL_BIAS_Z=2 } accel_biasElem;
|
||||||
|
@ -47,7 +47,6 @@ _fields = [ \
|
|||||||
{
|
{
|
||||||
'0' : 'SET',
|
'0' : 'SET',
|
||||||
'1' : 'MEASURE',
|
'1' : 'MEASURE',
|
||||||
'2' : 'ECHO',
|
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
uavobject.UAVObjectField(
|
uavobject.UAVObjectField(
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<xml>
|
<xml>
|
||||||
<object name="AHRSCalibration" singleinstance="true" settings="true">
|
<object name="AHRSCalibration" singleinstance="true" settings="true">
|
||||||
<description>Contains the calibration settings for the @ref AHRSCommsModule</description>
|
<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_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_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"/>
|
<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