RobWorkProject
23.9.11-
|
A quadratic curve. More...
#include <QuadraticCurve.hpp>
Inherits ParametricCurve.
Public Types | |
enum | Type { Elliptic , Hyperbola , Line , Parabola } |
The four possible curve types. More... | |
typedef rw::core::Ptr< QuadraticCurve > | Ptr |
Smart pointer type for QuadraticCurve. | |
typedef rw::core::Ptr< const QuadraticCurve > | CPtr |
Smart pointer type for a const QuadraticCurve. | |
typedef enum rw::geometry::QuadraticCurve::Type | Type |
The four possible curve types. | |
Public Types inherited from ParametricCurve | |
typedef rw::core::Ptr< ParametricCurve > | Ptr |
Smart pointer type for ParametricCurve. | |
typedef rw::core::Ptr< const ParametricCurve > | CPtr |
Smart pointer type for a const ParametricCurve. | |
Public Types inherited from Curve | |
typedef rw::core::Ptr< Curve > | Ptr |
Smart pointer type for Curve. | |
typedef rw::core::Ptr< const Curve > | CPtr |
Smart pointer type for a const Curve. | |
Public Member Functions | |
QuadraticCurve (const rw::math::Vector3D< double > &c, const rw::math::Vector3D< double > &u, const rw::math::Vector3D< double > &v, const Type &type) | |
Construct quadratic curve given by the expression \( \mathbf{p} = \mathbf{c} + r(t) \mathbf{u} + s(t) \mathbf{v} \), where u and v are orthogonal vectors. More... | |
virtual | ~QuadraticCurve () |
Destrcutor. | |
QuadraticCurve::Ptr | transform (const rw::math::Transform3D< double > &T) const |
Transform curve. More... | |
QuadraticCurve::Ptr | transform (const rw::math::Vector3D< double > &P) const |
Transform curve. More... | |
QuadraticCurve::Ptr | scale (double factor) const |
Get a scaled version of the curve. More... | |
QuadraticCurve::Ptr | reverse () const |
Make a curve where time variable runs in opposite direction. More... | |
QuadraticCurve::Ptr | clone () const |
Make a copy of the curve. More... | |
virtual std::pair< double, double > | extremums (const rw::math::Vector3D< double > &dir) const |
Get extremums of curve in given direction. More... | |
virtual std::list< rw::math::Vector3D< double > > | discretizeAdaptive (double stepsPerRevolution) const |
Make a discretization of the curve. More... | |
virtual OBB | obr () const |
Bounding rectangle of curve. More... | |
virtual std::vector< rw::math::Vector3D< double > > | closestPoints (const rw::math::Vector3D< double > &p) const |
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 |
Check if this curve is equal to another curve. More... | |
virtual rw::math::Vector3D< double > | x (double t) const |
Evaluate a point on the curve. More... | |
virtual rw::math::Vector3D< double > | dx (double t) const |
Evaluate the derivative in a point on the curve. More... | |
virtual rw::math::Vector3D< double > | ddx (double t) const |
Evaluate the second derivative in a point on the curve. More... | |
virtual rw::math::Vector3D< double > | operator() (double t) const |
Evaluate a point on the curve. More... | |
virtual bool | hasLimits () const |
Check if the curve is limited. More... | |
virtual const std::pair< double, double > & | limits () const |
Get the limits of the curve segment. More... | |
virtual bool | inLimits (double t) const |
Check if the parameter t is inside the limits set for the curve. More... | |
virtual void | setLimits (const std::pair< double, double > &limits) |
Set parameter limits for the curve. More... | |
virtual double | curvature (double t) const |
The curvature in a given point on the curve. More... | |
virtual std::vector< double > | closestTimes (const rw::math::Vector3D< double > &p) const |
Get the parameter values where the curve is closest to a point p. More... | |
virtual double | closestTime (const rw::math::Vector3D< double > &p) const |
Get the parameter value where the curve is closest to a point p. More... | |
const rw::math::Vector3D< double > & | c () const |
The point c. More... | |
const rw::math::Vector3D< double > & | u () const |
The vector u. More... | |
const rw::math::Vector3D< double > & | v () const |
The vector v. More... | |
Type | type () const |
Get the type of curve. More... | |
QuadraticCurve & | operator= (const QuadraticCurve &rhs) |
Public Member Functions inherited from ParametricCurve | |
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... | |
Public Member Functions inherited from Curve | |
Curve () | |
Constructor. | |
virtual | ~Curve () |
Destructor. | |
rw::core::Ptr< Curve > | transform (const rw::math::Transform3D< double > &T) const |
Transform curve. More... | |
rw::core::Ptr< Curve > | transform (const rw::math::Vector3D< double > &P) const |
Transform curve. More... | |
rw::core::Ptr< Curve > | scale (double factor) const |
Get a scaled version of the curve. More... | |
rw::core::Ptr< Curve > | reverse () const |
Make a curve where time variable runs in opposite direction. More... | |
rw::core::Ptr< Curve > | clone () const |
Make a copy of the curve. More... | |
A quadratic curve.
A quadratic curve is given explicitly by the expression \( \mathbf{p} = \mathbf{c} + r(t) \mathbf{u} + s(t) \mathbf{v} \) where \( \mathbf{c},\mathbf{u},\mathbf{v},\mathbf{p} \in \mathbb{R}^3 \) and \( \mathbf{u}^T \mathbf{v} = 0\) .
The following four types of curves are possible:
enum Type |
The four possible curve types.
Enumerator | |
---|---|
Elliptic | Ellipse \( \mathbf{p} = \mathbf{c} + \mathbf{u} \sin t + \mathbf{v} < \cos t\) |
Hyperbola | Hyperbola \( \mathbf{p} = \mathbf{c} + \mathbf{u} \sinh t + < \mathbf{v} \cosh t\) |
Line | Line \( \mathbf{p} = \mathbf{c} + \mathbf{u} t\). |
Parabola | Parabola \( \mathbf{p} = \mathbf{c} + \mathbf{u} t + \mathbf{v} t^2\). |
QuadraticCurve | ( | const rw::math::Vector3D< double > & | c, |
const rw::math::Vector3D< double > & | u, | ||
const rw::math::Vector3D< double > & | v, | ||
const Type & | type | ||
) |
Construct quadratic curve given by the expression \( \mathbf{p} = \mathbf{c} + r(t) \mathbf{u} + s(t) \mathbf{v} \), where u and v are orthogonal vectors.
c | [in] offset of curve. |
u | [in] first direction. |
v | [in] second direction. |
type | [in] the type of curve. |
|
inline |
The point c.
QuadraticCurve::Ptr clone | ( | ) | const |
Make a copy of the curve.
|
virtual |
Get the closest points on the curve to a point p.
Notice that the limits are taken into account.
p | [in] the point to find closest values for. |
Implements ParametricCurve.
|
virtual |
Get the parameter value where the curve is closest to a point p.
Notice that the limits are taken into account.
p | [in] the point to find closest values for. |
Implements ParametricCurve.
|
virtual |
Get the parameter values where the curve is closest to a point p.
Notice that the limits are taken into account.
p | [in] the point to find closest values for. |
Implements ParametricCurve.
|
virtual |
The curvature in a given point on the curve.
This function does not take the limits into account.
t | [in] the parameter to evaluate the curvature for. |
Implements ParametricCurve.
|
virtual |
Evaluate the second derivative in a point on the curve.
t | [in] the parameter to find second derivative for. |
Implements ParametricCurve.
|
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.
stepsPerRevolution | [in] the number of points to sample if the curve is a perfect circle. |
Implements ParametricCurve.
|
virtual |
Evaluate the derivative in a point on the curve.
t | [in] the parameter to find derivative for. |
Implements ParametricCurve.
|
virtual |
Check if this curve is equal to another curve.
curve | [in] other curve. |
eps | [in] distance threshold. |
Implements ParametricCurve.
|
virtual |
Get extremums of curve in given direction.
Notice that the limits are taken into account.
dir | [in] direction to get extremums for. |
Implements ParametricCurve.
|
inlinevirtual |
Check if the curve is limited.
Implements ParametricCurve.
|
virtual |
Check if the parameter t is inside the limits set for the curve.
t | [in] the parameter to check. |
Implements ParametricCurve.
|
inlinevirtual |
Get the limits of the curve segment.
The returned values are only valid when hasLimits() returns true.
Implements ParametricCurve.
|
virtual |
Bounding rectangle of curve.
The curve must be limited.
Implements ParametricCurve.
|
virtual |
Evaluate a point on the curve.
t | [in] the parameter to find point for. |
Implements ParametricCurve.
QuadraticCurve::Ptr reverse | ( | ) | const |
Make a curve where time variable runs in opposite direction.
QuadraticCurve::Ptr scale | ( | double | factor | ) | const |
Get a scaled version of the curve.
factor | [in] the factor to scale with. |
|
virtual |
Set parameter limits for the curve.
limits | [in] the minimum and maximum parameter values on the curve. |
Implements ParametricCurve.
QuadraticCurve::Ptr transform | ( | const rw::math::Transform3D< double > & | T | ) | const |
Transform curve.
T | [in] transformation of curve. |
QuadraticCurve::Ptr transform | ( | const rw::math::Vector3D< double > & | P | ) | const |
Transform curve.
P | [in] positional offset. |
|
inline |
Get the type of curve.
|
inline |
The vector u.
|
inline |
The vector v.
|
virtual |
Evaluate a point on the curve.
t | [in] the parameter to find point for. |
Implements ParametricCurve.