GAMS  1.2.2
FormationSync.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_ALGORITHMS_FORMATION_SYNC_H_
55 #define _GAMS_ALGORITHMS_FORMATION_SYNC_H_
56 
57 #include <vector>
58 #include <string>
59 
60 #include "gams/variables/Sensor.h"
63 #include "gams/variables/Self.h"
66 #include "madara/knowledge/containers/Integer.h"
67 #include "madara/knowledge/containers/Barrier.h"
69 
70 namespace gams
71 {
72  namespace algorithms
73  {
79  {
80  public:
81 
86  {
92  WING
93  };
94 
109  FormationSync (
110  pose::Position & start,
111  pose::Position & end,
112  const std::string & group,
113  double buffer,
114  int formation,
115  const std::string & barrier_name,
116  madara::knowledge::KnowledgeBase * knowledge = 0,
117  platforms::BasePlatform * platform = 0,
118  variables::Sensors * sensors = 0,
119  variables::Self * self = 0);
120 
124  ~FormationSync ();
125 
130  void operator= (const FormationSync & rhs);
131 
136  virtual int analyze (void);
137 
142  virtual int execute (void);
143 
148  virtual int plan (void);
149 
150  protected:
155  void generate_plan (int formation);
156 
164  pose::Position generate_position (pose::Position reference,
165  double angle, double distance);
166 
169 
172 
175 
178 
181 
183  double buffer_;
184 
186  std::vector <pose::Position> plan_;
187 
190 
193 
196 
198  madara::knowledge::containers::Barrier barrier_;
199  };
200 
205  {
206  public:
207 
231  virtual BaseAlgorithm * create (
232  const madara::knowledge::KnowledgeMap & args,
233  madara::knowledge::KnowledgeBase * knowledge,
234  platforms::BasePlatform * platform,
235  variables::Sensors * sensors,
236  variables::Self * self,
237  variables::Agents * agents);
238  };
239  }
240 }
241 
242 #endif // _GAMS_ALGORITHMS_FORMATION_SYNC_H_
std::vector< pose::Position > plan_
the planned positions of this agent
Base class for algorithm factories that classes derived from.
groups::AgentVector group_members_
a convenience list of all current group members
std::vector< std::string > AgentVector
A vector of agent names.
Definition: GroupBase.h:71
double buffer_
the buffer between cells in the formation
madara::knowledge::containers::Barrier barrier_
movement barrier
int formation_
the formation to use
int position_
position in member assignment
groups::GroupBase * group_
the group that the user wishes the algorithm to use
Copyright (c) 2014 Carnegie Mellon University.
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
Definition: Sensor.h:238
The base platform for all platforms to use.
Definition: BasePlatform.h:190
An algorithm for covering an area in formation with a synchronous model of computation.
Definition: FormationSync.h:78
Copyright (c) 2014 Carnegie Mellon University.
std::vector< Agent > Agents
An array of agent knowledge.
Definition: Agent.h:246
Copyright (c) 2014 Carnegie Mellon University.
FormationTypes
Types of formations.
Definition: FormationSync.h:85
A factory class for creating Formation Coverage algorithms.
Contains all GAMS-related tools, classes and code.
A container for self referencing information.
Definition: Self.h:69
Base class for a group of agents.
Definition: GroupBase.h:90
#define GAMS_EXPORT
Definition: GamsExport.h:20
int move_pivot_
the move total before a pivot. Used for debugging
pose::Position start_
center of formation start
pose::Position end_
center of formation end
The base class that algorithms in GAMS use.
Definition: BaseAlgorithm.h:94
Copyright (c) 2014 Carnegie Mellon University.
A repository for group factories.
groups::GroupFactoryRepository group_factory_
factory for interacting with user-defined groups
Copyright (c) 2016 Carnegie Mellon University.
Copyright (c) 2014 Carnegie Mellon University.