Browse Source

AP_AHRS: added get_projected_position()

this is used to project the position forward by the GPS lag
master
Andrew Tridgell 12 years ago
parent
commit
c08c084191
  1. 12
      libraries/AP_AHRS/AP_AHRS.cpp
  2. 4
      libraries/AP_AHRS/AP_AHRS.h

12
libraries/AP_AHRS/AP_AHRS.cpp

@ -224,3 +224,15 @@ Vector2f AP_AHRS::groundspeed_vector(void) @@ -224,3 +224,15 @@ Vector2f AP_AHRS::groundspeed_vector(void)
}
return Vector2f(0.0f, 0.0f);
}
/*
get position projected by groundspeed and heading
*/
bool AP_AHRS::get_projected_position(struct Location *loc)
{
if (!get_position(loc)) {
return false;
}
location_update(loc, degrees(yaw), _gps->ground_speed * 0.01 * _gps->get_lag());
return true;
}

4
libraries/AP_AHRS/AP_AHRS.h

@ -127,6 +127,10 @@ public: @@ -127,6 +127,10 @@ public:
return true;
}
// get our projected position, based on our GPS position plus
// heading and ground speed
bool get_projected_position(struct Location *loc);
// return a wind estimation vector, in m/s
virtual Vector3f wind_estimate(void) {
return Vector3f(0,0,0);

Loading…
Cancel
Save