Loading...
Searching...
No Matches
ndcurves::SO3Linear< Time, Numeric, Safe > Class Template Reference

Represents a linear interpolation in SO3, using the slerp method provided by Eigen::Quaternion. More...

#include <ndcurves/so3_linear.h>

Inheritance diagram for ndcurves::SO3Linear< Time, Numeric, Safe >:
Collaboration diagram for ndcurves::SO3Linear< Time, Numeric, Safe >:

Public Types

typedef Numeric Scalar
 
typedef matrix3_t point_t
 
typedef point3_t point_derivate_t
 
typedef Eigen::Quaternion< Scalarquaternion_t
 
typedef Time time_t
 
typedef curve_abc< Time, Numeric, Safe, point_t, point_derivate_tcurve_abc_t
 
typedef constant_curve< Time, Numeric, Safe, point_derivate_tcurve_derivate_t
 
typedef SO3Linear< Time, Numeric, SafeSO3Linear_t
 
- Public Types inherited from ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >
typedef Point point_t
 
typedef Point_derivate point_derivate_t
 
typedef Time time_t
 
typedef Numeric num_t
 
typedef curve_abc< Time, Numeric, Safe, point_t, point_derivate_tcurve_t
 
typedef curve_abc< Time, Numeric, Safe, point_derivate_tcurve_derivate_t
 
typedef std::shared_ptr< curve_tcurve_ptr_t
 

Public Member Functions

 SO3Linear ()
 Empty constructor. Curve obtained this way can not perform other class functions.
 
 SO3Linear (const quaternion_t &init_rot, const quaternion_t &end_rot, const time_t t_min, const time_t t_max)
 constructor with initial and final rotation and time bounds
 
 SO3Linear (const matrix3_t &init_rot, const matrix3_t &end_rot, const time_t t_min, const time_t t_max)
 constructor with initial and final rotation expressed as rotation matrix and time bounds
 
 SO3Linear (const quaternion_t &init_rot, const quaternion_t &end_rot)
 constructor with initial and final rotation, time bounds are set to [0;1]
 
 SO3Linear (const matrix3_t &init_rot, const matrix3_t &end_rot)
 constructor with initial and final rotation expressed as rotation matrix, time bounds are set to [0;1]
 
virtual ~SO3Linear ()
 Destructor.
 
 SO3Linear (const SO3Linear &other)
 
point3_t computeAngularVelocity (const matrix3_t &init_rot, const matrix3_t &end_rot, const double t_min, const double t_max)
 
quaternion_t computeAsQuaternion (const time_t t) const
 
virtual point_t operator() (const time_t t) const
 Evaluation of the SO3Linear at time t using Eigen slerp.
 
bool isApprox (const SO3Linear_t &other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const
 isApprox check if other and *this are approximately equals. Only two curves of the same class can be approximately equals, for comparison between different type of curves see isEquivalent
 
virtual bool isApprox (const curve_abc_t *other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision()) const
 isApprox check if other and *this are approximately equal given a precision threshold Only two curves of the same class can be approximately equal, for comparison between different type of curves see isEquivalent.
 
virtual bool operator== (const SO3Linear_t &other) const
 
virtual bool operator!= (const SO3Linear_t &other) const
 
virtual point_derivate_t derivate (const time_t t, const std::size_t order) const
 Evaluation of the derivative of order N of spline at time t.
 
curve_derivate_t compute_derivate (const std::size_t order) const
 
curve_derivate_tcompute_derivate_ptr (const std::size_t order) const
 Compute the derived curve at order N.
 
virtual std::size_t dim () const
 Get dimension of curve.
 
time_t min () const
 Get the minimum time for which the curve is defined.
 
time_t max () const
 Get the maximum time for which the curve is defined.
 
virtual std::size_t degree () const
 Get the degree of the curve.
 
matrix3_t getInitRotation () const
 
matrix3_t getEndRotation () const
 
matrix3_t getInitRotation ()
 
matrix3_t getEndRotation ()
 
template<class Archive >
void load (Archive &ar, const unsigned int version)
 
template<class Archive >
void save (Archive &ar, const unsigned int version) const
 
point3_t log3 (const matrix3_t &R)
 Log: SO3 -> so3.
 
- Public Member Functions inherited from ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >
 curve_abc ()
 Constructor.
 
virtual ~curve_abc ()
 Destructor.
 
bool isEquivalent (const curve_t *other, const Numeric prec=Eigen::NumTraits< Numeric >::dummy_precision(), const size_t order=5) const
 isEquivalent check if other and *this are approximately equal by values, given a precision threshold. This test is done by discretizing both curves and evaluating them and their derivatives.
 
std::pair< time_t, time_ttimeRange ()
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 
- Public Member Functions inherited from ndcurves::serialization::Serializable
template<class Derived >
void loadFromText (const std::string &filename)
 Loads a Derived object from a text file.
 
template<class Derived >
void saveAsText (const std::string &filename) const
 Saved a Derived object as a text file.
 
template<class Derived >
void loadFromXML (const std::string &filename, const std::string &tag_name)
 Loads a Derived object from an XML file.
 
template<class Derived >
void saveAsXML (const std::string &filename, const std::string &tag_name) const
 Saved a Derived object as an XML file.
 
template<class Derived >
void loadFromBinary (const std::string &filename)
 Loads a Derived object from an binary file.
 
template<class Derived >
void saveAsBinary (const std::string &filename) const
 Saved a Derived object as an binary file.
 

Public Attributes

std::size_t dim_
 
quaternion_t init_rot_
 
quaternion_t end_rot_
 
point3_t angular_vel_
 
time_t T_min_
 
time_t T_max_
 

Friends

class boost::serialization::access
 

Detailed Description

template<typename Time = double, typename Numeric = Time, bool Safe = false>
class ndcurves::SO3Linear< Time, Numeric, Safe >

Represents a linear interpolation in SO3, using the slerp method provided by Eigen::Quaternion.

Member Typedef Documentation

◆ curve_abc_t

template<typename Time = double, typename Numeric = Time, bool Safe = false>
typedef curve_abc<Time, Numeric, Safe, point_t, point_derivate_t> ndcurves::SO3Linear< Time, Numeric, Safe >::curve_abc_t

◆ curve_derivate_t

template<typename Time = double, typename Numeric = Time, bool Safe = false>
typedef constant_curve<Time, Numeric, Safe, point_derivate_t> ndcurves::SO3Linear< Time, Numeric, Safe >::curve_derivate_t

◆ point_derivate_t

template<typename Time = double, typename Numeric = Time, bool Safe = false>
typedef point3_t ndcurves::SO3Linear< Time, Numeric, Safe >::point_derivate_t

◆ point_t

template<typename Time = double, typename Numeric = Time, bool Safe = false>
typedef matrix3_t ndcurves::SO3Linear< Time, Numeric, Safe >::point_t

◆ quaternion_t

template<typename Time = double, typename Numeric = Time, bool Safe = false>
typedef Eigen::Quaternion<Scalar> ndcurves::SO3Linear< Time, Numeric, Safe >::quaternion_t

◆ Scalar

template<typename Time = double, typename Numeric = Time, bool Safe = false>
typedef Numeric ndcurves::SO3Linear< Time, Numeric, Safe >::Scalar

◆ SO3Linear_t

template<typename Time = double, typename Numeric = Time, bool Safe = false>
typedef SO3Linear<Time, Numeric, Safe> ndcurves::SO3Linear< Time, Numeric, Safe >::SO3Linear_t

◆ time_t

template<typename Time = double, typename Numeric = Time, bool Safe = false>
typedef Time ndcurves::SO3Linear< Time, Numeric, Safe >::time_t

Constructor & Destructor Documentation

◆ SO3Linear() [1/6]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
ndcurves::SO3Linear< Time, Numeric, Safe >::SO3Linear ( )
inline

Empty constructor. Curve obtained this way can not perform other class functions.

◆ SO3Linear() [2/6]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
ndcurves::SO3Linear< Time, Numeric, Safe >::SO3Linear ( const quaternion_t init_rot,
const quaternion_t end_rot,
const time_t  t_min,
const time_t  t_max 
)
inline

constructor with initial and final rotation and time bounds

◆ SO3Linear() [3/6]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
ndcurves::SO3Linear< Time, Numeric, Safe >::SO3Linear ( const matrix3_t init_rot,
const matrix3_t end_rot,
const time_t  t_min,
const time_t  t_max 
)
inline

constructor with initial and final rotation expressed as rotation matrix and time bounds

◆ SO3Linear() [4/6]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
ndcurves::SO3Linear< Time, Numeric, Safe >::SO3Linear ( const quaternion_t init_rot,
const quaternion_t end_rot 
)
inline

constructor with initial and final rotation, time bounds are set to [0;1]

◆ SO3Linear() [5/6]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
ndcurves::SO3Linear< Time, Numeric, Safe >::SO3Linear ( const matrix3_t init_rot,
const matrix3_t end_rot 
)
inline

constructor with initial and final rotation expressed as rotation matrix, time bounds are set to [0;1]

◆ ~SO3Linear()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
virtual ndcurves::SO3Linear< Time, Numeric, Safe >::~SO3Linear ( )
inlinevirtual

Destructor.

◆ SO3Linear() [6/6]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
ndcurves::SO3Linear< Time, Numeric, Safe >::SO3Linear ( const SO3Linear< Time, Numeric, Safe > &  other)
inline

Member Function Documentation

◆ compute_derivate()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
curve_derivate_t ndcurves::SO3Linear< Time, Numeric, Safe >::compute_derivate ( const std::size_t  order) const
inline

◆ compute_derivate_ptr()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
curve_derivate_t * ndcurves::SO3Linear< Time, Numeric, Safe >::compute_derivate_ptr ( const std::size_t  order) const
inlinevirtual

Compute the derived curve at order N.

Parameters
order: order of derivative.
Returns
A pointer to \(\frac{d^Nx(t)}{dt^N}\) derivative order N of the curve.

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ computeAngularVelocity()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
point3_t ndcurves::SO3Linear< Time, Numeric, Safe >::computeAngularVelocity ( const matrix3_t init_rot,
const matrix3_t end_rot,
const double  t_min,
const double  t_max 
)
inline

◆ computeAsQuaternion()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
quaternion_t ndcurves::SO3Linear< Time, Numeric, Safe >::computeAsQuaternion ( const time_t  t) const
inline

◆ degree()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
virtual std::size_t ndcurves::SO3Linear< Time, Numeric, Safe >::degree ( ) const
inlinevirtual

Get the degree of the curve.

Returns
\(degree\), the degree of the curve.

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ derivate()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
virtual point_derivate_t ndcurves::SO3Linear< Time, Numeric, Safe >::derivate ( const time_t  t,
const std::size_t  order 
) const
inlinevirtual

Evaluation of the derivative of order N of spline at time t.

Parameters
t: the time when to evaluate the spline.
order: order of derivative.
Returns
\(\frac{d^Nx(t)}{dt^N}\) point corresponding on derivative spline at time t.

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ dim()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
virtual std::size_t ndcurves::SO3Linear< Time, Numeric, Safe >::dim ( ) const
inlinevirtual

Get dimension of curve.

Returns
dimension of curve.

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ getEndRotation() [1/2]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
matrix3_t ndcurves::SO3Linear< Time, Numeric, Safe >::getEndRotation ( )
inline

◆ getEndRotation() [2/2]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
matrix3_t ndcurves::SO3Linear< Time, Numeric, Safe >::getEndRotation ( ) const
inline

◆ getInitRotation() [1/2]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
matrix3_t ndcurves::SO3Linear< Time, Numeric, Safe >::getInitRotation ( )
inline

◆ getInitRotation() [2/2]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
matrix3_t ndcurves::SO3Linear< Time, Numeric, Safe >::getInitRotation ( ) const
inline

◆ isApprox() [1/2]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
virtual bool ndcurves::SO3Linear< Time, Numeric, Safe >::isApprox ( const curve_abc_t other,
const Numeric  prec = Eigen::NumTraits< Numeric >::dummy_precision() 
) const
inlinevirtual

isApprox check if other and *this are approximately equal given a precision threshold Only two curves of the same class can be approximately equal, for comparison between different type of curves see isEquivalent.

Parameters
otherthe other curve to check
precthe precision threshold, default Eigen::NumTraits<Numeric>::dummy_precision()
Returns
true if the two curves are approximately equal

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ isApprox() [2/2]

template<typename Time = double, typename Numeric = Time, bool Safe = false>
bool ndcurves::SO3Linear< Time, Numeric, Safe >::isApprox ( const SO3Linear_t other,
const Numeric  prec = Eigen::NumTraits<Numeric>::dummy_precision() 
) const
inline

isApprox check if other and *this are approximately equals. Only two curves of the same class can be approximately equals, for comparison between different type of curves see isEquivalent

Parameters
otherthe other curve to check
precthe precision threshold, default Eigen::NumTraits<Numeric>::dummy_precision()
Returns
true is the two curves are approximately equals

◆ load()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
template<class Archive >
void ndcurves::SO3Linear< Time, Numeric, Safe >::load ( Archive ar,
const unsigned int  version 
)
inline

◆ log3()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
point3_t ndcurves::SO3Linear< Time, Numeric, Safe >::log3 ( const matrix3_t R)
inline

Log: SO3 -> so3.

Pseudo-inverse of log from \( SO3 -> { v \in so3, ||v|| \le pi } \).

Code from pinocchio.

Parameters
[in]Rthe rotation matrix. ///
Returns
The angular velocity vector associated to the rotation matrix.

◆ max()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
time_t ndcurves::SO3Linear< Time, Numeric, Safe >::max ( ) const
inlinevirtual

Get the maximum time for which the curve is defined.

Returns
\(t_{max}\) upper bound of time range.

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ min()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
time_t ndcurves::SO3Linear< Time, Numeric, Safe >::min ( ) const
inlinevirtual

Get the minimum time for which the curve is defined.

Returns
\(t_{min}\) lower bound of time range.

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ operator!=()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
virtual bool ndcurves::SO3Linear< Time, Numeric, Safe >::operator!= ( const SO3Linear_t other) const
inlinevirtual

◆ operator()()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
virtual point_t ndcurves::SO3Linear< Time, Numeric, Safe >::operator() ( const time_t  t) const
inlinevirtual

Evaluation of the SO3Linear at time t using Eigen slerp.

Parameters
t: time when to evaluate the spline.
Returns
\(x(t)\) point corresponding on spline at time t.

Implements ndcurves::curve_abc< Time, Numeric, Safe, Point, Point_derivate >.

◆ operator==()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
virtual bool ndcurves::SO3Linear< Time, Numeric, Safe >::operator== ( const SO3Linear_t other) const
inlinevirtual

◆ save()

template<typename Time = double, typename Numeric = Time, bool Safe = false>
template<class Archive >
void ndcurves::SO3Linear< Time, Numeric, Safe >::save ( Archive ar,
const unsigned int  version 
) const
inline

Friends And Related Symbol Documentation

◆ boost::serialization::access

template<typename Time = double, typename Numeric = Time, bool Safe = false>
friend class boost::serialization::access
friend

Member Data Documentation

◆ angular_vel_

template<typename Time = double, typename Numeric = Time, bool Safe = false>
point3_t ndcurves::SO3Linear< Time, Numeric, Safe >::angular_vel_

◆ dim_

template<typename Time = double, typename Numeric = Time, bool Safe = false>
std::size_t ndcurves::SO3Linear< Time, Numeric, Safe >::dim_

◆ end_rot_

template<typename Time = double, typename Numeric = Time, bool Safe = false>
quaternion_t ndcurves::SO3Linear< Time, Numeric, Safe >::end_rot_

◆ init_rot_

template<typename Time = double, typename Numeric = Time, bool Safe = false>
quaternion_t ndcurves::SO3Linear< Time, Numeric, Safe >::init_rot_

◆ T_max_

template<typename Time = double, typename Numeric = Time, bool Safe = false>
time_t ndcurves::SO3Linear< Time, Numeric, Safe >::T_max_

◆ T_min_

template<typename Time = double, typename Numeric = Time, bool Safe = false>
time_t ndcurves::SO3Linear< Time, Numeric, Safe >::T_min_

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