RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
ParametricCurve Class Referenceabstract

Interface for parametric curves. A parametric curve, \( \mathbf{p}(t) \in \mathbb{R}^3 \), has its points given as a function of a single parameter, \( t \in \mathbb{R}\). More...

#include <ParametricCurve.hpp>

Inherits Curve.

Inherited by QuadraticCurve.

Public Types

typedef rw::core::Ptr< ParametricCurvePtr
 Smart pointer type for ParametricCurve.
 
typedef rw::core::Ptr< const ParametricCurveCPtr
 Smart pointer type for a const ParametricCurve.
 
- Public Types inherited from Curve
typedef rw::core::Ptr< CurvePtr
 Smart pointer type for Curve.
 
typedef rw::core::Ptr< const CurveCPtr
 Smart pointer type for a const Curve.
 

Public Member Functions

 ParametricCurve ()
 Constructor.
 
virtual ~ParametricCurve ()
 Destructor.
 
ParametricCurve::Ptr transform (const rw::math::Transform3D< double > &T) const
 Transform curve. More...
 
ParametricCurve::Ptr transform (const rw::math::Vector3D< double > &P) const
 Transform curve. More...
 
ParametricCurve::Ptr scale (double factor) const
 Get a scaled version of the curve. More...
 
ParametricCurve::Ptr reverse () const
 Make a curve where time variable runs in opposite direction. More...
 
ParametricCurve::Ptr clone () const
 Make a copy of the curve. More...
 
virtual std::pair< double, double > extremums (const rw::math::Vector3D< double > &dir) const =0
 Get extremums of curve in given direction. More...
 
virtual std::list< rw::math::Vector3D< double > > discretizeAdaptive (double stepsPerRevolution) const =0
 Make a discretization of the curve. More...
 
virtual OBB obr () const =0
 Bounding rectangle of curve. More...
 
virtual std::vector< rw::math::Vector3D< double > > closestPoints (const rw::math::Vector3D< double > &p) const =0
 Get the closest points on the curve to a point p. More...
 
virtual bool equals (rw::core::Ptr< const rw::geometry::Curve > curve, double eps) const =0
 Check if this curve is equal to another curve. More...
 
virtual rw::math::Vector3D< double > x (double t) const =0
 Evaluate a point on the curve. More...
 
virtual rw::math::Vector3D< double > dx (double t) const =0
 Evaluate the derivative in a point on the curve. More...
 
virtual rw::math::Vector3D< double > ddx (double t) const =0
 Evaluate the second derivative in a point on the curve. More...
 
virtual rw::math::Vector3D< double > operator() (double t) const =0
 Evaluate a point on the curve. More...
 
virtual bool hasLimits () const =0
 Check if the curve is limited. More...
 
virtual const std::pair< double, double > & limits () const =0
 Get the limits of the curve segment. More...
 
virtual bool inLimits (double t) const =0
 Check if the parameter t is inside the limits set for the curve. More...
 
virtual void setLimits (const std::pair< double, double > &limits)=0
 Set parameter limits for the curve. More...
 
virtual double curvature (double t) const =0
 The curvature in a given point on the curve. More...
 
virtual std::vector< double > closestTimes (const rw::math::Vector3D< double > &p) const =0
 Get the parameter values where the curve is closest to a point p. More...
 
virtual double closestTime (const rw::math::Vector3D< double > &p) const =0
 Get the parameter value where the curve is closest to a point p. More...
 
- Public Member Functions inherited from Curve
 Curve ()
 Constructor.
 
virtual ~Curve ()
 Destructor.
 
rw::core::Ptr< Curvetransform (const rw::math::Transform3D< double > &T) const
 Transform curve. More...
 
rw::core::Ptr< Curvetransform (const rw::math::Vector3D< double > &P) const
 Transform curve. More...
 
rw::core::Ptr< Curvescale (double factor) const
 Get a scaled version of the curve. More...
 
rw::core::Ptr< Curvereverse () const
 Make a curve where time variable runs in opposite direction. More...
 
rw::core::Ptr< Curveclone () const
 Make a copy of the curve. More...
 

Detailed Description

Interface for parametric curves. A parametric curve, \( \mathbf{p}(t) \in \mathbb{R}^3 \), has its points given as a function of a single parameter, \( t \in \mathbb{R}\).

Parametric curves have functions for evaluation of points, derivatives and curvature. A parmateric curve can be limited, and it is possible to find closest points with a given point.

Member Function Documentation

◆ clone()

ParametricCurve::Ptr clone ( ) const
inline

Make a copy of the curve.

Returns
a new copy of the curve.

◆ closestPoints()

virtual std::vector<rw::math::Vector3D<double> > closestPoints ( const rw::math::Vector3D< double > &  p) const
pure virtual

Get the closest points on the curve to a point p.

Notice that the limits are taken into account.

Parameters
p[in] the point to find closest values for.
Returns
a vector of closest points to p.

Implements Curve.

Implemented in QuadraticCurve.

◆ closestTime()

virtual double closestTime ( const rw::math::Vector3D< double > &  p) const
pure virtual

Get the parameter value where the curve is closest to a point p.

Notice that the limits are taken into account.

Parameters
p[in] the point to find closest values for.
Returns
the point on the curve closest to p. If multiple points are equally close to p, only one of those points are returned.

Implemented in QuadraticCurve.

◆ closestTimes()

virtual std::vector<double> closestTimes ( const rw::math::Vector3D< double > &  p) const
pure virtual

Get the parameter values where the curve is closest to a point p.

Notice that the limits are taken into account.

Parameters
p[in] the point to find closest values for.
Returns
a list of parameter values.

Implemented in QuadraticCurve.

◆ curvature()

virtual double curvature ( double  t) const
pure virtual

The curvature in a given point on the curve.

This function does not take the limits into account.

Parameters
t[in] the parameter to evaluate the curvature for.
Returns
the curvature.

Implemented in QuadraticCurve.

◆ ddx()

virtual rw::math::Vector3D<double> ddx ( double  t) const
pure virtual

Evaluate the second derivative in a point on the curve.

Parameters
t[in] the parameter to find second derivative for.
Returns
a second derivative vector \( p \in \mathbb{R}^3 \) .

Implemented in QuadraticCurve.

◆ discretizeAdaptive()

virtual std::list<rw::math::Vector3D<double> > discretizeAdaptive ( double  stepsPerRevolution) const
pure virtual

Make a discretization of the curve.

The curve must be limited. The discretization is based on the curvature, such that the sampling starts at maximum curvature points (or in limits). The step size to the next point is based on the curvature in the current point.

A line will always give to points, regardless of the chosen number of steps per revolution.

Parameters
stepsPerRevolution[in] the number of points to sample if the curve is a perfect circle.
Returns
a list of points on the curve.

Implements Curve.

Implemented in QuadraticCurve.

◆ dx()

virtual rw::math::Vector3D<double> dx ( double  t) const
pure virtual

Evaluate the derivative in a point on the curve.

Parameters
t[in] the parameter to find derivative for.
Returns
a derivative vector \( p \in \mathbb{R}^3 \) .

Implemented in QuadraticCurve.

◆ equals()

virtual bool equals ( rw::core::Ptr< const rw::geometry::Curve curve,
double  eps 
) const
pure virtual

Check if this curve is equal to another curve.

Parameters
curve[in] other curve.
eps[in] distance threshold.
Returns
true if curves are identical, false otherwise.

Implements Curve.

Implemented in QuadraticCurve.

◆ extremums()

virtual std::pair<double, double> extremums ( const rw::math::Vector3D< double > &  dir) const
pure virtual

Get extremums of curve in given direction.

Notice that the limits are taken into account.

Parameters
dir[in] direction to get extremums for.
Returns
the minimum and maximum value of the curve in the given direction.

Implements Curve.

Implemented in QuadraticCurve.

◆ hasLimits()

virtual bool hasLimits ( ) const
pure virtual

Check if the curve is limited.

Returns
true if curve is limited, false otherwise.

Implemented in QuadraticCurve.

◆ inLimits()

virtual bool inLimits ( double  t) const
pure virtual

Check if the parameter t is inside the limits set for the curve.

Parameters
t[in] the parameter to check.
Returns
true if inside limits, false otherwise.

Implemented in QuadraticCurve.

◆ limits()

virtual const std::pair<double, double>& limits ( ) const
pure virtual

Get the limits of the curve segment.

The returned values are only valid when hasLimits() returns true.

Returns
the minimum and maximum parameter values on the curve.

Implemented in QuadraticCurve.

◆ obr()

virtual OBB obr ( ) const
pure virtual

Bounding rectangle of curve.

The curve must be limited.

Returns
the bounding rectangle.

Implements Curve.

Implemented in QuadraticCurve.

◆ operator()()

virtual rw::math::Vector3D<double> operator() ( double  t) const
pure virtual

Evaluate a point on the curve.

Parameters
t[in] the parameter to find point for.
Returns
the vector \( p \in \mathbb{R}^3 \) .

Implemented in QuadraticCurve.

◆ reverse()

ParametricCurve::Ptr reverse ( ) const
inline

Make a curve where time variable runs in opposite direction.

Returns
reversed curve.

◆ scale()

ParametricCurve::Ptr scale ( double  factor) const
inline

Get a scaled version of the curve.

Parameters
factor[in] the factor to scale with.
Returns
a new scaled curve.

◆ setLimits()

virtual void setLimits ( const std::pair< double, double > &  limits)
pure virtual

Set parameter limits for the curve.

Parameters
limits[in] the minimum and maximum parameter values on the curve.

Implemented in QuadraticCurve.

◆ transform() [1/2]

ParametricCurve::Ptr transform ( const rw::math::Transform3D< double > &  T) const
inline

Transform curve.

Parameters
T[in] transformation of curve.
Returns
a new transformed curve.

◆ transform() [2/2]

ParametricCurve::Ptr transform ( const rw::math::Vector3D< double > &  P) const
inline

Transform curve.

Parameters
P[in] positional offset.
Returns
a new transformed curve.

◆ x()

virtual rw::math::Vector3D<double> x ( double  t) const
pure virtual

Evaluate a point on the curve.

Parameters
t[in] the parameter to find point for.
Returns
the vector \( p \in \mathbb{R}^3 \) .

Implemented in QuadraticCurve.


The documentation for this class was generated from the following file: