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

OSCAR::ObAvData Class Reference
[ObstacleAvoidance]

Contains the functionality to read/write data from/to a file for obstacle avoidance. More...

#include <ObAvData.hpp>

Inheritance diagram for OSCAR::ObAvData:

Inheritance graph
[legend]
List of all members.

Public Methods

 ObAvData (const String &filename, OSCARError &err, FKPosition **fkBegin=NULL, FKPosition **fkEnd=NULL, const String &name=String())
 ObAvData (OSCARError &err, const String &name=String())
virtual ~ObAvData ()
bool UpdateArm (unsigned int index)
bool UpdateArm (unsigned int index, const Vector &jointPos)
bool UpdateAllArms ()
bool UpdateSphere (unsigned int index, Vector3 &pt, double rd)
bool UpdateCylinder (unsigned int index, Vector3 &pt1, Vector3 &pt2, double rd)
bool UpdatePlane (unsigned int index, Vector3 &bs, Vector3 &pt1, Vector3 &pt2, double th=0.0, bool bounded=false)
bool UpdateBox (unsigned int index, Vector3 &basePt, Vector3 &pt0, Vector3 &pt1, double h)
bool UpdateObstacle (SkeletalPrimitive *obstacle, const vector< Vector3 > &pts, double rd)
const vector< vector< Cylisphere > > & GetArms () const
const vector< Cylisphere > & GetCy () const
const vector< Sphere > & GetSp () const
const vector< Plane > & GetPl () const
const vector< Box > & GetBox () const
const vector< int > & GetFrames (unsigned int armIndex) const
int GetArmNum () const
int GetCyNum () const
int GetSpNum () const
int GetPlNum () const
int GetBoxNum () const
int GetTot () const
bool LoadFile (const String &file, FKPosition **fkBegin=NULL, FKPosition **fkEnd=NULL)
virtual void PrintOn (std::ostream &out) const
bool AddBox (Box &newbox)

Private Methods

bool loadRev1File (std::ifstream &input_file, FKPosition **fkBegin=NULL, FKPosition **fkEnd=NULL)
bool loadRev2File (std::istringstream &fileStream, std::string &buffer, OSCARError &err)
 ObAvData (const ObAvData &dd)
ObAvData & operator= (const ObAvData &dd)

Private Attributes

vector< FKPosition * > fk
char mark
int totCyls
vector< vector< int > > frames
vector< vector< Vector3 > > offsets
vector< vector< Cylisphere > > arms
vector< Cylispherecy
vector< Spheresp
vector< Planepl
vector< Boxbox
vector< Node * > enviornment
vector< Node * > arms2

Detailed Description

This is used to read obstacle avoidance data files and to store the modeling information they contain. It is usually not instantiated directly, but created and stored in a Work Cell object.

Todo:
  1. Move fk and UpdateArm computation to WorkCell . ObAvData should only be for data storage.
Author:
Troy Harden, Ethan Swint


Constructor & Destructor Documentation

OSCAR::ObAvData::ObAvData const String   filename,
OSCARError   err,
FKPosition **    fkBegin = NULL,
FKPosition **    fkEnd = NULL,
const String   name = String()
 

Constructor.

The FKPosition array can be specified in two ways: one is by fkBegin to point to a NULL-terminated array of FKPosition pointers, the other is for fkBegin to point to an array of FKPosition pointers and fkEnd to point to an element in the array that is one past the end of the array, as with STL containers.

Parameters:
filename The name of the obstacle avoidance data file to be read.
err Used for error handling. Defaults to noError. If the default is used, no error information can be obtained.
fkBegin Pointer to start of an array of FKPosition pointers, NULL by default
fkEnd Pointer to one past the end of an array of FKPosition pointers, NULL by default
name Used to name the object. Defaults to a blank (" ") string.

OSCAR::ObAvData::ObAvData OSCARError   err,
const String   name = String()
 

Constructor.

Parameters:
err An error object used for error handling. Defaults to noError.
name Used to name the object. Defaults to a blank string.

virtual OSCAR::ObAvData::~ObAvData   [virtual]
 

Destructor.

OSCAR::ObAvData::ObAvData const ObAvData &    dd [private]
 

Copy Constructor This function is declared and not defined to disable copy construction.


Member Function Documentation

bool OSCAR::ObAvData::AddBox Box   newbox
 

int OSCAR::ObAvData::GetArmNum   const
 

Get the number of arms in the workspace model.

Returns:
Number of arms in workspace.

const vector<vector<Cylisphere> >& OSCAR::ObAvData::GetArms   const
 

Get pointer to arm models. Use to access arm models.

Returns:
Array of arm model pointers.

const vector<Box>& OSCAR::ObAvData::GetBox   const
 

Get pointer to box obstacle models Use to access box obstacles.

Returns:
Box obstacle array.

int OSCAR::ObAvData::GetBoxNum   const
 

Get the number of box obstacles in the workspace model.

Returns:
Number of box obstacles in the workspace

const vector<Cylisphere>& OSCAR::ObAvData::GetCy   const
 

Get pointer to cylispherical obstacle models. Use to access cylispherical obstacles.

Returns:
Cylispherical obstacle array.

int OSCAR::ObAvData::GetCyNum   const
 

Get the number of cylispherical obstacles in the workspace model.

Returns:
Number of cylispherical obstacles in the workspace.

const vector<int>& OSCAR::ObAvData::GetFrames unsigned int    armIndex const
 

Get pointer to array specifying arm model DH frames. Use to access DH frame numbers of the frames to which cylispheres used to model arms are attached. The array should have as many elements as there are cylispheres used to model the specified arm. The frames are numbered from 0 (i.e. if a cylisphere is attached to frame 1 the corresponding array entry will be 0).

Returns:
Pointer to frame # array.
Parameters:
armIndex Index of arm model to access.

const vector<Plane>& OSCAR::ObAvData::GetPl   const
 

Get pointer to array specifying arm model DH frames. Use to access DH frame numbers of the frames to which cylispheres used to model arms are attached. The array should have as many elements as there are cylispheres used to model the specified arm. The frames are numbered from 0 (i.e. if a cylisphere is attached to frame 1 the corresponding array entry will be 0).

Returns:
Pointer to frame # array.
Parameters:
armNum Index of arm model to access.

int OSCAR::ObAvData::GetPlNum   const
 

Get the number of planar obstacles in the workspace model.

Returns:
Number of planar obstacles in the workspace.

const vector<Sphere>& OSCAR::ObAvData::GetSp   const
 

Get pointer to spherical obstacle models. Use to access spherical obstacles.

Returns:
Spherical obstacle array.

int OSCAR::ObAvData::GetSpNum   const
 

Get the number of spherical obstacles in the workspace model.

Returns:
Nnumber of spherical obstacles in the workspace.

int OSCAR::ObAvData::GetTot   const
 

Get the total number of cylispheres used in all the arms in the workspace.

Returns:
Total number of cylispheres used in arm modeling.

bool OSCAR::ObAvData::LoadFile const String   file,
FKPosition **    fkBegin = NULL,
FKPosition **    fkEnd = NULL
 

Load a description of the robot and environment into the work cell.

Parameters:
file Name of the file that contains the environment data
fkBegin Pointer to start of array of FKPosition objects
fkEnd Pointer to one past the end of an array of KFPosition objects, NULL by default
Returns:
true - success, false - call GetError() to learn reason of failure

bool OSCAR::ObAvData::loadRev1File std::ifstream &    input_file,
FKPosition **    fkBegin = NULL,
FKPosition **    fkEnd = NULL
[private]
 

bool OSCAR::ObAvData::loadRev2File std::istringstream &    fileStream,
std::string &    buffer,
OSCARError   err
[private]
 

ObAvData& OSCAR::ObAvData::operator= const ObAvData &    dd [private]
 

Deep Copy operator This function is declared and not defined to disable deep copy (i.e. x = y) of one ObAvData object to another.

virtual void OSCAR::ObAvData::PrintOn std::ostream &    out const [virtual]
 

bool OSCAR::ObAvData::UpdateAllArms  
 

Update the location of all arm models. Updates the location of all the arms modeled based on the last location set in the internal forward kinematics.

Returns:
true

bool OSCAR::ObAvData::UpdateArm unsigned int    index,
const Vector   jointPos
 

Update the location of the give arm with the provided joint angles Updates the location of the arm # specified after updating the location of the arm in the internal forward kinematics using fkSol.

Returns:
true
Parameters:
index Index of arm model to update
jointPos The joint angles desired for the specified arm, in radians.

bool OSCAR::ObAvData::UpdateArm unsigned int    index
 

Update the location of the give arm Updates the location of the arm # specified based on the last location set in the internal forward kinematics.

Returns:
true
Parameters:
index Index of arm model to update.

bool OSCAR::ObAvData::UpdateBox unsigned int    index,
Vector3   basePt,
Vector3   pt0,
Vector3   pt1,
double    h
 

Update the location of the given box. Updates the location and size of the box ostacle specified.

Returns:
true - successful
Parameters:
index Index of box to update
basePt The base corner point of the box, in world coordinates.
pt0 First corner point of the box, in world coordinates.
pt1 Second corner point of the box, in world coordinates
h Height of the box

bool OSCAR::ObAvData::UpdateCylinder unsigned int    index,
Vector3   pt1,
Vector3   pt2,
double    rd
 

Update the location of the give cylisphere. Updates the location and size of the cylispherical obstacle specified.

Returns:
true - successful
Parameters:
index Index of cylisphere to update
pt1 First endpoint of cylisphere, world coordinates.
pt2 Second endpoint of cylisphere, world coordinates.
rd Radius of cylisphere.

bool OSCAR::ObAvData::UpdateObstacle SkeletalPrimitive   obstacle,
const vector< Vector3 > &    pts,
double    rd
 

Update the location of the given obstacle Updates the size and location of the specified obstacle

Returns:
true - successful, false-failed
Parameters:
obstacle A poi nter to the updating obstacle
pts A vector of cartesian points that define the new position of the obstacle
rd The radius/half thickness of the primitive

bool OSCAR::ObAvData::UpdatePlane unsigned int    index,
Vector3   bs,
Vector3   pt1,
Vector3   pt2,
double    th = 0.0,
bool    bounded = false
 

Update the location of the give plane. Updates the location and size of the plane obstacle specified.

Returns:
true - successful
Parameters:
index Index of plane to update.
bs The base corner point of the plane, world coordinates.
pt1 Pt1 corner point of the plane, world coordinates.
pt2 Pt2 corner point of the plane, world coordinates.
th Half thickness of the plane. Defaults to 0.0.
bounded Specify halfspace (0) or quadrilateral (1). Defaults to 0.

bool OSCAR::ObAvData::UpdateSphere unsigned int    index,
Vector3   pt,
double    rd
 

Update the location of the give sphere. Updates the location and size of the spherical obstacle specified.

Returns:
true - successful
Parameters:
index Index of sphere to update
pt Center point of sphere, world coordinates.
rd Radius of sphere.


Member Data Documentation

vector<vector<Cylisphere> > OSCAR::ObAvData::arms [private]
 

vector<Node*> OSCAR::ObAvData::arms2 [private]
 

vector<Box> OSCAR::ObAvData::box [private]
 

vector<Cylisphere> OSCAR::ObAvData::cy [private]
 

vector<Node*> OSCAR::ObAvData::enviornment [private]
 

vector<FKPosition*> OSCAR::ObAvData::fk [private]
 

vector<vector<int> > OSCAR::ObAvData::frames [private]
 

char OSCAR::ObAvData::mark [private]
 

vector<vector<Vector3> > OSCAR::ObAvData::offsets [private]
 

vector<Plane> OSCAR::ObAvData::pl [private]
 

vector<Sphere> OSCAR::ObAvData::sp [private]
 

int OSCAR::ObAvData::totCyls [private]
 


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