Browse Source

AP_AHRS: make get_position() const

This allows use from within AP_Mission
master
Andrew Tridgell 10 years ago
parent
commit
270bac4472
  1. 2
      libraries/AP_AHRS/AP_AHRS.h
  2. 2
      libraries/AP_AHRS/AP_AHRS_DCM.cpp
  3. 2
      libraries/AP_AHRS/AP_AHRS_DCM.h
  4. 2
      libraries/AP_AHRS/AP_AHRS_NavEKF.cpp
  5. 2
      libraries/AP_AHRS/AP_AHRS_NavEKF.h

2
libraries/AP_AHRS/AP_AHRS.h

@ -202,7 +202,7 @@ public: @@ -202,7 +202,7 @@ public:
// get our current position estimate. Return true if a position is available,
// otherwise false. This call fills in lat, lng and alt
virtual bool get_position(struct Location &loc) = 0;
virtual bool get_position(struct Location &loc) const = 0;
// return a wind estimation vector, in m/s
virtual Vector3f wind_estimate(void) = 0;

2
libraries/AP_AHRS/AP_AHRS_DCM.cpp

@ -872,7 +872,7 @@ float AP_AHRS_DCM::get_error_yaw(void) @@ -872,7 +872,7 @@ float AP_AHRS_DCM::get_error_yaw(void)
// return our current position estimate using
// dead-reckoning or GPS
bool AP_AHRS_DCM::get_position(struct Location &loc)
bool AP_AHRS_DCM::get_position(struct Location &loc) const
{
loc.lat = _last_lat;
loc.lng = _last_lng;

2
libraries/AP_AHRS/AP_AHRS_DCM.h

@ -83,7 +83,7 @@ public: @@ -83,7 +83,7 @@ public:
void reset_attitude(const float &roll, const float &pitch, const float &yaw);
// dead-reckoning support
virtual bool get_position(struct Location &loc);
virtual bool get_position(struct Location &loc) const;
// status reporting
float get_error_rp(void);

2
libraries/AP_AHRS/AP_AHRS_NavEKF.cpp

@ -129,7 +129,7 @@ void AP_AHRS_NavEKF::reset_attitude(const float &_roll, const float &_pitch, con @@ -129,7 +129,7 @@ void AP_AHRS_NavEKF::reset_attitude(const float &_roll, const float &_pitch, con
}
// dead-reckoning support
bool AP_AHRS_NavEKF::get_position(struct Location &loc)
bool AP_AHRS_NavEKF::get_position(struct Location &loc) const
{
if (using_EKF() && EKF.getLLH(loc)) {
return true;

2
libraries/AP_AHRS/AP_AHRS_NavEKF.h

@ -56,7 +56,7 @@ public: @@ -56,7 +56,7 @@ public:
void reset_attitude(const float &roll, const float &pitch, const float &yaw);
// dead-reckoning support
bool get_position(struct Location &loc);
bool get_position(struct Location &loc) const;
// status reporting of estimated error
float get_error_rp(void);

Loading…
Cancel
Save