dummy.cpp
Go to the documentation of this file.
00001 
00010 /*
00011  * Copyright 2013 Vladimir Ermakov.
00012  *
00013  * This program is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation; either version 3 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful, but
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00020  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
00021  * for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License along
00024  * with this program; if not, write to the Free Software Foundation, Inc.,
00025  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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 }; // namespace mavplugin
00093 
00094 PLUGINLIB_EXPORT_CLASS(mavplugin::DummyPlugin, mavplugin::MavRosPlugin)
00095 


mavros
Author(s): Vladimir Ermakov
autogenerated on Wed Aug 26 2015 12:29:13