CGeometry Class Reference

Geometry model. More...

#include <robot.h>

List of all members.

Public Member Functions

 CGeometry ()
void init (CRobot *robot, char *filename)
 Initializes the geometry model.
void cleanUp ()
CBox getBox (int id)
void setBox (int id, CBox &box)
CBox getBoxRobotSpace (int id)
 Returns a representation of the box in robot space.
int checkCollisions (int &first, int &second)
 Tests if two or more cubic base elements overlap.
bool xmlToCollision (TiXmlElement *boxNode, CRobot *robot)
 Parses the <COLLISION>s (xml objects).

Public Attributes

CBox geometry [GEOMETRY_BOXCOUNT]
 Set of cubic base elements making up the geometry model.
int length
 Number of elements in geometry.
bool check [GEOMETRY_BOXCOUNT][GEOMETRY_BOXCOUNT]
 Signals for every pair of cubic base elements if a collision check should be performed.

Private Member Functions

bool getCollision (CBox &obj1, CBox &obj2)
 Checks if the two boxes overlap.
bool checkOverlapping (const CVec &axis, const CBox &first, const CBox &second)
 Checks if the projections of the first and second box on the axis intersect.
void projection (const CBox &box, const CVec &axis, float &startpoint, float &endpoint)
 Calculates the start- and endpoint of the projection of the box on the axis.


Detailed Description

Geometry model.

The robot is modelled as a set of cubic base elements (CBox), which are stored in the geometry array. The position and orientation of every box is determined by the frames associated with each box. The frames might be attached to a certain link of the robot and therefore will be moved if the robot is moved.
Provides functions to:


Constructor & Destructor Documentation

CGeometry::CGeometry (  ) 


Member Function Documentation

bool CGeometry::getCollision ( CBox obj1,
CBox obj2 
) [private]

Checks if the two boxes overlap.

bool CGeometry::checkOverlapping ( const CVec axis,
const CBox first,
const CBox second 
) [private]

Checks if the projections of the first and second box on the axis intersect.

void CGeometry::projection ( const CBox box,
const CVec axis,
float &  startpoint,
float &  endpoint 
) [private]

Calculates the start- and endpoint of the projection of the box on the axis.

void CGeometry::init ( CRobot robot,
char *  filename 
)

Initializes the geometry model.

Parameters:
robot Robot structure, needed to initialize the local frame
filename XML-file to load the model from

void CGeometry::cleanUp (  ) 

CBox CGeometry::getBox ( int  id  ) 

void CGeometry::setBox ( int  id,
CBox box 
)

CBox CGeometry::getBoxRobotSpace ( int  id  ) 

Returns a representation of the box in robot space.

int CGeometry::checkCollisions ( int &  first,
int &  second 
)

Tests if two or more cubic base elements overlap.

Parameters:
first Index of first overlapping box
second Index of second overlapping box
Returns:
True if a collision occurred, False otherwise

bool CGeometry::xmlToCollision ( TiXmlElement *  boxNode,
CRobot robot 
)

Parses the <COLLISION>s (xml objects).

The <COLLISION> objects hold information about which box should be tested against which box in the collision check.


Member Data Documentation

CBox CGeometry::geometry[GEOMETRY_BOXCOUNT]

Set of cubic base elements making up the geometry model.

int CGeometry::length

Number of elements in geometry.

bool CGeometry::check[GEOMETRY_BOXCOUNT][GEOMETRY_BOXCOUNT]

Signals for every pair of cubic base elements if a collision check should be performed.


The documentation for this class was generated from the following files:
Generated on Mon Apr 21 23:27:43 2008 for BioloidControl by  doxygen 1.5.2