GAMS  1.4.0
Move.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_ALGORITHMS_MOVE_H_
55 #define _GAMS_ALGORITHMS_MOVE_H_
56 
58 
59 #include <string>
60 
61 #include "gams/variables/Sensor.h"
64 #include "gams/variables/Self.h"
65 #include "gams/pose/Position.h"
67 #include "madara/utility/EpochEnforcer.h"
68 
69 #include "gams/GamsExport.h"
70 
71 namespace gams
72 {
73  namespace algorithms
74  {
79  {
80  public:
93  const std::vector <pose::Pose> & locations,
94  int repeat,
95  double wait_time,
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  ~Move();
106 
111  void operator=(const Move & rhs);
112 
117  virtual int analyze(void);
118 
123  virtual int execute(void);
124 
129  virtual int plan(void);
130 
131  protected:
132 
134  std::vector <pose::Pose> poses_;
135 
137  int repeat_;
138 
140  size_t move_index_;
141 
143  int cycles_;
144 
146  std::string frame_;
147 
149  double wait_time_;
150 
152  bool waiting_;
153 
156 
158  madara::utility::EpochEnforcer<std::chrono::steady_clock> enforcer_;
159  };
160 
165  {
166  public:
167 
185  const madara::knowledge::KnowledgeMap & args,
186  madara::knowledge::KnowledgeBase * knowledge,
187  platforms::BasePlatform * platform,
188  variables::Sensors * sensors,
189  variables::Self * self,
190  variables::Agents * agents);
191  };
192  }
193 }
194 
195 #endif // _GAMS_ALGORITHMS_MOVE_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 Move algorithms.
Definition: Move.h:165
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 Move Algorithm.
An algorithm for moving to a location.
Definition: Move.h:79
bool waiting_
if true, is in a waiting state on wait_time_
Definition: Move.h:152
bool finished_moving_
if true, all movements are completed
Definition: Move.h:155
std::vector< pose::Pose > poses_
the locations to visit
Definition: Move.h:134
int repeat_
number of times to repeat
Definition: Move.h:137
double wait_time_
global wait time for each waypoint
Definition: Move.h:149
size_t move_index_
current location to move to
Definition: Move.h:140
std::string frame_
reference frame for coordinates
Definition: Move.h:146
Move(const std::vector< pose::Pose > &locations, int repeat, double wait_time, madara::knowledge::KnowledgeBase *knowledge=0, platforms::BasePlatform *platform=0, variables::Sensors *sensors=0, variables::Self *self=0, variables::Agents *agents=0)
Constructor.
int cycles_
tracks the number of cycles completed through locations
Definition: Move.h:143
madara::utility::EpochEnforcer< std::chrono::steady_clock > enforcer_
the timing enforcer
Definition: Move.h:158
virtual int analyze(void)
Analyzes environment, platform, or other information.
void operator=(const Move &rhs)
Assignment operator.
virtual int plan(void)
Plans the next execution of the algorithm.
virtual int execute(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) 2015-2018 Carnegie Mellon University.