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

OSCAR::CubicPoly Class Reference
[MotionPlanning]

This class allows the user to create a cubic polynomial trajectory by specifying initial and final positions and accelerations. More...

#include <CubicPoly.h>

Inheritance diagram for OSCAR::CubicPoly:

Inheritance graph
[legend]
List of all members.

Public Methods

 CubicPoly (const Vector &initialPos, const Vector &finalPos, const Vector &initialVel, const Vector &finalVec, const double SampleTime, OSCARError &err=DUMMY_ERROR(noError))
 CubicPoly (const CubicPoly &rhs)
CubicPoly & operator= (const CubicPoly &rhs)
bool SetPositionConditions (const Vector &initialPos, const Vector &finalPos)
bool SetVelocityConditions (const Vector &initialVel, const Vector &finalVel)
bool GenerateTrajectory (double deltaTime)
bool GetTrajectory (std::vector< Vector > &Trajectory) const
bool GetTrajectoryPoint (unsigned int i, Vector &point)
unsigned int GetTrajectorySize ()
virtual ~CubicPoly ()

Protected Methods

void initialize ()

Protected Attributes

unsigned int dof
Vector initialPosition
Vector finalPosition
Vector initialVelocity
Vector finalVelocity
Vector a0
Vector a1
Vector a2
Vector a3
double sampleTime
std::vector< Vectortrajectory

Detailed Description

Author:
Peter S. March


Constructor & Destructor Documentation

OSCAR::CubicPoly::CubicPoly const Vector   initialPos,
const Vector   finalPos,
const Vector   initialVel,
const Vector   finalVec,
const double    SampleTime,
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor.

This constructor creates an CubicPoly object.

Parameters:
initialPos An Vector of initial positions
finalPos An Vector of final positions
initialVel An Vector of initial velocities
finalVel An Vector of final velocities
SampleTime This is the delta_time between the setpoints that will be generated in the trajectory.
err An OSCARError object that on return will hold the value of any errors that were generated during the constructor call. If err is not equal to 'noError' you can call GetError() to get the details of the error code.

OSCAR::CubicPoly::CubicPoly const CubicPoly &    rhs
 

Copy Constructor.

This is the Copy constructor for an object of type CubicPoly. Use this to construct an CubicPoly object from an existing CubicPoly object.

Parameters:
rhs An CubicPoly object that will be used to initialize this new object.

virtual OSCAR::CubicPoly::~CubicPoly   [inline, virtual]
 


Member Function Documentation

bool OSCAR::CubicPoly::GenerateTrajectory double    deltaTime
 

Use this method to generate a trajectory from supplied initial/final conditions;.

Parameters:
deltaTime The total time the trajectory should take.
Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information

bool OSCAR::CubicPoly::GetTrajectory std::vector< Vector > &    Trajectory const
 

Use this method to retrieve the generated trajectory.

Parameters:
Trajectory An STL vector<HandPose> that the trajectory will be stored in.
Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information

bool OSCAR::CubicPoly::GetTrajectoryPoint unsigned int    i,
Vector   point
 

Use this method to retrieve a specific point from the internally stored trajectory. If you provide an index which is not valid, this method will fail.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
i The index of the desired point to extract.
point A nx1 vector that will store the desired point.

unsigned int OSCAR::CubicPoly::GetTrajectorySize  
 

Use this method to retrieve the size of the internally stored trajectory. If the trajectory has not been generated, this value will be zero.

Returns:
The size of the internally stored trajectory.

void OSCAR::CubicPoly::initialize   [protected]
 

CubicPoly& OSCAR::CubicPoly::operator= const CubicPoly &    rhs
 

Assignment operator.

This is the Assignment operator for an object of type CubicPoly.

Parameters:
rhs An CubicPoly object that goes on the right hand side of the = operator.
Returns:
A reference to the object on the left hand side of the = operator.

bool OSCAR::CubicPoly::SetPositionConditions const Vector   initialPos,
const Vector   finalPos
 

Use this method to reset the initial conditions for the polynomial trajectory.

Parameters:
initialPos An Vector containing the initial positions
initialVel An Vector containing the initial velocities
Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
See also:
bool SetFinalConditions(Vector& finalPos, Vector& finalVel)

bool OSCAR::CubicPoly::SetVelocityConditions const Vector   initialVel,
const Vector   finalVel
 

Use this method to reset the finaln conditions for the polynomial trajectory.

Parameters:
finalPos An Vector containing the final positions
finalVel An Vector containing the final velocities
Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
See also:
bool SetInitialConditions(Vector& initialPos, Vector& initialVel)


Member Data Documentation

Vector OSCAR::CubicPoly::a0 [protected]
 

Vector OSCAR::CubicPoly::a1 [protected]
 

Vector OSCAR::CubicPoly::a2 [protected]
 

Vector OSCAR::CubicPoly::a3 [protected]
 

unsigned int OSCAR::CubicPoly::dof [protected]
 

Vector OSCAR::CubicPoly::finalPosition [protected]
 

Vector OSCAR::CubicPoly::finalVelocity [protected]
 

Vector OSCAR::CubicPoly::initialPosition [protected]
 

Vector OSCAR::CubicPoly::initialVelocity [protected]
 

double OSCAR::CubicPoly::sampleTime [protected]
 

std::vector<Vector> OSCAR::CubicPoly::trajectory [protected]
 


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