GAMS
1.4.0
|
An algorithm for greeting a target if it comes within range and potentially following the target around. More...
#include <Greet.h>
Public Member Functions | |
Greet (const std::string &target, const std::string &target_group, double guard_distance, const std::string &guard_group, const std::vector< double > &guard_location, double guard_max_follow_distance, const std::vector< double > &home_location, bool follow, const std::string &follow_group, int follow_max_agents, madara::knowledge::KnowledgeBase *knowledge=0, platforms::BasePlatform *platform=0, variables::Sensors *sensors=0, variables::Self *self=0) | |
Constructor. More... | |
~Greet () | |
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::Agents * | get_agents (void) |
Gets the list of agents. More... | |
variables::AlgorithmStatus * | get_algorithm_status (void) |
Gets algorithm status variables. More... | |
madara::knowledge::KnowledgeBase * | get_knowledge_base (void) |
Gets the knowledge base. More... | |
platforms::BasePlatform * | get_platform (void) |
Gets the platform. More... | |
variables::Self * | get_self (void) |
Gets self-defined variables. More... | |
variables::Sensors * | get_sensors (void) |
Gets the available sensor information. More... | |
void | operator= (const Greet &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::Agents * | agents_ |
the list of agents potentially participating in the algorithm More... | |
unsigned int | executions_ |
number of executions More... | |
bool | follow_ = false |
if true, indicates to follow targets that enter guard area More... | |
std::unique_ptr< groups::GroupBase > | follow_group_ = 0 |
a group of agents following to watch More... | |
std::string | follow_group_name_ = "group.{.target}.followers" |
name of the group that is following target More... | |
std::string | follow_group_prefix_ |
the group name prefix before {.target} More... | |
std::string | follow_group_suffix_ |
the group name suffix after {.target} More... | |
int | follow_max_agents_ = 2 |
maximum number of agents that should follow a target More... | |
double | follow_max_distance_ = 1000 |
maximum follow distance from guard location More... | |
groups::GroupFactoryRepository | group_factory_ |
pose::Epsilon | guard_epsilon_ |
the distance from guard location (max of dimensions) More... | |
std::unique_ptr< groups::GroupBase > | guard_group_ = 0 |
a group of agents guarding More... | |
pose::Position | guard_location_ |
the location for the agent to guard More... | |
double | guard_max_follow_distance_ = -1 |
maximum distance a guard can be displaced from guard location before it returns to its guard area (prevents infinite follow) More... | |
pose::Position | home_location_ |
the home location to return to if not guarding or following More... | |
bool | is_following_ = false |
indicates whether or not the agent is following a target More... | |
bool | is_guarding_ = false |
indicates whether or not the agent is moving to guard More... | |
madara::knowledge::KnowledgeBase * | knowledge_ |
provides access to the knowledge base More... | |
platforms::BasePlatform * | platform_ |
provides access to the platform More... | |
variables::Self * | self_ |
the algorithm's concept of self More... | |
variables::Sensors * | sensors_ |
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... | |
std::unique_ptr< groups::GroupBase > | target_group_ = 0 |
a group of targets to watch More... | |
bool | use_agent_home_ = true |
if no custom home location is specified, use the agent's home More... | |
An algorithm for greeting a target if it comes within range and potentially following the target around.
gams::algorithms::Greet::Greet | ( | const std::string & | target, |
const std::string & | target_group, | ||
double | guard_distance, | ||
const std::string & | guard_group, | ||
const std::vector< double > & | guard_location, | ||
double | guard_max_follow_distance, | ||
const std::vector< double > & | home_location, | ||
bool | follow, | ||
const std::string & | follow_group, | ||
int | follow_max_agents, | ||
madara::knowledge::KnowledgeBase * | knowledge = 0 , |
||
platforms::BasePlatform * | platform = 0 , |
||
variables::Sensors * | sensors = 0 , |
||
variables::Self * | self = 0 |
||
) |
Constructor.
target | full agent name the agent should follow |
target_group | group name for agents in the target group |
guard_distance | distance in meters to guard from guard guard location |
guard_location | location to consider guard territory for this agent |
guard_max_follow_distance | distance that a guard can reach from its guard location before it returns back to its area. During following, this can prevent infinite following. -1 means do not rubberband but follow indefinitely |
home_location | location to perch or home at if not guarding or following |
follow | if true, follow up to follow_max_agents in the specified follow group |
follow_group | group name for agents following a target. This is a special group name that will allow expansion if you use the .target variable in the name. By default this, variable is group.{.target}.follow, which would expand to something like: group.agent.0.follow for agents following agent.0 |
follow_max_agents | maximum agents to follow a target at any instantaneous time |
knowledge | the context containing variables and values |
platform | the underlying platform the algorithm will use |
sensors | map of sensor names to sensor information |
self | self-referencing variables |
gams::algorithms::Greet::~Greet | ( | ) |
Destructor.
|
virtual |
Analyzes environment, platform, or other information.
Implements gams::algorithms::BaseAlgorithm.
|
virtual |
Plans the next execution of the algorithm.
Implements gams::algorithms::BaseAlgorithm.
|
inherited |
Gets the list of agents.
|
inherited |
Gets algorithm status variables.
|
inherited |
Gets the knowledge base.
|
inherited |
Gets the platform.
|
inherited |
Gets self-defined variables.
|
inherited |
Gets the available sensor information.
void gams::algorithms::Greet::operator= | ( | const Greet & | rhs | ) |
Assignment operator.
rhs | values to copy |
|
virtual |
Plans the next execution of the algorithm.
Implements gams::algorithms::BaseAlgorithm.
|
virtualinherited |
Sets the list of agents in the swarm.
agents | list of agents |
|
virtualinherited |
Sets the platform.
platform | the underlying platform the algorithm will use |
|
virtualinherited |
Sets the map of sensor names to sensor information.
self | pointer to self-referencing variables container |
|
virtualinherited |
Sets the map of sensor names to sensor information.
sensors | map of sensor names to sensor information |
|
protectedinherited |
the list of agents potentially participating in the algorithm
Definition at line 201 of file BaseAlgorithm.h.
|
protectedinherited |
number of executions
Definition at line 204 of file BaseAlgorithm.h.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedinherited |
provides access to the knowledge base
Definition at line 207 of file BaseAlgorithm.h.
|
protectedinherited |
provides access to the platform
Definition at line 210 of file BaseAlgorithm.h.
|
protectedinherited |
the algorithm's concept of self
Definition at line 213 of file BaseAlgorithm.h.
|
protectedinherited |
provides access to sensor information
Definition at line 216 of file BaseAlgorithm.h.
|
protectedinherited |
provides access to status information for this platform
Definition at line 219 of file BaseAlgorithm.h.
|
protected |
|
protected |
|
protected |