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

PotentialFieldsObject Class Reference

A class representing an object in a potential field. More...

#include <FieldObject.h>

Inheritance diagram for PotentialFieldsObject:

Inheritance graph
[legend]
Collaboration diagram for PotentialFieldsObject:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PotentialFieldsObject ()
 Constructor.

 PotentialFieldsObject (const std::string &name, ObjectType objectType)
 Constructor.

virtual ~PotentialFieldsObject ()
 Destructor.

virtual double computeChargeAt (const PfPose &otherPose)
 Computes the impact of an object at a given pose.

virtual PfVec computeAbsFieldVecAt (const PfPose &otherPose)
 Computes the gradient of an object at a given pose.

PotentialFieldsObjectcreateInstance (const std::string &instanceName)
 Creates a copy of this object and changes the name of the copied object.

void operator= (const PotentialFieldsObject &other)
 Copy operator.

virtual PotentialFieldsObjectgetCopy ()
 Polymorph copy function.

void getMinimalCopyFrom (PotentialFieldsObject *other)
 Get new data from other object.

std::string getName () const
 Returns the name of the object.

PfPose getPose () const
 Returns the pose of the object.

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

void setPose (const PfPose &pose)
 Sets the pose of the object and updates the absolute geometry.

void setActivation (const bool &active)
 Sets the state of the object.

virtual bool isActive () const
 Returns whether the object is active or not.

ObjectType getType () const
 Returns the type of the object.

void setStatic (const bool &isStatic, unsigned int dynamicPoseId=0)
 Sets the static/dynamic state of the object.

virtual bool isStatic () const
 Return whether the object is static or not.

void setFunction (PotentialfieldFunction *function)
 Sets the function of the object.

void setField (FieldType type)
 Sets the field type of the object.

void setField (FieldType type, const Sector &sector)
 Sets the field type of the object.

void setTangentialField (TangentialField tangentialField)
 Sets the type of the tangential field.

void setGeometry (PfieldGeometricObject *geometry)
 Sets the geometry of the object.

virtual PfieldGeometricObjectgetGeometry () const
 Returns a pointer to the geometry of the object.

virtual PfieldGeometricObjectgetAbsGeometry () const
 Returns a pointer to the absolute geometry of the object.

void setPfieldCompositionRef (PotentialfieldComposition *ref)
 Sets the reference to the PotentialfieldComposition.

virtual void updateData ()
 Gets new data (pose/activation), if dynamic.

void computeAbsGeometry ()
 Computes the absolute geometry.


Protected Member Functions

double computeChargeForSinglePose (const PfPose &objectPose, const PfPose &position) const
 Computes the charge at a pose.

PfVec computeGradientVecForSinglePose (const PfPose &objectPose, const PfPose &position) const
 Computes the gradient at a pose.


Protected Attributes

PfPose pose
 The pose of the object.

std::string name
 The name of the object.

bool active
 Flag, determines if object is active.

bool isStaticVar
 Flag, determines if object is static/dynamic.

TangentialField tangentialField
 Flag, determines, if the field has a tangential direction.

FieldType fieldType
 The type of the potential field.

PotentialfieldFunctionfunction
 The function of this object.

ObjectType objectType
 The type of the object (attractive/repulsive).

PfieldGeometricObjectgeometry
 The description of the object's geometry.

PfieldGeometricObjectabsGeometry
 The description of the object's geometry in absolute coordinates.

Sector sector
 The sector of the potential field (if fieldType==SECTOR_FIELD).

PotentialfieldCompositionrefToPfieldComposition
 A pointer to the PotentialfieldComposition.

unsigned int dynamicPoseId
 The id of the dynamic pose (if used).


Detailed Description

A class representing an object in a potential field.

Definition at line 29 of file FieldObject.h.


Constructor & Destructor Documentation

PotentialFieldsObject::PotentialFieldsObject  ) 
 

Constructor.

Definition at line 12 of file FieldObject.cpp.

References absGeometry, function, geometry, NO_TANGENTIALFIELD, refToPfieldComposition, and tangentialField.

Referenced by createInstance(), and getCopy().

PotentialFieldsObject::PotentialFieldsObject const std::string &  name,
ObjectType  objectType
 

Constructor.

Parameters:
name The name of the object
objectType The type of the object

Definition at line 22 of file FieldObject.cpp.

References absGeometry, function, geometry, NO_TANGENTIALFIELD, refToPfieldComposition, and tangentialField.

PotentialFieldsObject::~PotentialFieldsObject  )  [virtual]
 

Destructor.

Definition at line 35 of file FieldObject.cpp.

References absGeometry, function, and geometry.


Member Function Documentation

double PotentialFieldsObject::computeChargeAt const PfPose otherPose  )  [virtual]
 

Computes the impact of an object at a given pose.

Parameters:
otherPose The pose
Returns:
The charge (= f(otherPose))

Reimplemented in FormationObject.

Definition at line 143 of file FieldObject.cpp.

References computeChargeForSinglePose(), PfPose::hasProbabilityDistribution, PfPose::probability, and PfPose::probabilityDistribution.

Referenced by SingleFormation::getCharge(), and PotentialfieldAStarNode::setValueAtPos().

Here is the call graph for this function:

PfVec PotentialFieldsObject::computeAbsFieldVecAt const PfPose otherPose  )  [virtual]
 

Computes the gradient of an object at a given pose.

Parameters:
otherPose The pose
Returns:
The gradient (= f'(otherPose))

Reimplemented in FormationObject.

Definition at line 192 of file FieldObject.cpp.

References CLOCKWISE, computeGradientVecForSinglePose(), COUNTER_CLOCKWISE, PfPose::hasProbabilityDistribution, objectType, pi_2, PfPose::probability, PfPose::probabilityDistribution, REPULSIVE, PfVec::rotate(), and tangentialField.

Referenced by SingleFormation::getVec().

Here is the call graph for this function:

PotentialFieldsObject * PotentialFieldsObject::createInstance const std::string &  instanceName  ) 
 

Creates a copy of this object and changes the name of the copied object.

Parameters:
instanceName The name of the copy
Returns:
The copy

Definition at line 52 of file FieldObject.cpp.

References name, and PotentialFieldsObject().

Here is the call graph for this function:

void PotentialFieldsObject::operator= const PotentialFieldsObject other  ) 
 

Copy operator.

Parameters:
other The object to copy

Definition at line 61 of file FieldObject.cpp.

References absGeometry, active, dynamicPoseId, fieldType, function, geometry, isStaticVar, name, objectType, pose, refToPfieldComposition, sector, SECTOR_FIELD, setActivation(), setField(), setFunction(), setGeometry(), setPfieldCompositionRef(), setPose(), setStatic(), setTangentialField(), and tangentialField.

Here is the call graph for this function:

PotentialFieldsObject * PotentialFieldsObject::getCopy  )  [virtual]
 

Polymorph copy function.

Returns:
A copy of the object

Reimplemented in FormationObject.

Definition at line 96 of file FieldObject.cpp.

References PotentialFieldsObject().

Here is the call graph for this function:

void PotentialFieldsObject::getMinimalCopyFrom PotentialFieldsObject other  ) 
 

Get new data from other object.

It is assumed that a full copy had been done before. Only changing data (e.g. the pose) is copied.

Parameters:
other The object to get the data from

Definition at line 104 of file FieldObject.cpp.

References getPose(), isActive(), setActivation(), and setPose().

Here is the call graph for this function:

std::string PotentialFieldsObject::getName  )  const [inline]
 

Returns the name of the object.

Returns:
The name

Definition at line 81 of file FieldObject.h.

Referenced by PotentialfieldComposition::addObject(), and Parser::parseAndInsertObject().

PfPose PotentialFieldsObject::getPose  )  const [inline]
 

Returns the pose of the object.

Returns:
The pose

Definition at line 87 of file FieldObject.h.

Referenced by FutureWorldModelGenerator::executeSingleTransformation(), and getMinimalCopyFrom().

virtual PfPose PotentialFieldsObject::getPose const PfPose robotPose  )  [inline, 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 in FormationObject.

Definition at line 95 of file FieldObject.h.

void PotentialFieldsObject::setPose const PfPose pose  ) 
 

Sets the pose of the object and updates the absolute geometry.

Parameters:
pose The new pose

Definition at line 133 of file FieldObject.cpp.

References absGeometry, geometry, and PfieldGeometricObject::setAbsoluteFromOther().

Referenced by Motionfield::getFieldVecFromAStarSearch(), getMinimalCopyFrom(), operator=(), Parser::parseInstance(), and updateData().

Here is the call graph for this function:

void PotentialFieldsObject::setActivation const bool &  active  )  [inline]
 

Sets the state of the object.

Parameters:
active Flag which determines whether the object is active or not

Definition at line 106 of file FieldObject.h.

Referenced by getMinimalCopyFrom(), operator=(), and Parser::parseInstance().

virtual bool PotentialFieldsObject::isActive  )  const [inline, virtual]
 

Returns whether the object is active or not.

Returns:
true, if active

Reimplemented in FormationObject.

Definition at line 112 of file FieldObject.h.

Referenced by getMinimalCopyFrom().

ObjectType PotentialFieldsObject::getType  )  const [inline]
 

Returns the type of the object.

Returns:
The type

Definition at line 118 of file FieldObject.h.

References ObjectType.

void PotentialFieldsObject::setStatic const bool &  isStatic,
unsigned int  dynamicPoseId = 0
[inline]
 

Sets the static/dynamic state of the object.

Parameters:
isStatic Flag
dynamicPoseId The id of the static pose

Definition at line 125 of file FieldObject.h.

References isStaticVar.

Referenced by operator=(), and Parser::parseInstance().

virtual bool PotentialFieldsObject::isStatic  )  const [inline, virtual]
 

Return whether the object is static or not.

Returns:
true, if the object is static

Reimplemented in FormationObject.

Definition at line 134 of file FieldObject.h.

References isStaticVar.

Referenced by Actionfield::addObject().

void PotentialFieldsObject::setFunction PotentialfieldFunction function  ) 
 

Sets the function of the object.

Parameters:
function The function

Definition at line 299 of file FieldObject.cpp.

References PotentialfieldFunction::clone().

Referenced by operator=(), Parser::parseObject(), and SingleFormation::setFunction().

Here is the call graph for this function:

void PotentialFieldsObject::setField FieldType  type  ) 
 

Sets the field type of the object.

Parameters:
type The field type

Definition at line 313 of file FieldObject.cpp.

References fieldType.

Referenced by operator=(), Parser::parseObject(), and SingleFormation::SingleFormation().

void PotentialFieldsObject::setField FieldType  type,
const Sector sector
 

Sets the field type of the object.

Parameters:
type The field type
sector A sector description (if type == SECTOR_FIELD)

Definition at line 319 of file FieldObject.cpp.

References PotentialfieldFunction::clone(), Sector::crossFunction, and fieldType.

Here is the call graph for this function:

void PotentialFieldsObject::setTangentialField TangentialField  tangentialField  )  [inline]
 

Sets the type of the tangential field.

Parameters:
tangentialField The type of the tangential field

Definition at line 156 of file FieldObject.h.

Referenced by operator=(), and Parser::parseObject().

void PotentialFieldsObject::setGeometry PfieldGeometricObject geometry  ) 
 

Sets the geometry of the object.

Parameters:
geometry The geometric description

Definition at line 118 of file FieldObject.cpp.

References absGeometry, PfieldGeometricObject::clone(), and PfieldGeometricObject::getAbs().

Referenced by AmongFormation::AmongFormation(), BetweenFormation::BetweenFormation(), operator=(), Parser::parseObject(), and RelativeFormation::RelativeFormation().

Here is the call graph for this function:

virtual PfieldGeometricObject* PotentialFieldsObject::getGeometry  )  const [inline, virtual]
 

Returns a pointer to the geometry of the object.

Returns:
The geometric description

Reimplemented in FormationObject.

Definition at line 167 of file FieldObject.h.

References geometry.

Referenced by SingleFormation::getDistanceToFormation(), SingleFormation::getPosition(), AmongFormation::positionInsideFormation(), BetweenFormation::positionInsideFormation(), RelativeFormation::updateGeometry(), AmongFormation::updateGeometry(), and BetweenFormation::updateGeometry().

virtual PfieldGeometricObject* PotentialFieldsObject::getAbsGeometry  )  const [inline, virtual]
 

Returns a pointer to the absolute geometry of the object.

Returns:
The geometric description

Reimplemented in FormationObject.

Definition at line 173 of file FieldObject.h.

References absGeometry.

void PotentialFieldsObject::setPfieldCompositionRef PotentialfieldComposition ref  )  [inline]
 

Sets the reference to the PotentialfieldComposition.

Parameters:
ref The reference

Definition at line 179 of file FieldObject.h.

References refToPfieldComposition.

Referenced by operator=(), and Parser::parseObject().

void PotentialFieldsObject::updateData  )  [virtual]
 

Gets new data (pose/activation), if dynamic.

Reimplemented in FormationObject.

Definition at line 327 of file FieldObject.cpp.

References dynamicPoseId, PotentialfieldComposition::getDescriptionFromId(), ObjectStateDescription::isActive, ObjectStateDescription::pose, refToPfieldComposition, and setPose().

Here is the call graph for this function:

void PotentialFieldsObject::computeAbsGeometry  ) 
 

Computes the absolute geometry.

Definition at line 336 of file FieldObject.cpp.

References absGeometry, geometry, and PfieldGeometricObject::setAbsoluteFromOther().

Here is the call graph for this function:

double PotentialFieldsObject::computeChargeForSinglePose const PfPose objectPose,
const PfPose position
const [inline, protected]
 

Computes the charge at a pose.

Parameters:
objectPose The pose of an object
position A position influenced by the object
Returns:
The charge

Definition at line 263 of file FieldObject.cpp.

References computeChargeForPointfield(), computeChargeForSectorfield(), computeChargeForShapefield(), fieldType, function, geometry, POINT_FIELD, sector, SECTOR_FIELD, and SHAPE_FIELD.

Referenced by computeChargeAt().

Here is the call graph for this function:

PfVec PotentialFieldsObject::computeGradientVecForSinglePose const PfPose objectPose,
const PfPose position
const [inline, protected]
 

Computes the gradient at a pose.

Parameters:
objectPose The pose of an object
position A position influenced by the object
Returns:
The gradient vector

Definition at line 280 of file FieldObject.cpp.

References computeGradientForPointfield(), computeGradientForSectorfield(), computeGradientForShapefield(), fieldType, function, geometry, objectType, POINT_FIELD, sector, SECTOR_FIELD, and SHAPE_FIELD.

Referenced by computeAbsFieldVecAt().

Here is the call graph for this function:


Member Data Documentation

PfPose PotentialFieldsObject::pose [protected]
 

The pose of the object.

Definition at line 190 of file FieldObject.h.

Referenced by operator=().

std::string PotentialFieldsObject::name [protected]
 

The name of the object.

Definition at line 192 of file FieldObject.h.

Referenced by createInstance(), and operator=().

bool PotentialFieldsObject::active [protected]
 

Flag, determines if object is active.

Definition at line 194 of file FieldObject.h.

Referenced by operator=().

bool PotentialFieldsObject::isStaticVar [protected]
 

Flag, determines if object is static/dynamic.

Definition at line 196 of file FieldObject.h.

Referenced by isStatic(), operator=(), and setStatic().

TangentialField PotentialFieldsObject::tangentialField [protected]
 

Flag, determines, if the field has a tangential direction.

Definition at line 198 of file FieldObject.h.

Referenced by computeAbsFieldVecAt(), operator=(), and PotentialFieldsObject().

FieldType PotentialFieldsObject::fieldType [protected]
 

The type of the potential field.

Definition at line 200 of file FieldObject.h.

Referenced by computeChargeForSinglePose(), computeGradientVecForSinglePose(), operator=(), and setField().

PotentialfieldFunction* PotentialFieldsObject::function [protected]
 

The function of this object.

Definition at line 202 of file FieldObject.h.

Referenced by computeChargeForSinglePose(), computeGradientVecForSinglePose(), operator=(), PotentialFieldsObject(), and ~PotentialFieldsObject().

ObjectType PotentialFieldsObject::objectType [protected]
 

The type of the object (attractive/repulsive).

Definition at line 204 of file FieldObject.h.

Referenced by computeAbsFieldVecAt(), computeGradientVecForSinglePose(), and operator=().

PfieldGeometricObject* PotentialFieldsObject::geometry [protected]
 

The description of the object's geometry.

Definition at line 206 of file FieldObject.h.

Referenced by computeAbsGeometry(), computeChargeForSinglePose(), computeGradientVecForSinglePose(), getGeometry(), operator=(), PotentialFieldsObject(), setPose(), and ~PotentialFieldsObject().

PfieldGeometricObject* PotentialFieldsObject::absGeometry [protected]
 

The description of the object's geometry in absolute coordinates.

Definition at line 208 of file FieldObject.h.

Referenced by computeAbsGeometry(), getAbsGeometry(), operator=(), PotentialFieldsObject(), setGeometry(), setPose(), and ~PotentialFieldsObject().

Sector PotentialFieldsObject::sector [protected]
 

The sector of the potential field (if fieldType==SECTOR_FIELD).

Definition at line 210 of file FieldObject.h.

Referenced by computeChargeForSinglePose(), computeGradientVecForSinglePose(), and operator=().

PotentialfieldComposition* PotentialFieldsObject::refToPfieldComposition [protected]
 

A pointer to the PotentialfieldComposition.

Definition at line 212 of file FieldObject.h.

Referenced by operator=(), PotentialFieldsObject(), setPfieldCompositionRef(), and updateData().

unsigned int PotentialFieldsObject::dynamicPoseId [protected]
 

The id of the dynamic pose (if used).

Definition at line 214 of file FieldObject.h.

Referenced by operator=(), and updateData().


The documentation for this class was generated from the following files:
Generated on Mon Mar 20 22:19:39 2006 for GT2005 by doxygen 1.3.6