AtomComponent Class Reference

AtomComponent. More...

#include <atomcomponent.h>

Inherits Component.

Inheritance diagram for AtomComponent:

Inheritance graph
[legend]
Collaboration diagram for AtomComponent:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AtomComponent (const OdeHandle &odeHandle, const OsgHandle &osgHandle, const ComponentConf &conf, const AtomConf &aconf)
 ~AtomComponent ()
virtual void deleteStructureRecursive ()
virtual int getSensors (sensor *sensors, int sensornumber)
 Use this, to get all sensor values of all the joints of all subcomponents, and the sensors of all robots, belonging to all subcomponents.
virtual void setMotors (const motor *motors, int motornumber)
 Sets the motor values for the joints connecting the component with its subcomponents, an recursivly the joints of all subComponents.
virtual int getSensorNumber ()
 Returns number of sensors; recursivly adding of the number of sensors all subcomponents and the robots of all Subcomponents.
virtual int getMotorNumber ()
 returns number of motors; recursivly adding of the number of sensors all subcomponents; at the moment only counts Hinge-, Slider-, Hinge2 and Universal-Joints; The Motor-Numbers of the robots of the Components is not counted.
virtual void update ()
 update the OSG notes here
virtual void place (const Pos &pos)
 sets the vehicle to position pos
virtual void place (const osg::Matrix &pose)
 sets the pose of the vehicle
virtual bool collisionCallback (void *data, dGeomID o1, dGeomID o2)
 checks for internal collisions and treats them.
virtual bool shellCollision (dGeomID o1, dGeomID o2)
virtual void doInternalStuff (const GlobalData &globalData)
 this function is called in each timestep.
virtual Position getPosition () const
 returns position of the object
virtual osg::Vec3 getPositionbetweenComponents (Component *component)
 This is only a simple function, calculating the coordinates of the point exactly between two directly connected components.
virtual PrimitivegetMainPrimitive () const
virtual componentConnection * getStrongestSoftlinkofStructure ()
 Searches for the softlink in the substructure of THIS component which has the highest binding strength.
virtual void makeComponentStructureRoot ()
 This changes the structure of all components connected with this component, so that this component will become the new root of this structure.
virtual double getMotionForce ()
 Calculates the linear force the Component has at the time of calling this function.
virtual double getCollisionForce (AtomComponent *collAtom)
 Calculates the linear force between two components at the moment of calling this function.
virtual bool fusionCondition (dGeomID o1, dGeomID o2)
 Tests if the conditions for fusion of two atoms are fulfilled.
virtual bool fissionCondition (dGeomID o1, dGeomID o2, double force)
 now fission is allowed if there is a single connection, with a binding energy smaller than the force of the colission, but the minimum value for fission from atomconf has to be reached
virtual bool collisionExclusionCondition (dGeomID o1, dGeomID o2)
 Test which collisions should not be handled.
virtual bool fusion (AtomComponent *atom_to_fuse)
 fuses this AtomComponent with an other one
virtual void disableStructureFusionRecursive ()
 Sets all teh fusionDisable parameters of the structure belonging to THIS atom to true, so that no fusion will occur.
virtual void enableStructureFusionRecursive ()
 Sets all teh fusionDisable parameters of the structure belonging to THIS atom to false, so that fusion will occur.
virtual bool fission (double force)
 fissions a AtomComponent from this AtomComponent
virtual void fissionOf (componentConnection *tmpconnection)
virtual AtomComponentgetLeastFittestDivideComponent (int minsize, AtomComponent *currentBestDivideComponent)
virtual AtomComponentgetCopyOutofTable (std::vector< TableLine > &table)
virtual AtomComponentcopyBaseStructure (osg::Vec3 deltaposition, std::vector< TableLine > &copytable)
virtual AtomComponentcopySoftlinkStructure (std::vector< TableLine > &copytable)
virtual AtomComponentcopyCompleteStructure (osg::Vec3 deltaposition, AtomComponent *copystartcomponent)
virtual bool replication (AtomComponent *atom_to_recplicate)
 Replication.
virtual bool replication_old (AtomComponent *atom_to_recplicate)
 Replication.
virtual void setConnectionFitness (unsigned int number, double value)
virtual void setConnectionFitnessAll (double value)
virtual double getConnectionFitness (unsigned int number)
virtual double getConnectionFitness (AtomComponent *searchedsubcomponent)
virtual double getStructureFitness ()
virtual void updateConnectionFitnessAll (AbstractController *controller)

Static Public Member Functions

AtomConf getDefaultAtomConf ()

Public Attributes

AtomConf atomconf

Private Attributes

OSGSpherecore
Primitiveshell

Detailed Description

AtomComponent.


Constructor & Destructor Documentation

AtomComponent const OdeHandle odeHandle,
const OsgHandle osgHandle,
const ComponentConf conf,
const AtomConf aconf
 

~AtomComponent  ) 
 


Member Function Documentation

bool collisionCallback void *  data,
dGeomID  o1,
dGeomID  o2
[virtual]
 

checks for internal collisions and treats them.

In case of a treatment return true (collision will be ignored by other objects and the default routine) else false (collision is passed to other objects and (if not treated) to the default routine).

Reimplemented from Component.

bool collisionExclusionCondition dGeomID  o1,
dGeomID  o2
[virtual]
 

Test which collisions should not be handled.

Parameters:
Geom reference to the first atom
Geom reference to the second atom
Returns:
true if fulfilled false if not

AtomComponent * copyBaseStructure osg::Vec3  deltaposition,
std::vector< TableLine > &  copytable
[virtual]
 

AtomComponent * copyCompleteStructure osg::Vec3  deltaposition,
AtomComponent copystartcomponent
[virtual]
 

AtomComponent * copySoftlinkStructure std::vector< TableLine > &  copytable  )  [virtual]
 

void deleteStructureRecursive  )  [virtual]
 

void disableStructureFusionRecursive  )  [virtual]
 

Sets all teh fusionDisable parameters of the structure belonging to THIS atom to true, so that no fusion will occur.

void doInternalStuff const GlobalData globalData  )  [virtual]
 

this function is called in each timestep.

It should perform robot-internal checks, like space-internal collision detection, sensor resets/update etc.

Parameters:
globalData structure that contains global data from the simulation environment

Reimplemented from Component.

void enableStructureFusionRecursive  )  [virtual]
 

Sets all teh fusionDisable parameters of the structure belonging to THIS atom to false, so that fusion will occur.

bool fission double  force  )  [virtual]
 

fissions a AtomComponent from this AtomComponent

Parameters:
the AtomComponent, to fission true if the fission was successfull, false if not

bool fissionCondition dGeomID  o1,
dGeomID  o2,
double  force
[virtual]
 

now fission is allowed if there is a single connection, with a binding energy smaller than the force of the colission, but the minimum value for fission from atomconf has to be reached

Parameters:
Geom reference to the first atom
Geom reference to the second atom
Returns:
true if fulfilled false if not

void fissionOf componentConnection *  tmpconnection  )  [virtual]
 

bool fusion AtomComponent atom_to_fuse  )  [virtual]
 

fuses this AtomComponent with an other one

Parameters:
the AtomComponent, to fuse with true if the fusion was successfull, false if not

bool fusionCondition dGeomID  o1,
dGeomID  o2
[virtual]
 

Tests if the conditions for fusion of two atoms are fulfilled.

Parameters:
Geom reference to the first atom
Geom reference to the second atom
Returns:
true if fulfilled false if not

double getCollisionForce AtomComponent collAtom  )  [virtual]
 

Calculates the linear force between two components at the moment of calling this function.

Returns:
force (masses*linear velocity of both atoms)

double getConnectionFitness AtomComponent searchedsubcomponent  )  [virtual]
 

double getConnectionFitness unsigned int  number  )  [virtual]
 

AtomComponent * getCopyOutofTable std::vector< TableLine > &  table  )  [virtual]
 

AtomConf getDefaultAtomConf  )  [inline, static]
 

AtomComponent * getLeastFittestDivideComponent int  minsize,
AtomComponent currentBestDivideComponent
[virtual]
 

Primitive * getMainPrimitive  )  const [virtual]
 

Returns:
reference to the simple Primitive, or to the main Primitive of the robot assigend to the component. If nothimng is assigned, NULL is returned.

Implements Component.

double getMotionForce  )  [virtual]
 

Calculates the linear force the Component has at the time of calling this function.

Returns:
force (mass*linear velocity)

int getMotorNumber  )  [virtual]
 

returns number of motors; recursivly adding of the number of sensors all subcomponents; at the moment only counts Hinge-, Slider-, Hinge2 and Universal-Joints; The Motor-Numbers of the robots of the Components is not counted.

Returns:
number of motors of the component and all its subcomponents

Reimplemented from Component.

Position getPosition  )  const [virtual]
 

returns position of the object

Returns:
vector of position (x,y,z)

Implements Component.

osg::Vec3 getPositionbetweenComponents Component component  )  [virtual]
 

This is only a simple function, calculating the coordinates of the point exactly between two directly connected components.

Returns:
Vector containing the Position
Parameters:
index number of the position

Reimplemented from Component.

int getSensorNumber  )  [virtual]
 

Returns number of sensors; recursivly adding of the number of sensors all subcomponents and the robots of all Subcomponents.

Returns:
number of sensors of the component and all its subcomponents

Reimplemented from Component.

int getSensors sensor sensors,
int  sensornumber
[virtual]
 

Use this, to get all sensor values of all the joints of all subcomponents, and the sensors of all robots, belonging to all subcomponents.

The sensor values have the following sequence: values of the component connecting joints, values of the robot of the component, values of component connecting joints of the first subcomponent, values of the robot of the first subcomponent, ...

Parameters:
robot sensor values of the connecting joints of this component and all subcomponents

Reimplemented from Component.

AtomComponent::componentConnection * getStrongestSoftlinkofStructure  )  [virtual]
 

Searches for the softlink in the substructure of THIS component which has the highest binding strength.

Returns:
the softlink connection within the substructure of THIS component.

double getStructureFitness  )  [virtual]
 

void makeComponentStructureRoot  )  [virtual]
 

This changes the structure of all components connected with this component, so that this component will become the new root of this structure.

void place const osg::Matrix pose  )  [virtual]
 

sets the pose of the vehicle

Parameters:
pose desired 4x4 pose matrix

Implements OdeRobot.

void place const Pos pos  )  [virtual]
 

sets the vehicle to position pos

Parameters:
pos desired position of the robot

Implements Component.

bool replication AtomComponent atom_to_recplicate  )  [virtual]
 

Replication.

They have to belong to two robots, so that touching each ofer causes a crossing over in her structure.

Parameters:
the AtomComponent which belongs to the structure to replicate with, and which is the point where the replication will happen
Returns:
true if replication was successfull, else false

bool replication_old AtomComponent atom_to_replicate  )  [virtual]
 

Replication.

void setConnectionFitness unsigned int  number,
double  value
[virtual]
 

void setConnectionFitnessAll double  value  )  [virtual]
 

void setMotors const motor motors,
int  motornumber
[virtual]
 

Sets the motor values for the joints connecting the component with its subcomponents, an recursivly the joints of all subComponents.

Parameters:
 

Reimplemented from Component.

bool shellCollision dGeomID  o1,
dGeomID  o2
[virtual]
 

void update  )  [virtual]
 

update the OSG notes here

Implements Component.

void updateConnectionFitnessAll AbstractController controller  )  [virtual]
 


Member Data Documentation

AtomConf atomconf
 

OSGSphere* core [private]
 

Primitive* shell [private]
 


The documentation for this class was generated from the following files:
Generated on Tue Jan 16 02:14:53 2007 for Robotsystem of the Robot Group Leipzig by doxygen 1.3.8