From 68bdf93a4d1f7004749bd09f41bd30b2a6e84087 Mon Sep 17 00:00:00 2001 From: rmackay9 Date: Mon, 5 Nov 2012 13:31:19 +0900 Subject: [PATCH] APM_Control: move reliance from IMU to INS --- libraries/APM_Control/AP_YawController.cpp | 4 ++-- libraries/APM_Control/AP_YawController.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/APM_Control/AP_YawController.cpp b/libraries/APM_Control/AP_YawController.cpp index 3e01dce642..396510b736 100644 --- a/libraries/APM_Control/AP_YawController.cpp +++ b/libraries/APM_Control/AP_YawController.cpp @@ -27,7 +27,7 @@ int32_t AP_YawController::get_servo_out(float scaler, bool stick_movement) } _last_t = tnow; - if(_imu == NULL) { // can't control without a reference + if(_ins == NULL) { // can't control without a reference return 0; } @@ -44,7 +44,7 @@ int32_t AP_YawController::get_servo_out(float scaler, bool stick_movement) } _stick_movement = stick_movement; - Vector3f accels = _imu->get_accel(); + Vector3f accels = _ins->get_accel(); // I didn't pull 512 out of a hat - it is a (very) loose approximation of 100*ToDeg(asin(-accels.y/9.81)) // which, with a P of 1.0, would mean that your rudder angle would be equal to your roll angle when diff --git a/libraries/APM_Control/AP_YawController.h b/libraries/APM_Control/AP_YawController.h index 05833f1791..693db2021f 100644 --- a/libraries/APM_Control/AP_YawController.h +++ b/libraries/APM_Control/AP_YawController.h @@ -12,7 +12,7 @@ class AP_YawController { public: void set_ahrs(AP_AHRS *ahrs) { _ahrs = ahrs; - _imu = _ahrs->get_imu(); + _ins = _ahrs->get_ins(); } int32_t get_servo_out(float scaler = 1.0, bool stick_movement = false); @@ -34,7 +34,7 @@ private: uint32_t _freeze_start_time; AP_AHRS *_ahrs; - IMU *_imu; + AP_InertialSensor *_ins; // Low pass filter cut frequency for derivative calculation. // FCUT macro computes a frequency cut based on an acceptable delay.