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

OSCAR::Spline Class Reference
[MotionPlanning]

An abstract class defining the base-level interface for spline curve generation. This includes the ability to set, insert, and delete the control points. More...

#include <Spline.h>

Inheritance diagram for OSCAR::Spline:

Inheritance graph
[legend]
List of all members.

Public Methods

 Spline (double stepsize, OSCARError &err=DUMMY_ERROR(noError))
 Spline (OSCARError &err=DUMMY_ERROR(noError))
 Spline (const Spline &rhs)
Spline & operator= (const Spline &rhs)
bool SetControlPoints (const std::vector< Vector3 > &ctrlPt)
bool AddControlPoint (const Vector3 &ctrlPt)
bool InsertControlPoint (const Vector3 &ctrlPt, unsigned int index)
bool DeleteControlPoint (unsigned int index)
bool ClearControlPoints ()
bool GetControlPoints (std::vector< Vector3 > &ctrlPoints)
bool GetTrajectoryPoint (unsigned int i, Vector3 &point)
unsigned int GetTrajectorySize ()
bool SetStepSize (double stepSize)
bool GetTrajectory (std::vector< Vector3 > &paraTrajectory)
virtual bool GenerateTrajectory ()=0
virtual bool GetParameterRange (double &tInitial, double &tFinal)=0
virtual bool GetCurvePoint (double t, Vector3 &curvePoint)=0
virtual ~Spline ()

Protected Attributes

double stepSize
double tStart
double tEnd
std::vector< Vector3controlPoints
std::vector< Vector3trajectory

Detailed Description

Author:
Peter S. March


Constructor & Destructor Documentation

OSCAR::Spline::Spline double    stepsize,
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor.

This constructor creates an Spline object.

Parameters:
stepsize This will be used as the stepsize for the parameter t in the blend.
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::Spline::Spline OSCARError   err = DUMMY_ERROR(noError)
 

OSCAR::Spline::Spline const Spline &    rhs
 

Copy Constructor.

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

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

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


Member Function Documentation

bool OSCAR::Spline::AddControlPoint const Vector3   ctrlPt
 

Use this method to append a single control point to the current internally stored list of control points.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
ctrlPt An Vector3 containing the x,y,z positions of the next control point.
See also:
bool SetControlPoints(const vector<Vector3>& ctrlPt)

bool OSCAR::Spline::ClearControlPoints  
 

Use this method to clear the current control points.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
ctrl An Vector3 containing the x,y,z positions of the next control point.

bool OSCAR::Spline::DeleteControlPoint unsigned int    index
 

Use this method to delete a control point at a specified index.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
index The index of the control point to be removed.

virtual bool OSCAR::Spline::GenerateTrajectory   [pure virtual]
 

Use this method to generate a trajectory from the set of control points.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information

Implemented in OSCAR::BezierCurve, OSCAR::BSpline, and OSCAR::ParabolicBlend.

bool OSCAR::Spline::GetControlPoints std::vector< Vector3 > &    ctrlPoints
 

Use this method to retrieve the current list of control points.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
ctrlPoints An STL vector of Vector3s that will contain the control points.

virtual bool OSCAR::Spline::GetCurvePoint double    t,
Vector3   curvePoint
[pure virtual]
 

This method is used to determine a specific point along the trajectory for a given value of the independent parameter.

Parameters:
t Value of the independent parameter.
curvePoint A 3x1 vector that will store the value of the curve at the provided value of the independent parameter t.
Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
See also:
GetParameterRange(double& tInitial, double& tFinal)

Implemented in OSCAR::BezierCurve, OSCAR::BSpline, and OSCAR::ParabolicBlend.

virtual bool OSCAR::Spline::GetParameterRange double &    tInitial,
double &    tFinal
[pure virtual]
 

This method is used to determine the range of the independent parameter t that will fully interpolate the provided control points.

Parameters:
tInitial This initial value of the independent parameter.
tFinal The final value of the independent parameter.
Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
See also:
virtual bool GetCurvePoint(double t, Vector3& curvePoint)

Implemented in OSCAR::BezierCurve, OSCAR::BSpline, and OSCAR::ParabolicBlend.

bool OSCAR::Spline::GetTrajectory std::vector< Vector3 > &    paraTrajectory
 

Use this method to retrieve the generated trajectory.

Parameters:
paraTrajectory An STL vector<Vector3> 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::Spline::GetTrajectoryPoint unsigned int    i,
Vector3   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 3x1 vector that will store the desired point.

unsigned int OSCAR::Spline::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.

bool OSCAR::Spline::InsertControlPoint const Vector3   ctrlPt,
unsigned int    index
 

Use this method to insert a control point at a specified index.

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
Parameters:
ctrlPt An Vector3 object containing the x,y,z coordinates of the control point to be inserted.
index The index where the new control point will be located.
See also:
bool AddControlPoint(Vector3& ctrlPt)

bool SetControlPoints(const vector<Vector3>& ctrlPt)

Spline& OSCAR::Spline::operator= const Spline &    rhs
 

Assignment operator.

This is the Assignment operator for an object of type Spline. This operator assumes that the order and DOF of the two planners are the same.

Parameters:
rhs An Spline 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::Spline::SetControlPoints const std::vector< Vector3 > &    ctrlPt
 

Use this method to set the control points from a list of points.

Parameters:
ctrlPt An STL vector object of Vector3s. This object will overwrite the current internally stored control points. To generate a parabolic blend, at least 3 control points are needed.
Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
See also:
bool AddControlPoint(Vector3& ctrlPt)

bool OSCAR::Spline::SetStepSize double    stepSize
 

Use this method to set the step size to use in trajectory generation.

Parameters:
stepSize The value of the stepsize to use for trajectory generation.
Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information


Member Data Documentation

std::vector<Vector3> OSCAR::Spline::controlPoints [protected]
 

double OSCAR::Spline::stepSize [protected]
 

double OSCAR::Spline::tEnd [protected]
 

std::vector<Vector3> OSCAR::Spline::trajectory [protected]
 

double OSCAR::Spline::tStart [protected]
 


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