Crocoddyl
Loading...
Searching...
No Matches
GuidanceModelSmoothSaturationTpl< _Scalar > Class Template Reference

Direction-preserving, smoothly bounded guidance model. More...

#include <smooth-saturation.hpp>

Inheritance diagram for GuidanceModelSmoothSaturationTpl< _Scalar >:
GuidanceModelAbstractTpl< _Scalar >GuidanceModelBase

Public Types

typedef GuidanceModelAbstractTpl< Scalar > Base
typedef GuidanceDataSmoothSaturationTpl< Scalar > Data
typedef Base::GuidanceDataAbstract GuidanceDataAbstract
typedef MathBaseTpl< Scalar > MathBase
typedef MathBase::MatrixXs MatrixXs
typedef MathBase::VectorXs VectorXs
Public Types inherited from GuidanceModelAbstractTpl< _Scalar >
typedef GuidanceDataAbstractTpl< Scalar > GuidanceDataAbstract
typedef MathBaseTpl< Scalar > MathBase
typedef MathBase::MatrixXs MatrixXs
typedef MathBase::VectorXs VectorXs

Public Member Functions

 GuidanceModelSmoothSaturationTpl (const std::size_t nr, const Scalar &gain, const Scalar &max_rate, const Scalar epsilon=Scalar(1e-6))
 Initialize the smoothly saturated guidance model.
virtual void calc (const std::shared_ptr< GuidanceDataAbstract > &data, const Eigen::Ref< const VectorXs > &error) const override
 Compute the smooth-saturation guidance output.
virtual void calcDiff (const std::shared_ptr< GuidanceDataAbstract > &data, const Eigen::Ref< const VectorXs > &error) const override
 Compute the Jacobian of the smooth-saturation law.
template<typename NewScalar>
GuidanceModelSmoothSaturationTpl< NewScalar > cast () const
 Cast the guidance model to a different scalar type.
virtual std::shared_ptr< GuidanceDataAbstract > createData () const override
 Allocate the cached guidance data.
const Scalar & get_epsilon () const
 Return the smoothing parameter.
const Scalar & get_gain () const
 Return the local linear gain.
const Scalar & get_max_rate () const
 Return the maximum desired-rate norm.
virtual void print (std::ostream &os) const override
 Print the model parameters.
void set_epsilon (const Scalar &epsilon)
 Update the smoothing parameter.
void set_gain (const Scalar &gain)
 Update the local linear gain.
void set_max_rate (const Scalar &max_rate)
 Update the maximum desired-rate norm.
Public Member Functions inherited from GuidanceModelAbstractTpl< _Scalar >
 GuidanceModelAbstractTpl (const std::size_t nr)
 Initialize the guidance-model dimension.
std::size_t get_nr () const
 Return the error and desired-rate dimension.

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
Public Attributes inherited from GuidanceModelAbstractTpl< _Scalar >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Additional Inherited Members

Protected Member Functions inherited from GuidanceModelAbstractTpl< _Scalar >
void checkErrorDimension (const Eigen::Ref< const VectorXs > &error) const
void checkJacobianDimension (const Eigen::Ref< const MatrixXs > &Ge) const
void checkRateDimension (const Eigen::Ref< const VectorXs > &g) const
Protected Attributes inherited from GuidanceModelAbstractTpl< _Scalar >
std::size_t nr_

Detailed Description

template<typename _Scalar>
class crocoddyl::GuidanceModelSmoothSaturationTpl< _Scalar >

Direction-preserving, smoothly bounded guidance model.

This law is intended for Euclidean tasks with homogeneous units and implements the smooth saturation law

\‍[  g(e) =
  -v_{\max}\tanh\left(\frac{k r_\epsilon}{v_{\max}}\right)
  \frac{e}{r_\epsilon}, \qquad
  r_\epsilon = \sqrt{e^\top e + \epsilon^2}.
\‍]

It is smooth at the origin, approaches $-k e$ locally for a sufficiently small $\epsilon$, preserves direction, and bounds the desired-rate norm.

Definition at line 34 of file smooth-saturation.hpp.

Member Typedef Documentation

◆ Base

template<typename _Scalar>
typedef GuidanceModelAbstractTpl<Scalar> Base

Definition at line 41 of file smooth-saturation.hpp.

◆ GuidanceDataAbstract

template<typename _Scalar>
typedef Base::GuidanceDataAbstract GuidanceDataAbstract

Definition at line 42 of file smooth-saturation.hpp.

◆ Data

template<typename _Scalar>
typedef GuidanceDataSmoothSaturationTpl<Scalar> Data

Definition at line 43 of file smooth-saturation.hpp.

◆ MathBase

template<typename _Scalar>
typedef MathBaseTpl<Scalar> MathBase

Definition at line 44 of file smooth-saturation.hpp.

◆ VectorXs

template<typename _Scalar>
typedef MathBase::VectorXs VectorXs

Definition at line 45 of file smooth-saturation.hpp.

◆ MatrixXs

template<typename _Scalar>
typedef MathBase::MatrixXs MatrixXs

Definition at line 46 of file smooth-saturation.hpp.

Constructor & Destructor Documentation

◆ GuidanceModelSmoothSaturationTpl()

template<typename _Scalar>
GuidanceModelSmoothSaturationTpl(const std::size_tnr,
const Scalar &gain,
const Scalar &max_rate,
const Scalarepsilon = Scalar(1e-6) )

Initialize the smoothly saturated guidance model.

Parameters
[in]nrTask dimension.
[in]gainLocal linear gain $k$.
[in]max_rateMaximum desired-rate norm $v_{\max}$.
[in]epsilonSmoothing parameter $\epsilon > 0$.

Member Function Documentation

◆ calc()

template<typename _Scalar>
virtual void calc(const std::shared_ptr< GuidanceDataAbstract > &data,
const Eigen::Ref< const VectorXs > &error ) const
overridevirtual

Compute the smooth-saturation guidance output.

Parameters
[in,out]dataPreallocated guidance data.
[in]errorTask error $e$.

Implements GuidanceModelAbstractTpl< _Scalar >.

◆ calcDiff()

template<typename _Scalar>
virtual void calcDiff(const std::shared_ptr< GuidanceDataAbstract > &data,
const Eigen::Ref< const VectorXs > &error ) const
overridevirtual

Compute the Jacobian of the smooth-saturation law.

Parameters
[in,out]dataPreallocated guidance data.
[in]errorTask error $e$.

Implements GuidanceModelAbstractTpl< _Scalar >.

◆ createData()

template<typename _Scalar>
virtual std::shared_ptr< GuidanceDataAbstract > createData()const
overridevirtual

Allocate the cached guidance data.

Returns
Data object storing $r_\epsilon$, the output scale, and the cached saturation values.

Reimplemented from GuidanceModelAbstractTpl< _Scalar >.

◆ get_gain()

template<typename _Scalar>
const Scalar & get_gain()const

Return the local linear gain.

Returns
The gain $k$.

◆ get_max_rate()

template<typename _Scalar>
const Scalar & get_max_rate()const

Return the maximum desired-rate norm.

Returns
The saturation bound $v_{\max}$.

◆ get_epsilon()

template<typename _Scalar>
const Scalar & get_epsilon()const

Return the smoothing parameter.

Returns
The smoothing value $\epsilon$.

◆ set_gain()

template<typename _Scalar>
void set_gain(const Scalar &gain)

Update the local linear gain.

Parameters
[in]gainNew local linear gain $k \ge 0$.

◆ set_max_rate()

template<typename _Scalar>
void set_max_rate(const Scalar &max_rate)

Update the maximum desired-rate norm.

Parameters
[in]max_rateNew saturation bound $v_{\max} > 0$.

◆ set_epsilon()

template<typename _Scalar>
void set_epsilon(const Scalar &epsilon)

Update the smoothing parameter.

Parameters
[in]epsilonNew smoothing value $\epsilon > 0$.

◆ print()

template<typename _Scalar>
virtual void print(std::ostream &os)const
overridevirtual

Print the model parameters.

Parameters
[out]osOutput stream.

Reimplemented from GuidanceModelAbstractTpl< _Scalar >.

Member Data Documentation

◆ Scalar

template<typename _Scalar>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Definition at line 40 of file smooth-saturation.hpp.


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