GAMS  1.4.0
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 
110  pose::Pose & start,
111  pose::Pose & 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 
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 
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 
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_
Copyright(c) 2014 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.
#define GAMS_EXPORT
Definition: GamsExport.h:20
Copyright(c) 2016 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.
Base class for algorithm factories that classes derived from.
The base class that algorithms in GAMS use.
Definition: BaseAlgorithm.h:95
A factory class for creating Formation Coverage algorithms.
virtual BaseAlgorithm * create(const madara::knowledge::KnowledgeMap &args, madara::knowledge::KnowledgeBase *knowledge, platforms::BasePlatform *platform, variables::Sensors *sensors, variables::Self *self, variables::Agents *agents)
Creates a Formation Coverage Algorithm.
An algorithm for covering an area in formation with a synchronous model of computation.
Definition: FormationSync.h:79
madara::knowledge::containers::Barrier barrier_
movement barrier
groups::GroupBase * group_
the group that the user wishes the algorithm to use
virtual int execute(void)
Plans the next execution of the algorithm.
pose::Position generate_position(pose::Position reference, double angle, double distance)
Generates a position at an angle and distance.
pose::Pose end_
center of formation end
pose::Pose start_
center of formation start
int move_pivot_
the move total before a pivot. Used for debugging
int position_
position in member assignment
FormationSync(pose::Pose &start, pose::Pose &end, const std::string &group, double buffer, int formation, const std::string &barrier_name, madara::knowledge::KnowledgeBase *knowledge=0, platforms::BasePlatform *platform=0, variables::Sensors *sensors=0, variables::Self *self=0)
Constructor.
groups::AgentVector group_members_
a convenience list of all current group members
double buffer_
the buffer between cells in the formation
void generate_plan(int formation)
Generates the full plan.
int formation_
the formation to use
FormationTypes
Types of formations.
Definition: FormationSync.h:86
std::vector< pose::Position > plan_
the planned positions of this agent
virtual int analyze(void)
Analyzes environment, platform, or other information.
groups::GroupFactoryRepository group_factory_
factory for interacting with user-defined groups
void operator=(const FormationSync &rhs)
Assignment operator.
virtual int plan(void)
Plans the next execution of the algorithm.
Base class for a group of agents.
Definition: GroupBase.h:91
A repository for group factories.
The base platform for all platforms to use.
Definition: BasePlatform.h:113
A container for self referencing information.
Definition: Self.h:70
std::vector< std::string > AgentVector
A vector of agent names.
Definition: GroupBase.h:71
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
Definition: Sensor.h:238
std::vector< Agent > Agents
An array of agent knowledge.
Definition: Agent.h:246
Contains all GAMS-related tools, classes and code.