Swarm API

SwarmTypes.hh
1 /*
2  * Copyright (C) 2015 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef __SWARM_TYPES_HH__
19 #define __SWARM_TYPES_HH__
20 
21 #include <map>
22 #include <memory>
23 #include <string>
24 #include <utility>
25 #include <vector>
26 #include <gazebo/common/Time.hh>
27 
28 namespace swarm
29 {
31  class IGNITION_VISIBLE SwarmMember
32  {
34  public: std::string name;
35 
37  public: std::string address;
38 
40  public: gazebo::physics::ModelPtr model;
41 
43  public: std::vector<std::pair<std::string, double> > neighbors;
44 
46  public: bool onOutage;
47 
49  public: gazebo::common::Time onOutageUntil;
50  };
51 
56  using SwarmMembership_M = std::map<std::string, std::shared_ptr<SwarmMember>>;
57 
61  using SwarmMembershipPtr = std::shared_ptr<SwarmMembership_M>;
62 }
63 #endif
bool onOutage
Is this robot on outage?
Definition: SwarmTypes.hh:46
Definition: BooPlugin.hh:37
std::vector< std::pair< std::string, double > > neighbors
List of neighbors and comms probabilities for this robot.
Definition: SwarmTypes.hh:43
std::string name
Gazebo name used for this model.
Definition: SwarmTypes.hh:34
std::string address
Address of the robot. E.g.: 192.168.1.2.
Definition: SwarmTypes.hh:37
Class used to store information about a member of the Swarm.
Definition: SwarmTypes.hh:31
gazebo::physics::ModelPtr model
Model pointer.
Definition: SwarmTypes.hh:40
gazebo::common::Time onOutageUntil
When will the last outage finish?
Definition: SwarmTypes.hh:49