APM_Control: move reliance from IMU to INS

This commit is contained in:
rmackay9 2012-11-05 13:31:19 +09:00
parent 7f190b8494
commit 68bdf93a4d
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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.