1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

AHRSCalibration: Make default values correct now Les extended

uavobjectgenerator to support multiple fields (thanks Les!).  Also
changed default scale on mag to +/-6g

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1899 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2010-10-06 14:26:42 +00:00 committed by peabody124
parent 66bf9d53d4
commit dea5c91646
4 changed files with 23 additions and 23 deletions

View File

@ -212,7 +212,7 @@ int main()
/* Setup the Accelerometer FS (Full-Scale) GPIO */
PIOS_GPIO_Enable(0);
SET_ACCEL_2G;
SET_ACCEL_6G;
#if defined(PIOS_INCLUDE_HMC5843) && defined(PIOS_INCLUDE_I2C)
/* Magnetic sensor system */
PIOS_I2C_Init();

View File

@ -81,20 +81,20 @@ static void setDefaults(UAVObjHandle obj, uint16_t instId)
UAVObjGetInstanceData(obj, instId, &data);
memset(&data, 0, sizeof(AHRSCalibrationData));
data.measure_var = 0;
data.accel_bias[0] = 24;
data.accel_bias[1] = 24;
data.accel_bias[2] = 24;
data.accel_scale[0] = 0.012;
data.accel_scale[1] = 0.012;
data.accel_scale[2] = 0.012;
data.accel_bias[0] = -72;
data.accel_bias[1] = -72;
data.accel_bias[2] = 72;
data.accel_scale[0] = 0.003;
data.accel_scale[1] = 0.003;
data.accel_scale[2] = -0.003;
data.accel_var[0] = 5e-05;
data.accel_var[1] = 5e-05;
data.accel_var[2] = 5e-05;
data.gyro_bias[0] = 23;
data.gyro_bias[1] = 23;
data.gyro_bias[1] = -23;
data.gyro_bias[2] = 23;
data.gyro_scale[0] = -0.014;
data.gyro_scale[1] = -0.014;
data.gyro_scale[1] = 0.014;
data.gyro_scale[2] = -0.014;
data.gyro_var[0] = 0.0001;
data.gyro_var[1] = 0.0001;

View File

@ -52,7 +52,7 @@ AHRSCalibration::AHRSCalibration(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTING
accel_biasElemNames.append("X");
accel_biasElemNames.append("Y");
accel_biasElemNames.append("Z");
fields.append( new UAVObjectField(QString("accel_bias"), QString("raw"), UAVObjectField::FLOAT32, accel_biasElemNames, QStringList()) );
fields.append( new UAVObjectField(QString("accel_bias"), QString("m/s"), UAVObjectField::FLOAT32, accel_biasElemNames, QStringList()) );
QStringList accel_scaleElemNames;
accel_scaleElemNames.append("X");
accel_scaleElemNames.append("Y");
@ -67,7 +67,7 @@ AHRSCalibration::AHRSCalibration(): UAVDataObject(OBJID, ISSINGLEINST, ISSETTING
gyro_biasElemNames.append("X");
gyro_biasElemNames.append("Y");
gyro_biasElemNames.append("Z");
fields.append( new UAVObjectField(QString("gyro_bias"), QString("raw"), UAVObjectField::FLOAT32, gyro_biasElemNames, QStringList()) );
fields.append( new UAVObjectField(QString("gyro_bias"), QString("deg/s"), UAVObjectField::FLOAT32, gyro_biasElemNames, QStringList()) );
QStringList gyro_scaleElemNames;
gyro_scaleElemNames.append("X");
gyro_scaleElemNames.append("Y");
@ -127,20 +127,20 @@ UAVObject::Metadata AHRSCalibration::getDefaultMetadata()
void AHRSCalibration::setDefaultFieldValues()
{
data.measure_var = 0;
data.accel_bias[0] = 24;
data.accel_bias[1] = 24;
data.accel_bias[2] = 24;
data.accel_scale[0] = 0.012;
data.accel_scale[1] = 0.012;
data.accel_scale[2] = 0.012;
data.accel_bias[0] = -72;
data.accel_bias[1] = -72;
data.accel_bias[2] = 72;
data.accel_scale[0] = 0.003;
data.accel_scale[1] = 0.003;
data.accel_scale[2] = -0.003;
data.accel_var[0] = 5e-05;
data.accel_var[1] = 5e-05;
data.accel_var[2] = 5e-05;
data.gyro_bias[0] = 23;
data.gyro_bias[1] = 23;
data.gyro_bias[1] = -23;
data.gyro_bias[2] = 23;
data.gyro_scale[0] = -0.014;
data.gyro_scale[1] = -0.014;
data.gyro_scale[1] = 0.014;
data.gyro_scale[2] = -0.014;
data.gyro_var[0] = 0.0001;
data.gyro_var[1] = 0.0001;

View File

@ -2,11 +2,11 @@
<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" 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_bias" units="m/s" type="float" elementnames="X,Y,Z" defaultvalue="-72,-72,72"/>
<field name="accel_scale" units="m/s" type="float" elementnames="X,Y,Z" defaultvalue="0.003,0.003,-0.003"/>
<field name="accel_var" units="m^2/s^s" type="float" elementnames="X,Y,Z" defaultvalue="5e-5"/>
<field name="gyro_bias" units="raw" type="float" elementnames="X,Y,Z" defaultvalue="23"/>
<field name="gyro_scale" units="deg/s" type="float" elementnames="X,Y,Z" defaultvalue="-0.0140"/>
<field name="gyro_bias" units="deg/s" type="float" elementnames="X,Y,Z" defaultvalue="23,-23,23"/>
<field name="gyro_scale" units="deg/s" type="float" elementnames="X,Y,Z" defaultvalue="-0.0140,0.014,-0.014"/>
<field name="gyro_var" units="deg^s/s^2" type="float" elementnames="X,Y,Z" defaultvalue="1e-4"/>
<field name="mag_bias" units="mGau" type="float" elementnames="X,Y,Z" defaultvalue="0"/>
<field name="mag_scale" units="mGau" type="float" elementnames="X,Y,Z" defaultvalue="1"/>