Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::DistanceCalculator Class Reference
[ObstacleAvoidance]

Interface class for Distance Calculators. More...

#include <DistanceCalculator.hpp>

Inheritance diagram for OSCAR::DistanceCalculator:

Inheritance graph
[legend]
List of all members.

Public Methods

 DistanceCalculator (const String &name=String(), OSCARError &err=DUMMY_ERROR(noError))
virtual ~DistanceCalculator ()
virtual bool CalcDist (const Node &from, const Node &to, DistanceResults &results, bool checkSelf=false, const std::set< const ModelingObject * > &ignoreSet=std::set< const ModelingObject * >())
bool CalcDist (const Primitive &from, const Primitive &to, Vector3 &fromWit, Vector3 &toWit, Vector3 &unitVec, double &dist)
virtual bool CalcGFunctions (const Node &from, const Node &to, DistanceResults &results, FKVelocity *fromFK, bool checkSelf=false, const std::set< const ModelingObject * > &ignoreSet=std::set< const ModelingObject * >())
virtual bool CalcHFunctions (const Node &from, const Node &to, DistanceResults &results, FKAcceleration *fromFK, bool checkSelf=false, const std::set< const ModelingObject * > &ignoreSet=std::set< const ModelingObject * >())
bool CalcGFunction (const Primitive &from, const Primitive &to, DistanceResults &results, FKVelocity *fromFK, unsigned int fromFrame)
bool CalcHFunction (const Primitive &from, const Primitive &to, DistanceResults &results, FKVelocity *fromFK, unsigned int fromFrame)

Protected Methods

double sphereSphereDist (const Sphere &from, const Sphere &to, Vector3 &fromWit, Vector3 &toWit, Vector3 &unitVec, double &dist)
double spherePlaneDist (const Sphere &from, const Plane &to, Vector3 &fromWit, Vector3 &toWit, Vector3 &unitVec, double &dist)
double cylisphereCylisphereDist (const Cylisphere &from, const Cylisphere &to, Vector3 &fromWit, Vector3 &toWit, Vector3 &unitVec, double &dist)
double cylisphereSphereDist (const Cylisphere &from, const Sphere &to, Vector3 &fromWit, Vector3 &toWit, Vector3 &unitVec, double &dist)
double cylispherePlaneDist (const Cylisphere &from, const Plane &to, Vector3 &fromWit, Vector3 &toWit, Vector3 &unitVec, double &dist, double &t1, double &t2)
bool pointPointH (Vector3 &robPt, Vector3 &obstPt, const Primitive &robPrim, const Primitive &obstPrim, DistanceResults &results, double robRadius, double obstRadius, FKAcceleration *fromFK, unsigned int robotFrameNumber)
bool linePointH (Vector3 &robPt, Vector3 &obstPt, const Primitive &robPrim, const Primitive &obstPrim, DistanceResults &results, double robRadius, double obstRadius, FKAcceleration *fromFK, unsigned int robotFrameNumber)
bool lineLineH (Vector3 &robPt, Vector3 &obstPt, const Primitive &robPrim, const Primitive &obstPrim, DistanceResults &results, double robRadius, double obstRadius, FKAcceleration *fromFK, unsigned int robotFrameNumber)
bool LinePlaneH ()

Protected Attributes

unsigned int frameNumber
Matrix tempMat
Vector3 wit0
Vector3 wit1
Vector3 dHat
Vector3 tempVec3
Vector3 secTempVec3

Detailed Description

This is an interface class for function objects which calculate the distances between objects contained in a tree of Nodes.

Author:
Ethan Swint, Andrew Spencer
Todo:


Constructor & Destructor Documentation

OSCAR::DistanceCalculator::DistanceCalculator const String   name = String(),
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor for DistanceCalculator.

Constructs an DistanceCalculator object, a function object that calculates the distances between geometric models.

Parameters:
_name If you wish to name this object, provide an argument.
err If errors were encountered during object construction, this OSCARError object will contain a description of the error, otherwise it will be 'noError'
See also:
~DistanceCalculator()

virtual OSCAR::DistanceCalculator::~DistanceCalculator   [virtual]
 


Member Function Documentation

bool OSCAR::DistanceCalculator::CalcDist const Primitive   from,
const Primitive   to,
Vector3   fromWit,
Vector3   toWit,
Vector3   unitVec,
double &    dist
 

Calculates the witnesspoints, witness direction unit vectors and distances between two Primitive objects.

Parameters:
const Primitive& from The modeling primitive that the unit vector will point away from
const Primitive& to The modeling primitive that the unit vector will point toward
Vector3& fromWit The witness point for the from primitive
Vector3& toWit The witness point for the to primitive
Vector3& unitVec The unit vector that points from the fromWit witness point to the toWit witness point.
double& dist The distance between the from and to primitives.
Returns:
True upon succesful completion, false if there is a failure (most likely the distance calculation between the to and from primitives has not been implemented. This should rarely, if ever, happen).

virtual bool OSCAR::DistanceCalculator::CalcDist const Node   from,
const Node   to,
DistanceResults   results,
bool    checkSelf = false,
const std::set< const ModelingObject * > &    ignoreSet = std::set< const ModelingObject * >()
[virtual]
 

Calculates the witness points, witness direction unit vectors and magnitudes for an arm.

Parameters:
from Node from which to calculate distances to rest of world (including branches in Node)
root Distance calculations will be performed between all objects contained in 'from' and all objects contained in 'root'
checkSelf Directive to perform distance computations for self-collision checking

bool OSCAR::DistanceCalculator::CalcGFunction const Primitive   from,
const Primitive   to,
DistanceResults   results,
FKVelocity   fromFK,
unsigned int    fromFrame
 

Calculate the G function between two primitives.

Parameters:
const Primitive& from The from primitive for which the g function is to be calculated.
const Primitive& to The to primitive for which the g function is to be calculated.
DistanceResults& results The DistanceResults object where the g function will be stored (this MUST contain distance results information for the from and to primitive specified as arguments).
FKVelocity* fromFK A pointer to an FKVelocity (or FKAcceleration because of inheritance) object for the manipulator the from primitive is attached to
unsigned int fromFrame The frame of the manipulator specified by the fromFK (base frame is frame zero, first DH frame is frame 1 and so on) which the from primitive is attached.
Returns:
True if the calculation is successful, false if there is an error (distance information for the primitive pair not conatined in the DistanceResults object)

virtual bool OSCAR::DistanceCalculator::CalcGFunctions const Node   from,
const Node   to,
DistanceResults   results,
FKVelocity   fromFK,
bool    checkSelf = false,
const std::set< const ModelingObject * > &    ignoreSet = std::set< const ModelingObject * >()
[virtual]
 

Calculates the G functions for an arm. Distances between primitives contained in to and from MUST have already been calculated (or must be included in the ignore set) or this function will fail.

Parameters:
from Node from which to calculate distances to rest of world (including branches in Node)
from G function calculations will be performed between all objects contained in 'from' and all objects contained in 'to'
to See above
checkSelf Directive to perform calculations for primitives within the arm.
ignoreSet Modeling objects (primitives and nodes) which will be ignored in calculations. This MUCH match what was given when the distance calculations were performed.
Returns:
True if all calculations were done with success, false if there was a problem (primitives sepcified in to and from did not have matching distance calculations already performed, etc)

bool OSCAR::DistanceCalculator::CalcHFunction const Primitive   from,
const Primitive   to,
DistanceResults   results,
FKVelocity   fromFK,
unsigned int    fromFrame
 

Calculate the H function between two primitives. This function is NOT complete and is not currently functional.

Parameters:
const Primitive& from The from primitive for which the h function is to be calculated.
const Primitive& to The to primitive for which the h function is to be calculated.
DistanceResults& results The DistanceResults object where the h function will be stored (this MUST contain distance results information for the from and to primitive specified as arguments).
FKAcceleration* fromFK A pointer to an FKAcceleration object for the manipulator the from primitive is attached to
unsigned int fromFrame The frame of the manipulator specified by the fromFK (base frame is frame zero, first DH frame is frame 1 and so on) which the from primitive is attached.
Returns:
True if the calculation is successful, false if there is an error (distance information for the primitive pair not conatined in the DistanceResults object)

virtual bool OSCAR::DistanceCalculator::CalcHFunctions const Node   from,
const Node   to,
DistanceResults   results,
FKAcceleration   fromFK,
bool    checkSelf = false,
const std::set< const ModelingObject * > &    ignoreSet = std::set< const ModelingObject * >()
[virtual]
 

Calculates the H functions for an arm. Distances between primitives contained in to and from MUST have already been calculated (or must be included in the ignore set) or this function will fail. This function is not completed yet, and is not functional.

Parameters:
from Node from which to calculate distances to rest of world (including branches in Node)
from H function calculations will be performed between all objects contained in 'from' and all objects contained in 'to'
to See above
checkSelf Directive to perform calculations for primitives within the arm.
ignoreSet Modeling objects (primitives and nodes) which will be ignored in calculations. This MUCH match what was given when the distance calculations were performed or there is a strong possibility that the method will fail.
Returns:
True if all calculations were done with success, false if there was a problem (primitives sepcified in to and from did not have matching distance calculations already performed, etc)

double OSCAR::DistanceCalculator::cylisphereCylisphereDist const Cylisphere   from,
const Cylisphere   to,
Vector3   fromWit,
Vector3   toWit,
Vector3   unitVec,
double &    dist
[protected]
 

double OSCAR::DistanceCalculator::cylispherePlaneDist const Cylisphere   from,
const Plane   to,
Vector3   fromWit,
Vector3   toWit,
Vector3   unitVec,
double &    dist,
double &    t1,
double &    t2
[protected]
 

double OSCAR::DistanceCalculator::cylisphereSphereDist const Cylisphere   from,
const Sphere   to,
Vector3   fromWit,
Vector3   toWit,
Vector3   unitVec,
double &    dist
[protected]
 

bool OSCAR::DistanceCalculator::lineLineH Vector3   robPt,
Vector3   obstPt,
const Primitive   robPrim,
const Primitive   obstPrim,
DistanceResults   results,
double    robRadius,
double    obstRadius,
FKAcceleration   fromFK,
unsigned int    robotFrameNumber
[protected]
 

bool OSCAR::DistanceCalculator::LinePlaneH   [protected]
 

bool OSCAR::DistanceCalculator::linePointH Vector3   robPt,
Vector3   obstPt,
const Primitive   robPrim,
const Primitive   obstPrim,
DistanceResults   results,
double    robRadius,
double    obstRadius,
FKAcceleration   fromFK,
unsigned int    robotFrameNumber
[protected]
 

bool OSCAR::DistanceCalculator::pointPointH Vector3   robPt,
Vector3   obstPt,
const Primitive   robPrim,
const Primitive   obstPrim,
DistanceResults   results,
double    robRadius,
double    obstRadius,
FKAcceleration   fromFK,
unsigned int    robotFrameNumber
[protected]
 

double OSCAR::DistanceCalculator::spherePlaneDist const Sphere   from,
const Plane   to,
Vector3   fromWit,
Vector3   toWit,
Vector3   unitVec,
double &    dist
[protected]
 

double OSCAR::DistanceCalculator::sphereSphereDist const Sphere   from,
const Sphere   to,
Vector3   fromWit,
Vector3   toWit,
Vector3   unitVec,
double &    dist
[protected]
 


Member Data Documentation

Vector3 OSCAR::DistanceCalculator::dHat [protected]
 

unsigned int OSCAR::DistanceCalculator::frameNumber [protected]
 

Vector3 OSCAR::DistanceCalculator::secTempVec3 [protected]
 

Matrix OSCAR::DistanceCalculator::tempMat [protected]
 

Vector3 OSCAR::DistanceCalculator::tempVec3 [protected]
 

Vector3 OSCAR::DistanceCalculator::wit0 [protected]
 

Vector3 OSCAR::DistanceCalculator::wit1 [protected]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations