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

OSCAR::BSpline Class Reference
[MotionPlanning]

This class can be used to generate B-Spline curves. B-Splines are an advanced curve form that allows for the order to be set by the user instead of being defined by the number of control points. The Bezier curve is a special form of the B-Spline. More...

#include <BSpline.h>

Inheritance diagram for OSCAR::BSpline:

Inheritance graph
[legend]
List of all members.

Public Methods

 BSpline (double stepsize, OSCARError &err=DUMMY_ERROR(noError))
 BSpline (OSCARError &err=DUMMY_ERROR(noError))
 BSpline (const BSpline &rhs)
BSpline & operator= (const BSpline &rhs)
virtual bool GenerateTrajectory ()
bool SetOrder (unsigned int order)
double GetOrder ()
bool SetKnots (std::vector< double > &knots)
virtual bool GetParameterRange (double &tInitial, double &tFinal)
virtual bool GetCurvePoint (double t, Vector3 &curvePoint)
virtual ~BSpline ()

Protected Methods

double bsplineFunc (unsigned int i, unsigned int k, double t)
void calculateKnots ()

Protected Attributes

std::vector< double > knotVector
unsigned int knotSize
unsigned int order

Detailed Description

Author:
Peter S. March


Constructor & Destructor Documentation

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

Constructor.

This constructor creates an BSpline 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::BSpline::BSpline OSCARError   err = DUMMY_ERROR(noError)
 

OSCAR::BSpline::BSpline const BSpline &    rhs
 

Copy Constructor.

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

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

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


Member Function Documentation

double OSCAR::BSpline::bsplineFunc unsigned int    i,
unsigned int    k,
double    t
[protected]
 

void OSCAR::BSpline::calculateKnots   [protected]
 

virtual bool OSCAR::BSpline::GenerateTrajectory   [virtual]
 

Use this method to generate a BSpline curve from the set of control points. This method will use an Open Uniform Knot Vector (recommended) unless a different one has been set in SetKnots().

Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information
See also:
bool SetKnots(vector<double>& knots)

Implements OSCAR::Spline.

virtual bool OSCAR::BSpline::GetCurvePoint double    t,
Vector3   curvePoint
[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)

Implements OSCAR::Spline.

double OSCAR::BSpline::GetOrder  
 

Use this method to get the order of the curve.

Returns:
A double containing the current order of the curve.

virtual bool OSCAR::BSpline::GetParameterRange double &    tInitial,
double &    tFinal
[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)

Implements OSCAR::Spline.

BSpline& OSCAR::BSpline::operator= const BSpline &    rhs
 

Assignment operator.

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

Parameters:
rhs An BSpline 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::BSpline::SetKnots std::vector< double > &    knots
 

Use this method to set the Knot Vector of the system. The size of the knot vector needs to be (order+#of_control_points). Thus, if you manually set the knot vector, the order and number of control points should not be changed again. By default, an Open Uniform Knot Vector is used. This ensures that the first and last control points are interpolated and should not be changed except by advanced users.

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

bool OSCAR::BSpline::SetOrder unsigned int    order
 

Use this method to set the order of the system. If you set the order to 0, it will use the maximum order possible (order=#of_control_points).

Parameters:
order An unsigned int of the order of the curve to be generated. This Order will be used when GenerateTrajectory is called.
Returns:
true if the method succeeds and false if method fails. Call GetError() to get detailed error information


Member Data Documentation

unsigned int OSCAR::BSpline::knotSize [protected]
 

std::vector<double> OSCAR::BSpline::knotVector [protected]
 

unsigned int OSCAR::BSpline::order [protected]
 


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