Template Class ActuationModelNumDiffTpl

Inheritance Relationships

Base Type

Class Documentation

template<typename _Scalar>
class ActuationModelNumDiffTpl : public crocoddyl::ActuationModelAbstractTpl<_Scalar>

This class computes the numerical differentiation of an actuation model.

It computes the Jacobian of the residual model via numerical differentiation, i.e., \(\frac{\partial\boldsymbol{\tau}}{\partial\mathbf{x}}\) and \(\frac{\partial\boldsymbol{\tau}}{\partial\mathbf{u}}\) which denote the Jacobians of the actuation function \(\boldsymbol{\tau}(\mathbf{x},\mathbf{u})\).

See also

ActuationModelAbstractTpl(), calcDiff()

Public Types

typedef MathBaseTpl<Scalar> MathBase
typedef ActuationModelAbstractTpl<Scalar> Base
typedef ActuationDataNumDiffTpl<Scalar> Data
typedef ActuationDataAbstractTpl<Scalar> ActuationDataAbstract
typedef MathBase::VectorXs VectorXs
typedef MathBase::MatrixXs MatrixXs

Public Functions

explicit ActuationModelNumDiffTpl(std::shared_ptr<Base> model)

Initialize the numdiff residual model.

Parameters:

model – Actuation model that we want to apply the numerical differentiation

virtual ~ActuationModelNumDiffTpl() = default

Destroy the numdiff actuation model.

virtual void calc(const std::shared_ptr<ActuationDataAbstract> &data, const Eigen::Ref<const VectorXs> &x, const Eigen::Ref<const VectorXs> &u) override

Compute the actuation signal from the state point \(\mathbf{x}\in\mathbb{R}^{ndx}\) and joint torque inputs \(\mathbf{u}\in\mathbb{R}^{nu}\).

Parameters:
  • data[in] Actuation data

  • x[in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

  • u[in] Joint-torque input \(\mathbf{u}\in\mathbb{R}^{nu}\)

virtual void calc(const std::shared_ptr<ActuationDataAbstract> &data, const Eigen::Ref<const VectorXs> &x)

Ignore the computation of the actuation signal.

It does not update the actuation signal as this function is used in the terminal nodes of an optimal control problem.

Parameters:
  • data[in] Actuation data

  • x[in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

virtual void calcDiff(const std::shared_ptr<ActuationDataAbstract> &data, const Eigen::Ref<const VectorXs> &x, const Eigen::Ref<const VectorXs> &u) override

Compute the Jacobians of the actuation function.

Parameters:
  • data[in] Actuation data

  • x[in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

  • u[in] Joint-torque input \(\mathbf{u}\in\mathbb{R}^{nu}\)

virtual void calcDiff(const std::shared_ptr<ActuationDataAbstract> &data, const Eigen::Ref<const VectorXs> &x)
virtual void commands(const std::shared_ptr<ActuationDataAbstract> &data, const Eigen::Ref<const VectorXs> &x, const Eigen::Ref<const VectorXs> &tau) override

Compute the joint torque input from the generalized torques.

It stores the results in ActuationDataAbstractTpl::u.

Parameters:
  • data[in] Actuation data

  • x[in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

  • tau[in] Generalized torques \(\mathbf{u}\in\mathbb{R}^{nv}\)

virtual void torqueTransform(const std::shared_ptr<ActuationDataAbstract> &data, const Eigen::Ref<const VectorXs> &x, const Eigen::Ref<const VectorXs> &u) override

Compute the torque transform from generalized torques to joint torque inputs.

It stores the results in ActuationDataAbstractTpl::Mtau.

Parameters:
  • data[in] Actuation data

  • x[in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

  • tau[in] Joint-torque inputs \(\mathbf{u}\in\mathbb{R}^{nu}\)

virtual std::shared_ptr<ActuationDataAbstract> createData() override

Create the actuation data.

Returns:

the actuation data

template<typename NewScalar>
ActuationModelNumDiffTpl<NewScalar> cast() const
const std::shared_ptr<Base> &get_model() const

Return the original actuation model.

const Scalar get_disturbance() const

Return the disturbance constant used by the numerical differentiation routine.

void set_disturbance(const Scalar disturbance)

Modify the disturbance constant used by the numerical differentiation routine.

Public Members

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Protected Attributes

std::size_t nu_

Dimension of joint torque inputs.