GAMS  1.4.0
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

anonymous enum
protected

modifier enum

Enumerator
NONE 
ROTATE 

Definition at line 178 of file FormationFlying.h.

Constructor & Destructor Documentation

◆ FormationFlying()

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

◆ ~FormationFlying()

gams::algorithms::FormationFlying::~FormationFlying ( )

Destructor.

Member Function Documentation

◆ analyze()

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.

◆ execute()

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.

◆ 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_destination()

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

Get head's destination.

Returns
utility::Position object of head's destination

◆ 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.

◆ is_head()

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

Return true if this agent is head.

◆ is_ready()

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

Get ready value.

Returns
true if agents are in formation, false otherwise

◆ operator=()

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

Assignment operator.

Parameters
rhsvalues to copy

◆ plan()

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.

◆ 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.

◆ compiled_formation_

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

Definition at line 154 of file FormationFlying.h.

◆ destination_

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

destination as Position

Definition at line 172 of file FormationFlying.h.

◆ executions_

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

number of executions

Definition at line 204 of file BaseAlgorithm.h.

◆ formation_ready_

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

are we in formation?

Definition at line 157 of file FormationFlying.h.

◆ head_

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

am i the head?

Definition at line 160 of file FormationFlying.h.

◆ head_destination_

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

head destination

Definition at line 169 of file FormationFlying.h.

◆ head_id_

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

head id

Definition at line 163 of file FormationFlying.h.

◆ head_location_

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

head location

Definition at line 166 of file FormationFlying.h.

◆ in_formation_

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

am i in formation?

Definition at line 175 of file FormationFlying.h.

◆ knowledge_

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

◆ need_to_move_

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

do we need to move?

Definition at line 185 of file FormationFlying.h.

◆ next_position_

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

next position

Definition at line 188 of file FormationFlying.h.

◆ num_agents_

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

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

Definition at line 191 of file FormationFlying.h.

◆ phi_

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

angular formation offsets

Definition at line 194 of file FormationFlying.h.

◆ phi_dir_

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

directional angular formation offsets

Definition at line 197 of file FormationFlying.h.

◆ platform_

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

provides access to the platform

Definition at line 210 of file BaseAlgorithm.h.

◆ rho_

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

planar distance formation offsets

Definition at line 200 of file FormationFlying.h.

◆ self_

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

the algorithm's concept of self

Definition at line 213 of file BaseAlgorithm.h.

◆ sensor_names_

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

list of sensor names

Definition at line 203 of file FormationFlying.h.

◆ sensors_

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

provides access to sensor information

Definition at line 216 of file BaseAlgorithm.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.

◆ z_

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

altitude formation offsets

Definition at line 206 of file FormationFlying.h.


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