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

OP-316 - UAVObject units Fix accelerations units

Fix default calibration values

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2869 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
loris 2011-02-24 02:52:19 +00:00 committed by loris
parent c5d1aea9f4
commit 463403ee82
2 changed files with 28 additions and 28 deletions

View File

@ -702,7 +702,7 @@ void adc_callback(float * downsampled_data)
float accel[3], gyro[3];
// Accel data is (y,x,z) in first third and fifth byte. Convert to m/s
// Accel data is (y,x,z) in first third and fifth byte. Convert to m/s^2
accel[0] = (downsampled_data[ACCEL_RAW_X_IDX] * accel_data.calibration.scale[0]) + accel_data.calibration.bias[0];
accel[1] = (downsampled_data[ACCEL_RAW_Y_IDX] * accel_data.calibration.scale[1]) + accel_data.calibration.bias[1];
accel[2] = (downsampled_data[ACCEL_RAW_Z_IDX] * accel_data.calibration.scale[2]) + accel_data.calibration.bias[2];
@ -910,36 +910,36 @@ void calibrate_sensors()
* @brief Populate fields with initial values
*/
void reset_values() {
accel_data.calibration.scale[0] = 0.012;
accel_data.calibration.scale[1] = 0.012;
accel_data.calibration.scale[2] = -0.012;
accel_data.calibration.bias[0] = 24;
accel_data.calibration.bias[1] = 24;
accel_data.calibration.bias[2] = -24;
accel_data.calibration.variance[0] = 1e-4;
accel_data.calibration.variance[1] = 1e-4;
accel_data.calibration.variance[2] = 1e-4;
gyro_data.calibration.scale[0] = -0.014;
gyro_data.calibration.scale[1] = 0.014;
gyro_data.calibration.scale[2] = -0.014;
gyro_data.calibration.bias[0] = -24;
gyro_data.calibration.bias[1] = -24;
gyro_data.calibration.bias[2] = -24;
gyro_data.calibration.variance[0] = 1;
gyro_data.calibration.variance[1] = 1;
gyro_data.calibration.variance[2] = 1;
accel_data.calibration.scale[0] = 0.0359;
accel_data.calibration.scale[1] = 0.0359;
accel_data.calibration.scale[2] = -0.0359;
accel_data.calibration.bias[0] = -73.5;
accel_data.calibration.bias[1] = -73.5;
accel_data.calibration.bias[2] = 73.5;
accel_data.calibration.variance[0] = 5e-4;
accel_data.calibration.variance[1] = 5e-4;
accel_data.calibration.variance[2] = 5e-4;
gyro_data.calibration.scale[0] = -0.017;
gyro_data.calibration.scale[1] = 0.017;
gyro_data.calibration.scale[2] = -0.017;
gyro_data.calibration.bias[0] = 23;
gyro_data.calibration.bias[1] = -23;
gyro_data.calibration.bias[2] = 23;
gyro_data.calibration.variance[0] = 1e-4;
gyro_data.calibration.variance[1] = 1e-4;
gyro_data.calibration.variance[2] = 1e-4;
gyro_data.calibration.tempcompfactor[0] = 0;
gyro_data.calibration.tempcompfactor[1] = 0;
gyro_data.calibration.tempcompfactor[2] = 0;
mag_data.calibration.scale[0] = 1;
mag_data.calibration.scale[1] = 1;
mag_data.calibration.scale[2] = 1;
mag_data.calibration.scale[0] = -2;
mag_data.calibration.scale[1] = -2;
mag_data.calibration.scale[2] = -2;
mag_data.calibration.bias[0] = 0;
mag_data.calibration.bias[1] = 0;
mag_data.calibration.bias[2] = 0;
mag_data.calibration.variance[0] = 1;
mag_data.calibration.variance[1] = 1;
mag_data.calibration.variance[2] = 1;
mag_data.calibration.variance[0] = 50;
mag_data.calibration.variance[1] = 50;
mag_data.calibration.variance[2] = 50;
}

View File

@ -2,9 +2,9 @@
<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="m/s^2" type="float" elementnames="X,Y,Z" defaultvalue="-72,-72,72"/>
<field name="accel_scale" units="m/s^2" type="float" elementnames="X,Y,Z" defaultvalue="0.003,0.003,-0.003"/>
<field name="accel_var" units="(m/s^2)^2" type="float" elementnames="X,Y,Z" defaultvalue="5e-5"/>
<field name="accel_bias" units="m/s^2" type="float" elementnames="X,Y,Z" defaultvalue="-73.5,-73.5,73.5"/>
<field name="accel_scale" units="m/s^2" type="float" elementnames="X,Y,Z" defaultvalue="0.0359,0.0359,-0.0359"/>
<field name="accel_var" units="(m/s^2)^2" type="float" elementnames="X,Y,Z" defaultvalue="5e-4"/>
<field name="gyro_bias" units="rad/s" type="float" elementnames="X,Y,Z" defaultvalue="23,-23,23"/>
<field name="gyro_scale" units="rad/s" type="float" elementnames="X,Y,Z" defaultvalue="-0.017,0.017,-0.017"/>
<field name="gyro_var" units="(rad/s)^2" type="float" elementnames="X,Y,Z" defaultvalue="1e-4"/>