19 #include <mavros_msgs/Altitude.h> 22 namespace std_plugins {
37 PluginBase::initialize(uas_);
56 void handle_altitude(
const mavlink::mavlink_message_t *msg, mavlink::common::msg::ALTITUDE &altitude)
58 auto ros_msg = boost::make_shared<mavros_msgs::Altitude>();
61 ros_msg->monotonic = altitude.altitude_monotonic;
62 ros_msg->amsl = altitude.altitude_amsl;
63 ros_msg->local = altitude.altitude_local;
64 ros_msg->relative = altitude.altitude_relative;
65 ros_msg->terrain = altitude.altitude_terrain;
66 ros_msg->bottom_clearance = altitude.bottom_clearance;
MAVROS Plugin base class.
std_msgs::Header synchronized_header(const std::string &frame_id, const T time_stamp)
Create message header from time_boot_ms or time_usec stamps and frame_id.
void initialize(UAS &uas_)
ros::Publisher altitude_pub
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 handle_altitude(const mavlink::mavlink_message_t *msg, mavlink::common::msg::ALTITUDE &altitude)
PluginBase()
Plugin constructor Should not do anything before initialize()
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
std::vector< HandlerInfo > Subscriptions
Subscriptions vector.
Subscriptions get_subscriptions()
Return vector of MAVLink message subscriptions (handlers)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)