GAMS  1.2.2
PerimeterPatrol.h
Go to the documentation of this file.
1 
56 #ifndef _GAMS_ALGORITHMS_PERIMETER_PATROL_H_
57 #define _GAMS_ALGORITHMS_PERIMETER_PATROL_H_
58 
60 
61 #include <string>
62 
63 #include "gams/variables/Sensor.h"
66 #include "gams/variables/Self.h"
67 #include "madara/utility/EpochEnforcer.h"
68 #include "gams/utility/Position.h"
70 
71 namespace gams
72 {
73  namespace algorithms
74  {
79  {
80  public:
93  const std::string & area,
94  double max_time,
95  bool counter,
96  madara::knowledge::KnowledgeBase * knowledge = 0,
97  platforms::BasePlatform * platform = 0,
98  variables::Sensors * sensors = 0,
99  variables::Self * self = 0,
100  variables::Agents * agents = 0);
101 
105  ~PerimeterPatrol ();
106 
111  void operator= (const PerimeterPatrol & rhs);
112 
117  virtual int analyze (void);
118 
123  virtual int execute (void);
124 
129  virtual int plan (void);
130 
131  protected:
132 
136  void generate_locations (void);
137 
139  std::string area_;
140 
142  double max_time_;
143 
145  bool counter_;
146 
148  std::vector<pose::Position> locations_;
149 
151  size_t move_index_;
152 
155 
157  madara::utility::EpochEnforcer<std::chrono::steady_clock> enforcer_;
158  };
159 
164  {
165  public:
166 
183  virtual BaseAlgorithm * create (
184  const madara::knowledge::KnowledgeMap & args,
185  madara::knowledge::KnowledgeBase * knowledge,
186  platforms::BasePlatform * platform,
187  variables::Sensors * sensors,
188  variables::Self * self,
189  variables::Agents * agents);
190  };
191  }
192 }
193 
194 #endif // _GAMS_ALGORITHMS_PERIMETER_PATROL_H_
double max_time_
the amount of time to spend patrolling in seconds
Base class for algorithm factories that classes derived from.
A factory class for creating PerimeterPatrol algorithms.
bool counter_
patrol counter clockwise
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
Copyright (c) 2014 Carnegie Mellon University.
std::vector< Agent > Agents
An array of agent knowledge.
Definition: Agent.h:246
bool initialized_
indicates whether or not generate_locations has been succeeded
std::string area_
the region/area to patrol
Copyright (c) 2014 Carnegie Mellon University.
size_t move_index_
current location to move to
madara::utility::EpochEnforcer< std::chrono::steady_clock > enforcer_
max run time enforcer
Contains all GAMS-related tools, classes and code.
A container for self referencing information.
Definition: Self.h:69
#define GAMS_EXPORT
Definition: GamsExport.h:20
The base class that algorithms in GAMS use.
Definition: BaseAlgorithm.h:94
Copyright (c) 2014 Carnegie Mellon University.
An algorithm for patrolling a region.
std::vector< pose::Position > locations_
the locations to visit
Copyright (c) 2014 Carnegie Mellon University.