dummy.cpp
/*
* Copyright 2013,2016 Vladimir Ermakov.
*
* This file is part of the mavros package and subject to the license terms
* in the top-level LICENSE file of the mavros repository.
* https://github.com/mavlink/mavros/tree/master/LICENSE.md
*/
namespace mavros {
namespace std_plugins {
class DummyPlugin : public plugin::PluginBase {
public:
nh("~")
{ }
void initialize(UAS &uas_)
{
PluginBase::initialize(uas_);
ROS_INFO_NAMED("dummy", "Dummy::initialize");
}
return {
/* automatic message deduction by second argument */
/* handle raw message, check framing! */
make_handler(mavlink::common::msg::STATUSTEXT::MSG_ID, &DummyPlugin::handle_statustext_raw),
};
}
private:
void handle_heartbeat(const mavlink::mavlink_message_t *msg, mavlink::common::msg::HEARTBEAT &hb) {
ROS_INFO_STREAM_NAMED("dummy", "Dummy::handle_heartbeat: " << hb.to_yaml());
}
void handle_sys_status(const mavlink::mavlink_message_t *msg, mavlink::common::msg::SYS_STATUS &st) {
ROS_INFO_STREAM_NAMED("dummy", "Dummy::handle_sys_status: " << st.to_yaml());
}
void handle_statustext(const mavlink::mavlink_message_t *msg, mavlink::common::msg::STATUSTEXT &st) {
ROS_INFO_STREAM_NAMED("dummy", "Dummy::handle_statustext: " << st.to_yaml());
}
void handle_statustext_raw(const mavlink::mavlink_message_t *msg, const mavconn::Framing f) {
ROS_INFO_NAMED("dummy", "Dummy::handle_statustext_raw(%p, %d) from %u.%u", msg, utils::enum_value(f), msg->sysid, msg->compid);
}
};
} // namespace std_plugins
} // namespace mavros


mavros
Author(s): Vladimir Ermakov
autogenerated on Mon Jul 8 2019 03:20:10