Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# FormationObject Class Reference

A class representing a formation in a potential field. More...

`#include <FormationObject.h>`

Inheritance diagram for FormationObject:

[legend]
Collaboration diagram for FormationObject:

[legend]
List of all members.

## Public Member Functions
| FormationObject (const std::string &name)
| Constructor.
virtual | ~FormationObject ()
| Destructor.
virtual PfPose | getPose (const PfPose &robotPose)
| Returns the pose of the object in reference to the robot pose (used for getting a pose from formation objects).
virtual PfVec | computeAbsFieldVecAt (const PfPose &otherPose)
| Computes the gradient of the formation at a given pose.
virtual double | computeChargeAt (const PfPose &otherPose)
| Computes the "charge" of the formation at a given pose.
virtual bool | isStatic () const
| Return whether the object is static or not.
virtual bool | isActive () const
| Returns whether the object is active or not.
virtual PfieldGeometricObject * | getGeometry () const
| Returns a pointer to the geometry of the object.
virtual PfieldGeometricObject * | getAbsGeometry () const
| Returns a pointer to the absolute geometry of the object.
virtual void | updateData ()
| Overrides function from Object, does nothing.
virtual PotentialFieldsObject * | getCopy ()
| Polymorph copy function.
void | addSingleFormation (SingleFormation *formation)
| Adds a new formation to his object.
## Protected Attributes
std::vector< SingleFormation * > | singleFormations
| The list of single formations belonging to this object.

## Detailed Description

A class representing a formation in a potential field.

Definition at line 320 of file FormationObject.h.

## Constructor & Destructor Documentation

FormationObject::FormationObject | ( | const std::string & | name | ) |

  | Constructor. Parameters:
  name | The name of the formation object
Definition at line 414 of file FormationObject.cpp. Referenced by getCopy().

FormationObject::~FormationObject | ( |  | ) | `[virtual]`

| Destructor. Definition at line 420 of file FormationObject.cpp. References singleFormations.

## Member Function Documentation

PfPose FormationObject::getPose | ( | const PfPose & | robotPose | ) | `[virtual]`

  | Returns the pose of the object in reference to the robot pose (used for getting a pose from formation objects). Parameters:
  robotPose | The robot pose
Returns: The object pose Reimplemented from PotentialFieldsObject. Definition at line 432 of file FormationObject.cpp. References PfPose::pos, and singleFormations.

PfVec FormationObject::computeAbsFieldVecAt | ( | const PfPose & | otherPose | ) | `[virtual]`

  | Computes the gradient of the formation at a given pose. Parameters:
  otherPose | The pose
Returns: The gradient (= f'(otherPose)) Reimplemented from PotentialFieldsObject. Definition at line 454 of file FormationObject.cpp. References singleFormations.

double FormationObject::computeChargeAt | ( | const PfPose & | otherPose | ) | `[virtual]`

  | Computes the "charge" of the formation at a given pose. Parameters:
  otherPose | The pose
Returns: The charge (= f(otherPose)) Reimplemented from PotentialFieldsObject. Definition at line 467 of file FormationObject.cpp. References singleFormations.

bool FormationObject::isStatic | ( |  | ) | const`[virtual]`

| Return whether the object is static or not. Returns: true, if the object is static Reimplemented from PotentialFieldsObject. Definition at line 480 of file FormationObject.cpp. References singleFormations.

bool FormationObject::isActive | ( |  | ) | const`[virtual]`

| Returns whether the object is active or not. Returns: true, if active Reimplemented from PotentialFieldsObject. Definition at line 495 of file FormationObject.cpp. References singleFormations.

virtual PfieldGeometricObject* FormationObject::getGeometry | ( |  | ) | const`[inline, virtual]`

| Returns a pointer to the geometry of the object. Returns: The geometric description Reimplemented from PotentialFieldsObject. Definition at line 363 of file FormationObject.h.

virtual PfieldGeometricObject* FormationObject::getAbsGeometry | ( |  | ) | const`[inline, virtual]`

| Returns a pointer to the absolute geometry of the object. Returns: The geometric description Reimplemented from PotentialFieldsObject. Definition at line 369 of file FormationObject.h.

virtual void FormationObject::updateData | ( |  | ) | `[inline, virtual]`

| Overrides function from Object, does nothing. Reimplemented from PotentialFieldsObject. Definition at line 373 of file FormationObject.h.

PotentialFieldsObject * FormationObject::getCopy | ( |  | ) | `[virtual]`

| Polymorph copy function. Returns: A copy of the FormationObject Reimplemented from PotentialFieldsObject. Definition at line 510 of file FormationObject.cpp. References addSingleFormation(), FormationObject(), and singleFormations.

Here is the call graph for this function:

void FormationObject::addSingleFormation | ( | SingleFormation * | formation | ) | `[inline]`

  | Adds a new formation to his object. Parameters:
  formation | The formation
Definition at line 383 of file FormationObject.h. References singleFormations. Referenced by getCopy(), and Parser::parseFormationObject().

## Member Data Documentation

std::vector< SingleFormation* > FormationObject::singleFormations`[protected]`

| The list of single formations belonging to this object. Definition at line 388 of file FormationObject.h. Referenced by addSingleFormation(), computeAbsFieldVecAt(), computeChargeAt(), getCopy(), getPose(), isActive(), isStatic(), and ~FormationObject().

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

- Tools/PotentialFields/FormationObject.h
- Tools/PotentialFields/FormationObject.cpp