#include <FormationObject.h>
Inheritance diagram for SingleFormation:
Public Member Functions | |
SingleFormation () | |
Constructor. | |
virtual | ~SingleFormation () |
Destructor. | |
virtual bool | isActive () const |
Checks if the formation is active. | |
virtual bool | isStatic () const |
Checks if the formation has a static position. | |
virtual PfVec | getPosition (const PfPose &robotPose) |
Returns the position of the formation in reference to the robot pose (used for A*-search to a formation). | |
virtual PfVec | getVec (const PfPose &otherPose) |
Returns the field vector to/from a formation to/from a given pose. | |
virtual double | getCharge (const PfPose &otherPose) |
Returns the field charge of the formation at a given pose. | |
double | getDistanceToFormation (const PfPose &otherPose) const |
Returns the distance between a pose and the formation area. | |
void | addObject (Object *object) |
Adds an object to the formation. | |
void | setFunction (PotentialfieldFunction *function) |
Sets the function of the field of the formation. | |
void | setPriority (double priority) |
Sets the priority of the formation. | |
double | getPriority () const |
Returns the priority of the formation. | |
void | init () |
Initializes the formation. | |
virtual bool | positionInsideFormation (const PfVec &p) const |
Checks if a position is inside the formation area. | |
virtual SingleFormation * | copy () const |
Creates a copy of the formation object. | |
Protected Member Functions | |
virtual void | updateGeometry () |
Updates the positions of the formation. | |
Protected Attributes | |
std::vector< Object * > | objects |
The objects the formation is spanning. | |
Object | geometricFormationObject |
An object representing the shape of the formation. | |
PfVec | robotPosition |
The position of the robot (kept for internal purposes). | |
double | priority |
The priority of the formation (may be used for selection). |
Definition at line 35 of file FormationObject.h.
|
Constructor.
Definition at line 17 of file FormationObject.cpp. References geometricFormationObject, Object::setField(), and SHAPE_FIELD. Referenced by copy(). |
Here is the call graph for this function:
|
Destructor.
Definition at line 42 of file FormationObject.h. |
|
Checks if the formation is active.
Reimplemented in BetweenFormation, AmongFormation, RelativeFormation, and BestFitFormation. Definition at line 47 of file FormationObject.h. |
|
Checks if the formation has a static position.
Reimplemented in BestFitFormation. Definition at line 23 of file FormationObject.cpp. References objects. |
|
Returns the position of the formation in reference to the robot pose (used for A*-search to a formation).
Reimplemented in BestFitFormation. Definition at line 37 of file FormationObject.cpp. References Polygon::distanceTo(), geometricFormationObject, Object::getGeometry(), PfPose::pos, robotPosition, and updateGeometry(). |
Here is the call graph for this function:
|
Returns the field vector to/from a formation to/from a given pose.
Reimplemented in BestFitFormation. Definition at line 55 of file FormationObject.cpp. References Object::computeAbsFieldVecAt(), geometricFormationObject, PfPose::pos, positionInsideFormation(), robotPosition, and updateGeometry(). |
Here is the call graph for this function:
|
Returns the field charge of the formation at a given pose.
Reimplemented in BestFitFormation. Definition at line 70 of file FormationObject.cpp. References Object::computeChargeAt(), geometricFormationObject, PfPose::pos, robotPosition, and updateGeometry(). |
Here is the call graph for this function:
|
Returns the distance between a pose and the formation area.
Definition at line 84 of file FormationObject.cpp. References PfieldGeometricObject::distanceTo(), geometricFormationObject, Object::getGeometry(), and PfPose::pos. |
Here is the call graph for this function:
|
Adds an object to the formation.
Definition at line 78 of file FormationObject.cpp. References objects. Referenced by Parser::parseSingleFormation(). |
|
Sets the function of the field of the formation.
Definition at line 88 of file FormationObject.h. References geometricFormationObject, and Object::setFunction(). Referenced by Parser::parseSingleFormation(). |
Here is the call graph for this function:
|
Sets the priority of the formation.
Definition at line 94 of file FormationObject.h. Referenced by Parser::parseSingleFormation(). |
|
Returns the priority of the formation.
Definition at line 100 of file FormationObject.h. References priority. |
|
Initializes the formation.
Definition at line 104 of file FormationObject.h. References updateGeometry(). Referenced by Parser::parseSingleFormation(). |
Here is the call graph for this function:
|
Checks if a position is inside the formation area.
Reimplemented in BetweenFormation, and AmongFormation. Definition at line 111 of file FormationObject.h. Referenced by getVec(). |
|
Creates a copy of the formation object.
Reimplemented in RelativeFormation, and BestFitFormation. Definition at line 92 of file FormationObject.cpp. References geometricFormationObject, objects, priority, robotPosition, and SingleFormation(). |
Here is the call graph for this function:
|
Updates the positions of the formation.
Reimplemented in BetweenFormation, AmongFormation, RelativeFormation, and BestFitFormation. Definition at line 129 of file FormationObject.h. Referenced by getCharge(), getPosition(), getVec(), and init(). |
|
The objects the formation is spanning.
Definition at line 121 of file FormationObject.h. Referenced by addObject(), RelativeFormation::copy(), copy(), and isStatic(). |
|
An object representing the shape of the formation.
Definition at line 123 of file FormationObject.h. Referenced by RelativeFormation::copy(), copy(), getCharge(), getDistanceToFormation(), getPosition(), getVec(), setFunction(), and SingleFormation(). |
|
The position of the robot (kept for internal purposes).
Definition at line 125 of file FormationObject.h. Referenced by RelativeFormation::copy(), copy(), getCharge(), getPosition(), and getVec(). |
|
The priority of the formation (may be used for selection).
Definition at line 127 of file FormationObject.h. Referenced by copy(), and getPriority(). |