From 06357c40f2c03da0122617f81642e9168f7cf9b6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 19 Dec 2012 13:35:29 +1100 Subject: [PATCH] Copter: use new functions --- ArduCopter/ArduCopter.pde | 4 ++-- ArduCopter/test.pde | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index 31983c40d0..1393d380b6 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -1660,8 +1660,8 @@ void update_roll_pitch_mode(void) update_simple_mode(); } // mix in user control with Nav control - nav_roll += constrain(wrap_180(auto_roll - nav_roll), -g.auto_slew_rate.get(), g.auto_slew_rate.get()); // 40 deg a second - nav_pitch += constrain(wrap_180(auto_pitch - nav_pitch), -g.auto_slew_rate.get(), g.auto_slew_rate.get()); // 40 deg a second + nav_roll += constrain_int32(wrap_180(auto_roll - nav_roll), -g.auto_slew_rate.get(), g.auto_slew_rate.get()); // 40 deg a second + nav_pitch += constrain_int32(wrap_180(auto_pitch - nav_pitch), -g.auto_slew_rate.get(), g.auto_slew_rate.get()); // 40 deg a second control_roll = g.rc_1.control_mix(nav_roll); control_pitch = g.rc_2.control_mix(nav_pitch); diff --git a/ArduCopter/test.pde b/ArduCopter/test.pde index 7ef09a0814..ef2909b633 100644 --- a/ArduCopter/test.pde +++ b/ArduCopter/test.pde @@ -473,7 +473,7 @@ test_ins(uint8_t argc, const Menu::arg *argv) accel = ins.get_accel(); temp = ins.temperature(); - float test = sqrt(sq(accel.x) + sq(accel.y) + sq(accel.z)) / 9.80665; + float test = accel.length() / 9.80665; 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,