AP_GPS: use 3D velocity for uBlox

this makes uBlox use the 3D velocity for ground course and speed,
ensuring we use a consistent value everywhere (so same vector in EKF
as in navigation)
This commit is contained in:
Andrew Tridgell 2016-05-05 15:28:15 +10:00
parent 7abaa75653
commit 428923b4b1
1 changed files with 2 additions and 0 deletions

View File

@ -928,6 +928,8 @@ AP_GPS_UBLOX::_parse_gps(void)
state.velocity.x = _buffer.velned.ned_north * 0.01f;
state.velocity.y = _buffer.velned.ned_east * 0.01f;
state.velocity.z = _buffer.velned.ned_down * 0.01f;
state.ground_course = wrap_360(degrees(atan2f(state.velocity.y, state.velocity.x)));
state.ground_speed = pythagorous2(state.velocity.y, state.velocity.x);
state.have_speed_accuracy = true;
state.speed_accuracy = _buffer.velned.speed_accuracy*0.01f;
#if UBLOX_FAKE_3DLOCK