diff --git a/libraries/AP_AHRS/AP_AHRS.cpp b/libraries/AP_AHRS/AP_AHRS.cpp index 8805ab1c30..904e6100e6 100644 --- a/libraries/AP_AHRS/AP_AHRS.cpp +++ b/libraries/AP_AHRS/AP_AHRS.cpp @@ -231,7 +231,7 @@ Vector2f AP_AHRS::groundspeed_vector(void) void AP_AHRS::update_trig(void) { Vector2f yaw_vector; - const Matrix3f &temp = get_dcm_matrix(); + const Matrix3f &temp = get_rotation_body_to_ned(); // sin_yaw, cos_yaw yaw_vector.x = temp.a.x; diff --git a/libraries/AP_AHRS/AP_AHRS.h b/libraries/AP_AHRS/AP_AHRS.h index d21e5b9de3..e23ce96830 100644 --- a/libraries/AP_AHRS/AP_AHRS.h +++ b/libraries/AP_AHRS/AP_AHRS.h @@ -178,7 +178,7 @@ public: // get yaw rate in earth frame in radians/sec float get_yaw_rate_earth(void) const { - return get_gyro() * get_dcm_matrix().c; + return get_gyro() * get_rotation_body_to_ned().c; } // Methods @@ -225,7 +225,7 @@ public: // return a DCM rotation matrix representing our current // attitude - virtual const Matrix3f &get_dcm_matrix(void) const = 0; + virtual const Matrix3f &get_rotation_body_to_ned(void) const = 0; // get our current position estimate. Return true if a position is available, // otherwise false. This call fills in lat, lng and alt diff --git a/libraries/AP_AHRS/AP_AHRS_DCM.h b/libraries/AP_AHRS/AP_AHRS_DCM.h index 6b45542e73..0a7cf57a7b 100644 --- a/libraries/AP_AHRS/AP_AHRS_DCM.h +++ b/libraries/AP_AHRS/AP_AHRS_DCM.h @@ -65,7 +65,7 @@ public: } // return rotation matrix representing rotaton from body to earth axes - const Matrix3f &get_dcm_matrix(void) const { + const Matrix3f &get_rotation_body_to_ned(void) const { return _body_dcm_matrix; } diff --git a/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp b/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp index 63ce940a2f..4d01ea7072 100644 --- a/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp +++ b/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp @@ -48,10 +48,10 @@ const Vector3f &AP_AHRS_NavEKF::get_gyro(void) const return _gyro_estimate; } -const Matrix3f &AP_AHRS_NavEKF::get_dcm_matrix(void) const +const Matrix3f &AP_AHRS_NavEKF::get_rotation_body_to_ned(void) const { if (!active_EKF_type()) { - return AP_AHRS_DCM::get_dcm_matrix(); + return AP_AHRS_DCM::get_rotation_body_to_ned(); } return _dcm_matrix; } diff --git a/libraries/AP_AHRS/AP_AHRS_NavEKF.h b/libraries/AP_AHRS/AP_AHRS_NavEKF.h index 2c80b90ea9..3c1badc266 100644 --- a/libraries/AP_AHRS/AP_AHRS_NavEKF.h +++ b/libraries/AP_AHRS/AP_AHRS_NavEKF.h @@ -51,7 +51,7 @@ public: // return the smoothed gyro vector corrected for drift const Vector3f &get_gyro(void) const; - const Matrix3f &get_dcm_matrix(void) const; + const Matrix3f &get_rotation_body_to_ned(void) const; // return the current drift correction integrator value const Vector3f &get_gyro_drift(void) const; diff --git a/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.cpp b/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.cpp index d7821fb106..394b9c5ce7 100644 --- a/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.cpp +++ b/libraries/AP_AHRS/examples/AHRS_Test/AHRS_Test.cpp @@ -57,7 +57,7 @@ void loop(void) if (now - last_compass > 100*1000UL && compass.read()) { - heading = compass.calculate_heading(ahrs.get_dcm_matrix()); + heading = compass.calculate_heading(ahrs.get_rotation_body_to_ned()); // read compass at 10Hz last_compass = now; #if WITH_GPS