Template Class ActuationModelAbstractTpl

Inheritance Relationships

Base Type

Derived Types

Class Documentation

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

Abstract class for the actuation-mapping model.

The generalized torques \(\boldsymbol{\tau}\in\mathbb{R}^{nv}\) can by any nonlinear function of the joint-torque inputs \(\mathbf{u}\in\mathbb{R}^{nu}\), and state point \(\mathbf{x}\in\mathbb{R}^{nx}\), where nv, nu, and ndx are the number of joints, dimension of the joint torque input and state manifold, respectively. Additionally, the generalized torques are also named as the actuation signals of our system.

The main computations are carried out in calc(), and calcDiff(), where the former computes actuation signal, and the latter computes the Jacobians of the actuation-mapping function, i.e., \(\frac{\partial\boldsymbol{\tau}}{\partial\mathbf{x}}\) and \(\frac{\partial\boldsymbol{\tau}}{\partial\mathbf{u}}\). Note that calcDiff() requires to run calc() first.

Subclassed by crocoddyl::ActuationModelFloatingBaseThrustersTpl< _Scalar >, crocoddyl::ActuationModelFloatingBaseTpl< _Scalar >, crocoddyl::ActuationModelFullTpl< _Scalar >, crocoddyl::ActuationModelNumDiffTpl< _Scalar >, crocoddyl::ActuationSquashingModelTpl< _Scalar >

Public Types

typedef MathBaseTpl<Scalar> MathBase
typedef StateAbstractTpl<Scalar> StateAbstract
typedef ActuationDataAbstractTpl<Scalar> ActuationDataAbstract
typedef MathBase::VectorXs VectorXs
typedef MathBase::MatrixXs MatrixXs

Public Functions

ActuationModelAbstractTpl(std::shared_ptr<StateAbstract> state, const std::size_t nu)

Initialize the actuation model.

Parameters:
  • state[in] State description

  • nu[in] Dimension of joint-torque input

virtual ~ActuationModelAbstractTpl() = default
virtual void calc(const std::shared_ptr<ActuationDataAbstract> &data, const Eigen::Ref<const VectorXs> &x, const Eigen::Ref<const VectorXs> &u) = 0

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}\)

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) = 0

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}\)

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

Ignore the computation of the Jacobians of the actuation function.

It does not update the Jacobians of the actuation function 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 commands(const std::shared_ptr<ActuationDataAbstract> &data, const Eigen::Ref<const VectorXs> &x, const Eigen::Ref<const VectorXs> &tau) = 0

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)

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()

Create the actuation data.

Returns:

the actuation data

std::size_t get_nu() const

Return the dimension of the joint-torque input.

const std::shared_ptr<StateAbstract> &get_state() const

Return the state.

const VectorXs &get_u_lb() const

Return the actuation lower bound.

const VectorXs &get_u_ub() const

Return the actuation upper bound.

void set_u_lb(const VectorXs &u_lb)

Modify the actuation lower bounds.

void set_u_ub(const VectorXs &u_ub)

Modify the actuation upper bounds.

virtual void print(std::ostream &os) const

Print relevant information of the residual model.

Parameters:

os[out] Output stream object

Public Members

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Protected Functions

inline ActuationModelAbstractTpl()

Protected Attributes

std::size_t nu_

Dimension of joint torque inputs.

std::shared_ptr<StateAbstract> state_

Model of the state.

VectorXs u_lb_

Lower actuation limits.

VectorXs u_ub_

Upper actuation limits.

Friends

template<class Scalar>
friend std::ostream &operator<<(std::ostream &os, const ActuationModelAbstractTpl<Scalar> &model)

Print information on the actuation model.