Copter: use GRAVITY_MSS
This commit is contained in:
parent
4cdb3cd390
commit
ead38f917f
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user