mavros.h
Go to the documentation of this file.
1 
10 /*
11  * Copyright 2014,2015 Vladimir Ermakov.
12  *
13  * This file is part of the mavros package and subject to the license terms
14  * in the top-level LICENSE file of the mavros repository.
15  * https://github.com/mavlink/mavros/tree/master/LICENSE.md
16  */
17 
18 #pragma once
19 
20 #include <array>
21 #include <ros/ros.h>
22 #include <pluginlib/class_loader.h>
23 #include <mavconn/interface.h>
24 #include <mavros/mavros_plugin.h>
25 #include <mavros/mavlink_diag.h>
26 #include <mavros/utils.h>
27 
28 namespace mavros {
34 class MavRos
35 {
36 public:
37  MavRos();
38  ~MavRos() {};
39 
40  void spin();
41 
42 private:
44  // fcu_link stored in mav_uas
49 
52 
56 
58  std::vector<plugin::PluginBase::Ptr> loaded_plugins;
59 
61  std::unordered_map<mavlink::msgid_t, plugin::PluginBase::Subscriptions> plugin_subscriptions;
62 
65 
67  void mavlink_pub_cb(const mavlink::mavlink_message_t *mmsg, const mavconn::Framing framing);
70 
72  void plugin_route_cb(const mavlink::mavlink_message_t *mmsg, const mavconn::Framing framing);
73 
75  void add_plugin(std::string &pl_name, ros::V_string &blacklist, ros::V_string &whitelist);
76 
78  void startup_px4_usb_quirk();
79  void log_connect_change(bool connected);
80 };
81 } // namespace mavros
82 
UAS mav_uas
UAS object passed to all plugins.
Definition: mavros.h:64
void add_plugin(std::string &pl_name, ros::V_string &blacklist, ros::V_string &whitelist)
load plugin
Definition: mavros.cpp:316
std::shared_ptr< MAVConnInterface const > ConstPtr
MAVROS Plugin base.
diagnostic_updater::Updater gcs_diag_updater
Definition: mavros.h:53
void log_connect_change(bool connected)
Definition: mavros.cpp:394
bool gcs_quiet_mode
Definition: mavros.h:46
ros::Subscriber mavlink_sub
Definition: mavros.h:51
std::unordered_map< mavlink::msgid_t, plugin::PluginBase::Subscriptions > plugin_subscriptions
FCU link -> router -> plugin handler.
Definition: mavros.h:61
MAVROS node class.
Definition: mavros.h:34
void mavlink_sub_cb(const mavros_msgs::Mavlink::ConstPtr &rmsg)
ros -> fcu link
Definition: mavros.cpp:244
void mavlink_pub_cb(const mavlink::mavlink_message_t *mmsg, const mavconn::Framing framing)
fcu link -> ros
Definition: mavros.cpp:232
std::vector< std::string > V_string
UAS for plugins.
Definition: mavros_uas.h:67
ros::Publisher mavlink_pub
Definition: mavros.h:50
mavconn::MAVConnInterface::Ptr gcs_link
Definition: mavros.h:45
ros::Duration conn_timeout
Definition: mavros.h:48
void plugin_route_cb(const mavlink::mavlink_message_t *mmsg, const mavconn::Framing framing)
message router
Definition: mavros.cpp:254
ros::Time last_message_received_from_gcs
Definition: mavros.h:47
void startup_px4_usb_quirk()
start mavlink app on USB
Definition: mavros.cpp:382
pluginlib::ClassLoader< plugin::PluginBase > plugin_loader
Definition: mavros.h:57
std::vector< plugin::PluginBase::Ptr > loaded_plugins
Definition: mavros.h:58
MavlinkDiag gcs_link_diag
Definition: mavros.h:55
MavlinkDiag fcu_link_diag
Definition: mavros.h:54
ros::NodeHandle mavlink_nh
Definition: mavros.h:43
void spin()
Definition: mavros.cpp:189
std::shared_ptr< MAVConnInterface > Ptr


mavros
Author(s): Vladimir Ermakov
autogenerated on Tue Jun 1 2021 02:36:26