22 #include <geometry_msgs/TwistWithCovarianceStamped.h> 25 namespace std_plugins {
40 PluginBase::initialize(uas_);
61 void handle_apm_wind(
const mavlink::mavlink_message_t *msg, mavlink::ardupilotmega::msg::WIND &wind)
63 const double speed = wind.speed;
66 auto twist_cov = boost::make_shared<geometry_msgs::TwistWithCovarianceStamped>();
69 twist_cov->twist.twist.linear.x = speed * std::sin(course);
70 twist_cov->twist.twist.linear.y = speed * std::cos(course);
71 twist_cov->twist.twist.linear.z = -wind.speed_z;
84 void handle_px4_wind(
const mavlink::mavlink_message_t *msg, mavlink::common::msg::WIND_COV &wind)
86 auto twist_cov = boost::make_shared<geometry_msgs::TwistWithCovarianceStamped>();
90 twist_cov->twist.twist.linear);
95 cov_map(0, 0) = wind.var_horiz;
96 cov_map(2, 2) = wind.var_vert;
MAVROS Plugin base class.
void publish(const boost::shared_ptr< M > &message) const
HandlerInfo make_handler(const mavlink::msgid_t id, void(_C::*fn)(const mavlink::mavlink_message_t *msg, const mavconn::Framing framing))
Eigen::Map< Eigen::Matrix< double, 6, 6, Eigen::RowMajor > > EigenMapCovariance6d
Eigen::Map for Covariance6d.
PluginBase()
Plugin constructor Should not do anything before initialize()
Subscriptions get_subscriptions()
Return vector of MAVLink message subscriptions (handlers)
static double from_degrees(double degrees)
void vectorEigenToMsg(const Eigen::Vector3d &e, geometry_msgs::Vector3 &m)
ros::Time synchronise_stamp(uint32_t time_boot_ms)
Compute FCU message time from time_boot_ms or time_usec field.
T transform_frame_ned_enu(const T &in)
Transform data expressed in NED to ENU frame.
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
std::vector< HandlerInfo > Subscriptions
Subscriptions vector.
void handle_px4_wind(const mavlink::mavlink_message_t *msg, mavlink::common::msg::WIND_COV &wind)
void handle_apm_wind(const mavlink::mavlink_message_t *msg, mavlink::ardupilotmega::msg::WIND &wind)
void initialize(UAS &uas_)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)