GAMS  1.4.0
gams::algorithms::FormationSync Class Reference

An algorithm for covering an area in formation with a synchronous model of computation. More...

#include <FormationSync.h>

Inheritance diagram for gams::algorithms::FormationSync:
gams::algorithms::BaseAlgorithm

Public Types

enum  FormationTypes {
  PYRAMID , TRIANGLE , RECTANGLE , CIRCLE ,
  LINE , WING
}
 Types of formations. More...
 

Public Member Functions

 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. More...
 
 ~FormationSync ()
 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 FormationSync &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 Member Functions

void generate_plan (int formation)
 Generates the full plan. More...
 
pose::Position generate_position (pose::Position reference, double angle, double distance)
 Generates a position at an angle and distance. More...
 

Protected Attributes

variables::Agentsagents_
 the list of agents potentially participating in the algorithm More...
 
madara::knowledge::containers::Barrier barrier_
 movement barrier More...
 
double buffer_
 the buffer between cells in the formation More...
 
pose::Pose end_
 center of formation end More...
 
unsigned int executions_
 number of executions More...
 
int formation_
 the formation to use More...
 
groups::GroupBasegroup_
 the group that the user wishes the algorithm to use More...
 
groups::GroupFactoryRepository group_factory_
 factory for interacting with user-defined groups More...
 
groups::AgentVector group_members_
 a convenience list of all current group members More...
 
madara::knowledge::KnowledgeBase * knowledge_
 provides access to the knowledge base More...
 
int move_pivot_
 the move total before a pivot. Used for debugging More...
 
std::vector< pose::Positionplan_
 the planned positions of this agent More...
 
platforms::BasePlatformplatform_
 provides access to the platform More...
 
int position_
 position in member assignment More...
 
variables::Selfself_
 the algorithm's concept of self More...
 
variables::Sensorssensors_
 provides access to sensor information More...
 
pose::Pose start_
 center of formation start More...
 
variables::AlgorithmStatus status_
 provides access to status information for this platform More...
 

Detailed Description

An algorithm for covering an area in formation with a synchronous model of computation.

Allows specification of arbitrary group or swarm.

Definition at line 78 of file FormationSync.h.

Member Enumeration Documentation

◆ FormationTypes

Types of formations.

Enumerator
PYRAMID 
TRIANGLE 
RECTANGLE 
CIRCLE 
LINE 
WING 

Definition at line 85 of file FormationSync.h.

Constructor & Destructor Documentation

◆ FormationSync()

gams::algorithms::FormationSync::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.

Parameters
startthe starting center of the formation
endthe ending center of the formation
groupthe group name(e.g., group.allies)
bufferthe distance between formation participants in meters
formationtype of formation(
See also
FormationTypes)
Parameters
barrier_namethe barrier name to synchronize on
knowledgethe context containing variables and values
platformthe underlying platform the algorithm will use
sensorsmap of sensor names to sensor information
selfself-referencing variables

◆ ~FormationSync()

gams::algorithms::FormationSync::~FormationSync ( )

Destructor.

Member Function Documentation

◆ analyze()

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

Analyzes environment, platform, or other information.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

◆ execute()

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

Plans the next execution of the algorithm.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

◆ generate_plan()

void gams::algorithms::FormationSync::generate_plan ( int  formation)
protected

Generates the full plan.

Parameters
formationthe type of formation.
See also
FormationTypes

◆ generate_position()

pose::Position gams::algorithms::FormationSync::generate_position ( pose::Position  reference,
double  angle,
double  distance 
)
protected

Generates a position at an angle and distance.

Parameters
referencethe reference position
anglethe angle from the reference position
distancethe distance in meters
Returns
the new position at the angle and distance

◆ get_agents()

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

Gets the list of agents.

◆ get_algorithm_status()

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

Gets algorithm status variables.

◆ get_knowledge_base()

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

Gets the knowledge base.

◆ get_platform()

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

Gets the platform.

◆ get_self()

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

Gets self-defined variables.

◆ get_sensors()

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

Gets the available sensor information.

◆ operator=()

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

Assignment operator.

Parameters
rhsvalues to copy

◆ plan()

virtual int gams::algorithms::FormationSync::plan ( void  )
virtual

Plans the next execution of the algorithm.

Returns
bitmask status of the platform.
See also
Status.

Implements gams::algorithms::BaseAlgorithm.

◆ set_agents()

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

Sets the list of agents in the swarm.

Parameters
agentslist of agents

◆ set_platform()

virtual void gams::algorithms::BaseAlgorithm::set_platform ( platforms::BasePlatform platform)
virtualinherited

Sets the platform.

Parameters
platformthe underlying platform the algorithm will use

◆ set_self()

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

◆ set_sensors()

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

◆ agents_

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

the list of agents potentially participating in the algorithm

Definition at line 201 of file BaseAlgorithm.h.

◆ barrier_

madara::knowledge::containers::Barrier gams::algorithms::FormationSync::barrier_
protected

movement barrier

Definition at line 198 of file FormationSync.h.

◆ buffer_

double gams::algorithms::FormationSync::buffer_
protected

the buffer between cells in the formation

Definition at line 183 of file FormationSync.h.

◆ end_

pose::Pose gams::algorithms::FormationSync::end_
protected

center of formation end

Definition at line 171 of file FormationSync.h.

◆ executions_

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

number of executions

Definition at line 204 of file BaseAlgorithm.h.

◆ formation_

int gams::algorithms::FormationSync::formation_
protected

the formation to use

Definition at line 189 of file FormationSync.h.

◆ group_

groups::GroupBase* gams::algorithms::FormationSync::group_
protected

the group that the user wishes the algorithm to use

Definition at line 177 of file FormationSync.h.

◆ group_factory_

groups::GroupFactoryRepository gams::algorithms::FormationSync::group_factory_
protected

factory for interacting with user-defined groups

Definition at line 174 of file FormationSync.h.

◆ group_members_

groups::AgentVector gams::algorithms::FormationSync::group_members_
protected

a convenience list of all current group members

Definition at line 180 of file FormationSync.h.

◆ knowledge_

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

provides access to the knowledge base

Definition at line 207 of file BaseAlgorithm.h.

◆ move_pivot_

int gams::algorithms::FormationSync::move_pivot_
protected

the move total before a pivot. Used for debugging

Definition at line 195 of file FormationSync.h.

◆ plan_

std::vector<pose::Position> gams::algorithms::FormationSync::plan_
protected

the planned positions of this agent

Definition at line 186 of file FormationSync.h.

◆ platform_

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

provides access to the platform

Definition at line 210 of file BaseAlgorithm.h.

◆ position_

int gams::algorithms::FormationSync::position_
protected

position in member assignment

Definition at line 192 of file FormationSync.h.

◆ self_

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

the algorithm's concept of self

Definition at line 213 of file BaseAlgorithm.h.

◆ sensors_

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

provides access to sensor information

Definition at line 216 of file BaseAlgorithm.h.

◆ start_

pose::Pose gams::algorithms::FormationSync::start_
protected

center of formation start

Definition at line 168 of file FormationSync.h.

◆ status_

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

provides access to status information for this platform

Definition at line 219 of file BaseAlgorithm.h.


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