GAMS  1.2.2
gams::algorithms::FormationFlying Class Reference

An algorithm for moving in formation. More...

#include <FormationFlying.h>

Inheritance diagram for gams::algorithms::FormationFlying:
gams::algorithms::BaseAlgorithm

Classes

struct  Compiled
 formation wait string More...
 

Public Member Functions

 FormationFlying (const std::string &head_id, const std::vector< double > &offset, const std::vector< double > &destination, const std::string &group_name, const std::string &modifier, madara::knowledge::KnowledgeBase *knowledge=0, platforms::BasePlatform *platform=0, variables::Sensors *sensors=0, variables::Self *self=0)
 Constructor. More...
 
 ~FormationFlying ()
 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...
 
bool is_head () const
 Return true if this agent is head. More...
 
bool is_ready () const
 Get ready value. More...
 
void operator= (const FormationFlying &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 Types

enum  { NONE, ROTATE }
 modifier enum More...
 

Protected Member Functions

pose::Position get_destination () const
 Get head's destination. More...
 

Protected Attributes

variables::Agentsagents_
 the list of agents potentially participating in the algorithm More...
 
std::vector< Compiledcompiled_formation_
 
pose::Position destination_
 destination as Position More...
 
unsigned int executions_
 number of executions More...
 
madara::knowledge::containers::Integer formation_ready_
 are we in formation? More...
 
bool head_
 am i the head? More...
 
madara::knowledge::containers::NativeDoubleArray head_destination_
 head destination More...
 
int head_id_
 head id More...
 
madara::knowledge::containers::NativeDoubleArray head_location_
 head location More...
 
madara::knowledge::containers::Integer in_formation_
 am i in formation? More...
 
madara::knowledge::KnowledgeBase * knowledge_
 provides access to the knowledge base More...
 
enum gams::algorithms::FormationFlying:: { ... }  modifier_
 modifier enum More...
 
bool need_to_move_
 do we need to move? More...
 
pose::Position next_position_
 next position More...
 
unsigned int num_agents_
 number of agents in formation; only head_id_ needs to know this More...
 
double phi_
 angular formation offsets More...
 
double phi_dir_
 directional angular formation offsets More...
 
platforms::BasePlatformplatform_
 provides access to the platform More...
 
double rho_
 planar distance formation offsets More...
 
variables::Selfself_
 the algorithm's concept of self More...
 
variables::SensorNames sensor_names_
 list of sensor names More...
 
variables::Sensorssensors_
 provides access to sensor information More...
 
variables::AlgorithmStatus status_
 provides access to status information for this platform More...
 
double z_
 altitude formation offsets More...
 

Detailed Description

An algorithm for moving in formation.

Definition at line 73 of file FormationFlying.h.

Member Enumeration Documentation

anonymous enum
protected

modifier enum

Enumerator
NONE 
ROTATE 

Definition at line 176 of file FormationFlying.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
head_idtarget of the formation
offsetoffset of formation
destinationdestination of the formation
group_namegroup identifier (e.g. group.group1)
modifiermodifier that influences the formation
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::FormationFlying::~FormationFlying ( )

Destructor.

Member Function Documentation

virtual int gams::algorithms::FormationFlying::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::FormationFlying::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.

pose::Position gams::algorithms::FormationFlying::get_destination ( ) const
protected

Get head's destination.

Returns
utility::Position object of head's destination
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.

bool gams::algorithms::FormationFlying::is_head ( ) const

Return true if this agent is head.

bool gams::algorithms::FormationFlying::is_ready ( ) const

Get ready value.

Returns
true if agents are in formation, false otherwise
void gams::algorithms::FormationFlying::operator= ( const FormationFlying rhs)

Assignment operator.

Parameters
rhsvalues to copy
virtual int gams::algorithms::FormationFlying::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.

std::vector<Compiled> gams::algorithms::FormationFlying::compiled_formation_
protected

Definition at line 152 of file FormationFlying.h.

pose::Position gams::algorithms::FormationFlying::destination_
protected

destination as Position

Definition at line 170 of file FormationFlying.h.

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

number of executions

Definition at line 204 of file BaseAlgorithm.h.

madara::knowledge::containers::Integer gams::algorithms::FormationFlying::formation_ready_
protected

are we in formation?

Definition at line 155 of file FormationFlying.h.

bool gams::algorithms::FormationFlying::head_
protected

am i the head?

Definition at line 158 of file FormationFlying.h.

madara::knowledge::containers::NativeDoubleArray gams::algorithms::FormationFlying::head_destination_
protected

head destination

Definition at line 167 of file FormationFlying.h.

int gams::algorithms::FormationFlying::head_id_
protected

head id

Definition at line 161 of file FormationFlying.h.

madara::knowledge::containers::NativeDoubleArray gams::algorithms::FormationFlying::head_location_
protected

head location

Definition at line 164 of file FormationFlying.h.

madara::knowledge::containers::Integer gams::algorithms::FormationFlying::in_formation_
protected

am i in formation?

Definition at line 173 of file FormationFlying.h.

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

provides access to the knowledge base

Definition at line 207 of file BaseAlgorithm.h.

enum { ... } gams::algorithms::FormationFlying::modifier_

modifier enum

bool gams::algorithms::FormationFlying::need_to_move_
protected

do we need to move?

Definition at line 183 of file FormationFlying.h.

pose::Position gams::algorithms::FormationFlying::next_position_
protected

next position

Definition at line 186 of file FormationFlying.h.

unsigned int gams::algorithms::FormationFlying::num_agents_
protected

number of agents in formation; only head_id_ needs to know this

Definition at line 189 of file FormationFlying.h.

double gams::algorithms::FormationFlying::phi_
protected

angular formation offsets

Definition at line 192 of file FormationFlying.h.

double gams::algorithms::FormationFlying::phi_dir_
protected

directional angular formation offsets

Definition at line 195 of file FormationFlying.h.

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

provides access to the platform

Definition at line 210 of file BaseAlgorithm.h.

double gams::algorithms::FormationFlying::rho_
protected

planar distance formation offsets

Definition at line 198 of file FormationFlying.h.

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

the algorithm's concept of self

Definition at line 213 of file BaseAlgorithm.h.

variables::SensorNames gams::algorithms::FormationFlying::sensor_names_
protected

list of sensor names

Definition at line 201 of file FormationFlying.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.

double gams::algorithms::FormationFlying::z_
protected

altitude formation offsets

Definition at line 204 of file FormationFlying.h.


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