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

Object Class Reference

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

#include <FieldObject.h>

Inheritance diagram for Object:

Inheritance graph
[legend]
Collaboration diagram for Object:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Object ()
 Constructor.

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

virtual ~Object ()
 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.

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

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

virtual ObjectgetCopy ()
 Polymorph copy function.

void getMinimalCopyFrom (Object *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

Object::Object  ) 
 

Constructor.

Definition at line 14 of file FieldObject.cpp.

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

Referenced by createInstance(), and getCopy().

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

Constructor.

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

Definition at line 24 of file FieldObject.cpp.

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

Object::~Object  )  [virtual]
 

Destructor.

Definition at line 37 of file FieldObject.cpp.

References absGeometry, function, and geometry.


Member Function Documentation

double Object::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 145 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 Object::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 194 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:

Object * Object::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 54 of file FieldObject.cpp.

References name, and Object().

Here is the call graph for this function:

void Object::operator= const Object other  ) 
 

Copy operator.

Parameters:
other The object to copy

Definition at line 63 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:

Object * Object::getCopy  )  [virtual]
 

Polymorph copy function.

Returns:
A copy of the object

Reimplemented in FormationObject.

Definition at line 98 of file FieldObject.cpp.

References Object().

Here is the call graph for this function:

void Object::getMinimalCopyFrom Object 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 106 of file FieldObject.cpp.

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

Here is the call graph for this function:

std::string Object::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 Object::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 Object::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 Object::setPose const PfPose pose  ) 
 

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

Parameters:
pose The new pose

Definition at line 135 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 Object::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 Object::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 Object::getType  )  const [inline]
 

Returns the type of the object.

Returns:
The type

Definition at line 118 of file FieldObject.h.

References ObjectType.

void Object::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 Object::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 Object::setFunction PotentialfieldFunction function  ) 
 

Sets the function of the object.

Parameters:
function The function

Definition at line 301 of file FieldObject.cpp.

References PotentialfieldFunction::clone().

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

Here is the call graph for this function:

void Object::setField FieldType  type  ) 
 

Sets the field type of the object.

Parameters:
type The field type

Definition at line 315 of file FieldObject.cpp.

References fieldType.

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

void Object::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 321 of file FieldObject.cpp.

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

Here is the call graph for this function:

void Object::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 Object::setGeometry PfieldGeometricObject geometry  ) 
 

Sets the geometry of the object.

Parameters:
geometry The geometric description

Definition at line 120 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* Object::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* Object::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 Object::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 Object::updateData  )  [virtual]
 

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

Reimplemented in FormationObject.

Definition at line 329 of file FieldObject.cpp.

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

Here is the call graph for this function:

void Object::computeAbsGeometry  ) 
 

Computes the absolute geometry.

Definition at line 338 of file FieldObject.cpp.

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

Here is the call graph for this function:

double Object::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 265 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 Object::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 282 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 Object::pose [protected]
 

The pose of the object.

Definition at line 190 of file FieldObject.h.

Referenced by operator=().

std::string Object::name [protected]
 

The name of the object.

Definition at line 192 of file FieldObject.h.

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

bool Object::active [protected]
 

Flag, determines if object is active.

Definition at line 194 of file FieldObject.h.

Referenced by operator=().

bool Object::isStaticVar [protected]
 

Flag, determines if object is static/dynamic.

Definition at line 196 of file FieldObject.h.

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

TangentialField Object::tangentialField [protected]
 

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

Definition at line 198 of file FieldObject.h.

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

FieldType Object::fieldType [protected]
 

The type of the potential field.

Definition at line 200 of file FieldObject.h.

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

PotentialfieldFunction* Object::function [protected]
 

The function of this object.

Definition at line 202 of file FieldObject.h.

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

ObjectType Object::objectType [protected]
 

The type of the object (attractive/repulsive).

Definition at line 204 of file FieldObject.h.

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

PfieldGeometricObject* Object::geometry [protected]
 

The description of the object's geometry.

Definition at line 206 of file FieldObject.h.

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

PfieldGeometricObject* Object::absGeometry [protected]
 

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

Definition at line 208 of file FieldObject.h.

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

Sector Object::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* Object::refToPfieldComposition [protected]
 

A pointer to the PotentialfieldComposition.

Definition at line 212 of file FieldObject.h.

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

unsigned int Object::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 Thu Sep 23 20:09:57 2004 for GT2004 by doxygen 1.3.6