Rover: use vector.xy().length() instead of norm(x,y)

This commit is contained in:
Josh Henderson 2021-09-11 06:35:52 -04:00 committed by Andrew Tridgell
parent f534a315ea
commit b2d9504c3a

View File

@ -256,7 +256,7 @@ void Rover::ahrs_update()
// if using the EKF get a speed update now (from accelerometers) // if using the EKF get a speed update now (from accelerometers)
Vector3f velocity; Vector3f velocity;
if (ahrs.get_velocity_NED(velocity)) { if (ahrs.get_velocity_NED(velocity)) {
ground_speed = norm(velocity.x, velocity.y); ground_speed = velocity.xy().length();
} else if (gps.status() >= AP_GPS::GPS_OK_FIX_3D) { } else if (gps.status() >= AP_GPS::GPS_OK_FIX_3D) {
ground_speed = ahrs.groundspeed(); ground_speed = ahrs.groundspeed();
} }