AP_AHRS: added get_projected_position()

this is used to project the position forward by the GPS lag
This commit is contained in:
Andrew Tridgell 2013-05-17 08:32:21 +10:00
parent 697d17a229
commit c08c084191
2 changed files with 16 additions and 0 deletions

View File

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

View File

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