From 0e065e48947ee40cefcb38177ea11fb04f9b2c78 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Mon, 21 Apr 2014 21:58:42 +0900 Subject: [PATCH] AP_InertialNav: get_velocity_xy const --- libraries/AP_InertialNav/AP_InertialNav.cpp | 2 +- libraries/AP_InertialNav/AP_InertialNav.h | 2 +- libraries/AP_InertialNav/AP_InertialNav_NavEKF.cpp | 2 +- libraries/AP_InertialNav/AP_InertialNav_NavEKF.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/AP_InertialNav/AP_InertialNav.cpp b/libraries/AP_InertialNav/AP_InertialNav.cpp index e876840313..4be03b7896 100644 --- a/libraries/AP_InertialNav/AP_InertialNav.cpp +++ b/libraries/AP_InertialNav/AP_InertialNav.cpp @@ -281,7 +281,7 @@ void AP_InertialNav::set_velocity_xy(float x, float y) } // set_velocity_xy - set velocity in latitude & longitude directions (in cm/s) -float AP_InertialNav::get_velocity_xy() +float AP_InertialNav::get_velocity_xy() const { return pythagorous2(_velocity.x, _velocity.y); } diff --git a/libraries/AP_InertialNav/AP_InertialNav.h b/libraries/AP_InertialNav/AP_InertialNav.h index 83112a6fa0..074f63384c 100644 --- a/libraries/AP_InertialNav/AP_InertialNav.h +++ b/libraries/AP_InertialNav/AP_InertialNav.h @@ -129,7 +129,7 @@ public: * * @returns the current horizontal velocity in cm/s */ - virtual float get_velocity_xy(); + virtual float get_velocity_xy() const; /** * set_velocity_xy - overwrites the current horizontal velocity in cm/s diff --git a/libraries/AP_InertialNav/AP_InertialNav_NavEKF.cpp b/libraries/AP_InertialNav/AP_InertialNav_NavEKF.cpp index 06ea8f7ae3..bffde6246f 100644 --- a/libraries/AP_InertialNav/AP_InertialNav_NavEKF.cpp +++ b/libraries/AP_InertialNav/AP_InertialNav_NavEKF.cpp @@ -137,7 +137,7 @@ const Vector3f &AP_InertialNav_NavEKF::get_velocity() const * * @returns the current horizontal velocity in cm/s */ -float AP_InertialNav_NavEKF::get_velocity_xy() +float AP_InertialNav_NavEKF::get_velocity_xy() const { if (_ahrs.have_inertial_nav()) { return pythagorous2(_velocity_cm.x, _velocity_cm.y); diff --git a/libraries/AP_InertialNav/AP_InertialNav_NavEKF.h b/libraries/AP_InertialNav/AP_InertialNav_NavEKF.h index 2b940b3b9f..710634162a 100644 --- a/libraries/AP_InertialNav/AP_InertialNav_NavEKF.h +++ b/libraries/AP_InertialNav/AP_InertialNav_NavEKF.h @@ -84,7 +84,7 @@ public: * * @returns the current horizontal velocity in cm/s */ - float get_velocity_xy(); + float get_velocity_xy() const; /** * altitude_ok - returns true if inertial based altitude and position can be trusted