mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-02 10:23:25 +08:00
Blimp: use bool-returning AP_AHRS::get_wind
Moves off the Vector3f-returning wind_estimate() method. Blimp uses the success of airspeed_vector_TAS() to decide whether it has a usable wind estimate; that is left alone here, so no functional change.
This commit is contained in:
committed by
Peter Barker
parent
07ac38b8c6
commit
f1f46ebb56
@@ -326,7 +326,10 @@ void GCS_MAVLINK_Blimp::send_wind() const
|
||||
// valid wind estimate on blimps
|
||||
return;
|
||||
}
|
||||
const Vector3f wind = AP::ahrs().wind_estimate();
|
||||
Vector3f wind;
|
||||
// send the estimate even if it is not marked valid, to preserve
|
||||
// existing behaviour
|
||||
IGNORE_RETURN(AP::ahrs().get_wind(wind));
|
||||
mavlink_msg_wind_send(
|
||||
chan,
|
||||
degrees(atan2f(-wind.y, -wind.x)),
|
||||
@@ -344,7 +347,10 @@ uint8_t GCS_MAVLINK_Blimp::high_latency_wind_speed() const
|
||||
return 0;
|
||||
}
|
||||
// return units are m/s*5
|
||||
const Vector3f wind = AP::ahrs().wind_estimate();
|
||||
Vector3f wind;
|
||||
// use the estimate even if it is not marked valid, to preserve
|
||||
// existing behaviour
|
||||
IGNORE_RETURN(AP::ahrs().get_wind(wind));
|
||||
return wind.xy().length() * 5;
|
||||
}
|
||||
|
||||
@@ -356,7 +362,10 @@ uint8_t GCS_MAVLINK_Blimp::high_latency_wind_direction() const
|
||||
// valid wind estimate on blimps
|
||||
return 0;
|
||||
}
|
||||
const Vector3f wind = AP::ahrs().wind_estimate();
|
||||
Vector3f wind;
|
||||
// use the estimate even if it is not marked valid, to preserve
|
||||
// existing behaviour
|
||||
IGNORE_RETURN(AP::ahrs().get_wind(wind));
|
||||
// need to convert -180->180 to 0->360/2
|
||||
return wrap_360(degrees(atan2f(-wind.y, -wind.x))) / 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user