Copter: use GRAVITY_MSS

This commit is contained in:
Andrew Tridgell 2013-01-02 13:52:53 +11:00
parent 4cdb3cd390
commit ead38f917f
4 changed files with 5 additions and 7 deletions

View File

@ -465,8 +465,6 @@ static float scaleLongDown = 1;
////////////////////////////////////////////////////////////////////////////////
// Used by Mavlink for unknow reasons
static const float radius_of_earth = 6378100; // meters
// Used by Mavlink for unknow reasons
static const float gravity = 9.80665; // meters/ sec^2
// Unions for getting byte values
union float_int {

View File

@ -809,7 +809,7 @@ get_throttle_accel(int16_t z_target_accel)
float z_accel_meas;
// Calculate Earth Frame Z acceleration
z_accel_meas = -(ahrs.get_accel_ef().z + gravity) * 100;
z_accel_meas = -(ahrs.get_accel_ef().z + GRAVITY_MSS) * 100;
// calculate accel error and Filter with fc = 2 Hz
z_accel_error = z_accel_error + 0.11164 * (constrain(z_target_accel - z_accel_meas, -32000, 32000) - z_accel_error);

View File

@ -439,9 +439,9 @@ static void NOINLINE send_raw_imu1(mavlink_channel_t chan)
mavlink_msg_raw_imu_send(
chan,
micros(),
accel.x * 1000.0 / gravity,
accel.y * 1000.0 / gravity,
accel.z * 1000.0 / gravity,
accel.x * 1000.0 / GRAVITY_MSS,
accel.y * 1000.0 / GRAVITY_MSS,
accel.z * 1000.0 / GRAVITY_MSS,
gyro.x * 1000.0,
gyro.y * 1000.0,
gyro.z * 1000.0,

View File

@ -473,7 +473,7 @@ test_ins(uint8_t argc, const Menu::arg *argv)
accel = ins.get_accel();
temp = ins.temperature();
float test = accel.length() / 9.80665;
float test = accel.length() / GRAVITY_MSS;
cliSerial->printf_P(PSTR("a %7.4f %7.4f %7.4f g %7.4f %7.4f %7.4f t %74f | %7.4f\n"),
accel.x, accel.y, accel.z,