Go to the documentation of this file.00001
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <mavros/mavros_plugin.h>
00029 #include <pluginlib/class_list_macros.h>
00030
00031 namespace mavplugin {
00032
00038 class DummyPlugin : public MavRosPlugin {
00039 public:
00040 DummyPlugin() {
00041 ROS_INFO_NAMED("dummy", "dummy constructor");
00042 };
00043
00047 void initialize(UAS &uas,
00048 ros::NodeHandle &nh,
00049 diagnostic_updater::Updater &diag_updater)
00050 {
00051 ROS_INFO_NAMED("dummy", "initialize");
00052 };
00053
00057 std::string const get_name() const {
00058 return "Dummy";
00059 };
00060
00066 const message_map get_rx_handlers() {
00067 return {
00068 MESSAGE_HANDLER(MAVLINK_MSG_ID_HEARTBEAT, &DummyPlugin::handle_heartbeat),
00069 MESSAGE_HANDLER(MAVLINK_MSG_ID_SYS_STATUS, &DummyPlugin::handle_sys_status),
00070 MESSAGE_HANDLER(MAVLINK_MSG_ID_STATUSTEXT, &DummyPlugin::handle_statustext)
00071 };
00072 }
00073
00074 private:
00075 void handle_heartbeat(const mavlink_message_t *msg, uint8_t sysid, uint8_t compid) {
00076 ROS_INFO_NAMED("dummy", "Dummy::handle_heartbeat(%p, %u, %u)",
00077 msg, sysid, compid);
00078 }
00079
00080 void handle_sys_status(const mavlink_message_t *msg, uint8_t sysid, uint8_t compid) {
00081 ROS_INFO_NAMED("dummy", "Dummy::handle_sys_status(%p, %u, %u)",
00082 msg, sysid, compid);
00083 }
00084
00085 void handle_statustext(const mavlink_message_t *msg, uint8_t sysid, uint8_t compid) {
00086 ROS_INFO_NAMED("dummy", "Dummy::handle_statustext(%p, %u, %u)",
00087 msg, sysid, compid);
00088
00089 }
00090 };
00091
00092 };
00093
00094 PLUGINLIB_EXPORT_CLASS(mavplugin::DummyPlugin, mavplugin::MavRosPlugin)
00095