GAMS  1.4.0
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 
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 
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_
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) 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 PerimeterPatrol 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 PerimeterPatrol Algorithm.
An algorithm for patrolling a region.
size_t move_index_
current location to move to
void generate_locations(void)
Generates locations from region information.
bool counter_
patrol counter clockwise
virtual int analyze(void)
Analyzes environment, platform, or other information.
PerimeterPatrol(const std::string &area, double max_time, bool counter, madara::knowledge::KnowledgeBase *knowledge=0, platforms::BasePlatform *platform=0, variables::Sensors *sensors=0, variables::Self *self=0, variables::Agents *agents=0)
Constructor.
void operator=(const PerimeterPatrol &rhs)
Assignment operator.
double max_time_
the amount of time to spend patrolling in seconds
madara::utility::EpochEnforcer< std::chrono::steady_clock > enforcer_
max run time enforcer
std::vector< pose::Position > locations_
the locations to visit
std::string area_
the region/area to patrol
bool initialized_
indicates whether or not generate_locations has been succeeded
virtual int execute(void)
Plans the next execution of the algorithm.
virtual int plan(void)
Plans the next execution of the algorithm.
The base platform for all platforms to use.
Definition: BasePlatform.h:113
A container for self referencing information.
Definition: Self.h:70
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.
Copyright(c) 2014 Carnegie Mellon University.