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>();
68 twist_cov->twist.twist.linear.x = speed * std::sin(course);
69 twist_cov->twist.twist.linear.y = speed * std::cos(course);
70 twist_cov->twist.twist.linear.z = -wind.speed_z;
83 void handle_px4_wind(
const mavlink::mavlink_message_t *msg, mavlink::common::msg::WIND_COV &wind)
85 auto twist_cov = boost::make_shared<geometry_msgs::TwistWithCovarianceStamped>();
89 twist_cov->twist.twist.linear);
94 cov_map(0, 0) = wind.var_horiz;
95 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))
void initialize(UAS &uas_) override
Eigen::Map< Eigen::Matrix< double, 6, 6, Eigen::RowMajor > > EigenMapCovariance6d
Eigen::Map for Covariance6d.
PluginBase()
Plugin constructor Should not do anything before initialize()
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.
Subscriptions get_subscriptions() override
Return vector of MAVLink message subscriptions (handlers)
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)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)