21 #ifndef __SWARM_BROKER_PLUGIN_HH__
22 #define __SWARM_BROKER_PLUGIN_HH__
28 #include <gazebo/common/Events.hh>
29 #include <gazebo/common/Plugin.hh>
30 #include <gazebo/common/UpdateInfo.hh>
31 #include <gazebo/physics/PhysicsTypes.hh>
32 #include <ignition/transport.hh>
36 #include "swarm/SwarmTypes.hh"
37 #include "msgs/datagram.pb.h"
58 public:
virtual void Load(gazebo::physics::WorldPtr _world,
59 sdf::ElementPtr _sdf);
67 private:
void ReadSwarmFromSDF(sdf::ElementPtr _sdf);
72 private:
void Update(
const gazebo::common::UpdateInfo &_info);
76 private:
void NotifyNeighbors();
79 private:
void DispatchMessages();
85 private:
void OnMsgReceived(
const std::string &_topic,
86 const msgs::Datagram &_msg);
89 private: gazebo::physics::WorldPtr world;
92 private: sdf::ElementPtr sdf;
95 private: gazebo::event::ConnectionPtr updateConnection;
98 private: ignition::transport::Node node;
101 private: std::queue<msgs::Datagram> incomingMsgs;
104 private: SwarmMembershipPtr
swarm;
107 private: std::mutex mutex;
110 private: std::unique_ptr<CommsModel> commsModel;
Definition: BooPlugin.hh:37
Manages how the communication behave between the members of the team.
This is a world plugin designed to centralize all the messages sent by the members of the swarm...
Definition: BrokerPlugin.hh:49