mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 15:33:33 +08:00
select single system-wide wind estimate message (current best)
- publish wind estimate only from EKF, and wind speeds from airspeed selector to new separate topic (airspeed_wind) - rename message wind_estimate to wind - publish wind from currently used ekf instance (ekf2selector) Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -670,12 +670,12 @@ void RTL::get_rtl_xy_z_speed(float &xy, float &z)
|
||||
|
||||
matrix::Vector2f RTL::get_wind()
|
||||
{
|
||||
_wind_estimate_sub.update();
|
||||
_wind_sub.update();
|
||||
matrix::Vector2f wind;
|
||||
|
||||
if (hrt_absolute_time() - _wind_estimate_sub.get().timestamp < 1_s) {
|
||||
wind(0) = _wind_estimate_sub.get().windspeed_north;
|
||||
wind(1) = _wind_estimate_sub.get().windspeed_east;
|
||||
if (hrt_absolute_time() - _wind_sub.get().timestamp < 1_s) {
|
||||
wind(0) = _wind_sub.get().windspeed_north;
|
||||
wind(1) = _wind_sub.get().windspeed_east;
|
||||
}
|
||||
|
||||
return wind;
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <uORB/topics/home_position.h>
|
||||
#include <uORB/topics/rtl_flight_time.h>
|
||||
#include <uORB/topics/vehicle_status.h>
|
||||
#include <uORB/topics/wind_estimate.h>
|
||||
#include <uORB/topics/wind.h>
|
||||
#include <matrix/math.hpp>
|
||||
#include <lib/ecl/geo/geo.h>
|
||||
|
||||
@@ -169,7 +169,7 @@ private:
|
||||
param_t _param_rtl_xy_speed{PARAM_INVALID};
|
||||
param_t _param_rtl_descent_speed{PARAM_INVALID};
|
||||
|
||||
uORB::SubscriptionData<wind_estimate_s> _wind_estimate_sub{ORB_ID(wind_estimate)};
|
||||
uORB::SubscriptionData<wind_s> _wind_sub{ORB_ID(wind)};
|
||||
uORB::Publication<rtl_flight_time_s> _rtl_flight_time_pub{ORB_ID(rtl_flight_time)};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user