GAMS  1.2.2
gams::algorithms::Follow Class Reference

An algorithm for following a target. More...

#include <Follow.h>

Inheritance diagram for gams::algorithms::Follow:
gams::algorithms::BaseAlgorithm

Public Member Functions

 Follow (const std::string &target, const std::vector< double > &offset, madara::knowledge::KnowledgeBase *knowledge=0, platforms::BasePlatform *platform=0, variables::Sensors *sensors=0, variables::Self *self=0)
 Constructor. More...
 
 ~Follow ()
 Destructor. More...
 
virtual int analyze (void)
 Analyzes environment, platform, or other information. More...
 
virtual int execute (void)
 Plans the next execution of the algorithm. More...
 
variables::Agentsget_agents (void)
 Gets the list of agents. More...
 
variables::AlgorithmStatusget_algorithm_status (void)
 Gets algorithm status variables. More...
 
madara::knowledge::KnowledgeBase * get_knowledge_base (void)
 Gets the knowledge base. More...
 
platforms::BasePlatformget_platform (void)
 Gets the platform. More...
 
variables::Selfget_self (void)
 Gets self-defined variables. More...
 
variables::Sensorsget_sensors (void)
 Gets the available sensor information. More...
 
void operator= (const Follow &rhs)
 Assignment operator. More...
 
virtual int plan (void)
 Plans the next execution of the algorithm. More...
 
virtual void set_agents (variables::Agents *agents)
 Sets the list of agents in the swarm. More...
 
virtual void set_platform (platforms::BasePlatform *platform)
 Sets the platform. More...
 
virtual void set_self (variables::Self *self)
 Sets the map of sensor names to sensor information. More...
 
virtual void set_sensors (variables::Sensors *sensors)
 Sets the map of sensor names to sensor information. More...
 

Protected Attributes

variables::Agentsagents_
 the list of agents potentially participating in the algorithm More...
 
unsigned int executions_
 number of executions More...
 
bool had_valid_dest_orientation_
 keep track of whether we had previously calculated target orient More...
 
madara::knowledge::KnowledgeBase * knowledge_
 provides access to the knowledge base More...
 
gams::pose::Orientation last_dest_orientation
 last valid destination based orientation More...
 
pose::Position last_location_
 keep track of last location More...
 
pose::Position last_target_destination_
 current target location shared between analyze and execute More...
 
std::vector< double > minimum_buffer_
 keep track of the minimum_buffer that should be maintained More...
 
bool need_move_
 flag between analyze and execute indicating new move is necessary More...
 
std::vector< double > offset_
 keep track of the offset that agent should be at More...
 
platforms::BasePlatformplatform_
 provides access to the platform More...
 
variables::Selfself_
 the algorithm's concept of self More...
 
variables::Sensorssensors_
 provides access to sensor information More...
 
variables::AlgorithmStatus status_
 provides access to status information for this platform More...
 
variables::Agent target_
 location of agent to follow More...
 
pose::Position target_destination_
 current target location shared between analyze and execute More...
 
pose::Position target_last_location_
 keep track of last leader/target location More...
 
pose::Position target_location_
 current target location shared between analyze and execute More...
 
pose::Orientation target_orientation_
 keep track of the target orientation More...
 

Detailed Description

An algorithm for following a target.

Definition at line 74 of file Follow.h.

Constructor & Destructor Documentation

gams::algorithms::Follow::Follow ( const std::string &  target,
const std::vector< double > &  offset,
madara::knowledge::KnowledgeBase *  knowledge = 0,
platforms::BasePlatform platform = 0,
variables::Sensors sensors = 0,
variables::Self self = 0 
)

Constructor.

Parameters
targetfull agent name the agent should follow
offsetoffset from target.location to move to
knowledgethe context containing variables and values
platformthe underlying platform the algorithm will use
sensorsmap of sensor names to sensor information
selfself-referencing variables
gams::algorithms::Follow::~Follow ( )

Destructor.

Member Function Documentation

virtual int gams::algorithms::Follow::analyze ( void  )
virtual

Analyzes environment, platform, or other information.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

virtual int gams::algorithms::Follow::execute ( void  )
virtual

Plans the next execution of the algorithm.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

variables::Agents* gams::algorithms::BaseAlgorithm::get_agents ( void  )
inherited

Gets the list of agents.

variables::AlgorithmStatus* gams::algorithms::BaseAlgorithm::get_algorithm_status ( void  )
inherited

Gets algorithm status variables.

madara::knowledge::KnowledgeBase* gams::algorithms::BaseAlgorithm::get_knowledge_base ( void  )
inherited

Gets the knowledge base.

platforms::BasePlatform* gams::algorithms::BaseAlgorithm::get_platform ( void  )
inherited

Gets the platform.

variables::Self* gams::algorithms::BaseAlgorithm::get_self ( void  )
inherited

Gets self-defined variables.

variables::Sensors* gams::algorithms::BaseAlgorithm::get_sensors ( void  )
inherited

Gets the available sensor information.

void gams::algorithms::Follow::operator= ( const Follow rhs)

Assignment operator.

Parameters
rhsvalues to copy
virtual int gams::algorithms::Follow::plan ( void  )
virtual

Plans the next execution of the algorithm.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

virtual void gams::algorithms::BaseAlgorithm::set_agents ( variables::Agents agents)
virtualinherited

Sets the list of agents in the swarm.

Parameters
agentslist of agents
virtual void gams::algorithms::BaseAlgorithm::set_platform ( platforms::BasePlatform platform)
virtualinherited

Sets the platform.

Parameters
platformthe underlying platform the algorithm will use
virtual void gams::algorithms::BaseAlgorithm::set_self ( variables::Self self)
virtualinherited

Sets the map of sensor names to sensor information.

Parameters
selfpointer to self-referencing variables container
virtual void gams::algorithms::BaseAlgorithm::set_sensors ( variables::Sensors sensors)
virtualinherited

Sets the map of sensor names to sensor information.

Parameters
sensorsmap of sensor names to sensor information

Member Data Documentation

variables::Agents* gams::algorithms::BaseAlgorithm::agents_
protectedinherited

the list of agents potentially participating in the algorithm

Definition at line 201 of file BaseAlgorithm.h.

unsigned int gams::algorithms::BaseAlgorithm::executions_
protectedinherited

number of executions

Definition at line 204 of file BaseAlgorithm.h.

bool gams::algorithms::Follow::had_valid_dest_orientation_
protected

keep track of whether we had previously calculated target orient

Definition at line 155 of file Follow.h.

madara::knowledge::KnowledgeBase* gams::algorithms::BaseAlgorithm::knowledge_
protectedinherited

provides access to the knowledge base

Definition at line 207 of file BaseAlgorithm.h.

gams::pose::Orientation gams::algorithms::Follow::last_dest_orientation
protected

last valid destination based orientation

Definition at line 158 of file Follow.h.

pose::Position gams::algorithms::Follow::last_location_
protected

keep track of last location

Definition at line 137 of file Follow.h.

pose::Position gams::algorithms::Follow::last_target_destination_
protected

current target location shared between analyze and execute

Definition at line 134 of file Follow.h.

std::vector<double> gams::algorithms::Follow::minimum_buffer_
protected

keep track of the minimum_buffer that should be maintained

Definition at line 149 of file Follow.h.

bool gams::algorithms::Follow::need_move_
protected

flag between analyze and execute indicating new move is necessary

Definition at line 152 of file Follow.h.

std::vector<double> gams::algorithms::Follow::offset_
protected

keep track of the offset that agent should be at

Definition at line 146 of file Follow.h.

platforms::BasePlatform* gams::algorithms::BaseAlgorithm::platform_
protectedinherited

provides access to the platform

Definition at line 210 of file BaseAlgorithm.h.

variables::Self* gams::algorithms::BaseAlgorithm::self_
protectedinherited

the algorithm's concept of self

Definition at line 213 of file BaseAlgorithm.h.

variables::Sensors* gams::algorithms::BaseAlgorithm::sensors_
protectedinherited

provides access to sensor information

Definition at line 216 of file BaseAlgorithm.h.

variables::AlgorithmStatus gams::algorithms::BaseAlgorithm::status_
protectedinherited

provides access to status information for this platform

Definition at line 219 of file BaseAlgorithm.h.

variables::Agent gams::algorithms::Follow::target_
protected

location of agent to follow

Definition at line 125 of file Follow.h.

pose::Position gams::algorithms::Follow::target_destination_
protected

current target location shared between analyze and execute

Definition at line 131 of file Follow.h.

pose::Position gams::algorithms::Follow::target_last_location_
protected

keep track of last leader/target location

Definition at line 140 of file Follow.h.

pose::Position gams::algorithms::Follow::target_location_
protected

current target location shared between analyze and execute

Definition at line 128 of file Follow.h.

pose::Orientation gams::algorithms::Follow::target_orientation_
protected

keep track of the target orientation

Definition at line 143 of file Follow.h.


The documentation for this class was generated from the following file: