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

This class computes the numerical differentiation of an actuation model. More...

#include <actuation.hpp>

Inheritance diagram for ActuationModelNumDiffTpl< _Scalar >:
ActuationModelAbstractTpl< _Scalar >ActuationModelBase

Public Types

typedef ActuationDataAbstractTpl< Scalar > ActuationDataAbstract
typedef ActuationModelAbstractTpl< Scalar > Base
typedef ActuationDataNumDiffTpl< Scalar > Data
typedef MathBaseTpl< Scalar > MathBase
typedef MathBase::MatrixXs MatrixXs
typedef MathBase::VectorXs VectorXs
Public Types inherited from ActuationModelAbstractTpl< _Scalar >
typedef ActuationDataAbstractTpl< Scalar > ActuationDataAbstract
typedef MathBaseTpl< Scalar > MathBase
typedef MathBase::MatrixXs MatrixXs
typedef StateAbstractTpl< Scalar > StateAbstract
typedef MathBase::VectorXs VectorXs

Public Member Functions

 ActuationModelNumDiffTpl (std::shared_ptr< Base > model)
 Initialize the numdiff residual model.
virtual ~ActuationModelNumDiffTpl ()=default
 Destroy the numdiff actuation model.
virtual void calc (const std::shared_ptr< ActuationDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
 Ignore the computation of the actuation signal.
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}$.
virtual void calcDiff (const std::shared_ptr< ActuationDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
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.
template<typename NewScalar>
ActuationModelNumDiffTpl< NewScalar > cast () const
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.
virtual std::shared_ptr< ActuationDataAbstractcreateData () override
 Create the actuation data.
const Scalar get_disturbance () const
 Return the disturbance constant used by the numerical differentiation routine.
const std::shared_ptr< Base > & get_model () const
 Return the original actuation model.
void set_disturbance (const Scalar disturbance)
 Modify the disturbance constant used by the numerical differentiation routine.
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.
Public Member Functions inherited from ActuationModelAbstractTpl< _Scalar >
 ActuationModelAbstractTpl (std::shared_ptr< StateAbstract > state, const std::size_t nu)
 Initialize the actuation model.
void calc (const std::shared_ptr< ActuationDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
 Ignore the computation of the actuation signal.
void calcDiff (const std::shared_ptr< ActuationDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
 Ignore the computation of the Jacobians of the actuation function.
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.
virtual void print (std::ostream &os) const
 Print relevant information of the residual model.

Public Attributes

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

Protected Attributes

std::size_t nu_
 Dimension of joint torque inputs.
Protected Attributes inherited from ActuationModelAbstractTpl< _Scalar >
std::size_t nu_
 Dimension of joint torque inputs.
std::shared_ptr< StateAbstractstate_
 Model of the state.

Detailed Description

template<typename _Scalar>
class crocoddyl::ActuationModelNumDiffTpl< _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()

Definition at line 31 of file actuation.hpp.

Member Typedef Documentation

◆ MathBase

template<typename _Scalar>
typedef MathBaseTpl<Scalar> MathBase

Definition at line 37 of file actuation.hpp.

◆ Base

template<typename _Scalar>
typedef ActuationModelAbstractTpl<Scalar> Base

Definition at line 38 of file actuation.hpp.

◆ Data

template<typename _Scalar>
typedef ActuationDataNumDiffTpl<Scalar> Data

Definition at line 39 of file actuation.hpp.

◆ ActuationDataAbstract

template<typename _Scalar>
typedef ActuationDataAbstractTpl<Scalar> ActuationDataAbstract

Definition at line 40 of file actuation.hpp.

◆ VectorXs

template<typename _Scalar>
typedef MathBase::VectorXs VectorXs

Definition at line 41 of file actuation.hpp.

◆ MatrixXs

template<typename _Scalar>
typedef MathBase::MatrixXs MatrixXs

Definition at line 42 of file actuation.hpp.

Constructor & Destructor Documentation

◆ ActuationModelNumDiffTpl()

template<typename _Scalar>
ActuationModelNumDiffTpl(std::shared_ptr< Base >model)
explicit

Initialize the numdiff residual model.

Parameters
modelActuation model that we want to apply the numerical differentiation

Member Function Documentation

◆ calc() [1/2]

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

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
[in]dataActuation data
[in]xState point $\mathbf{x}\in\mathbb{R}^{ndx}$
[in]uJoint-torque input $\mathbf{u}\in\mathbb{R}^{nu}$

Implements ActuationModelAbstractTpl< _Scalar >.

◆ calc() [2/2]

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

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
[in]dataActuation data
[in]xState point $\mathbf{x}\in\mathbb{R}^{ndx}$

◆ calcDiff() [1/2]

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

Compute the Jacobians of the actuation function.

Parameters
[in]dataActuation data
[in]xState point $\mathbf{x}\in\mathbb{R}^{ndx}$
[in]uJoint-torque input $\mathbf{u}\in\mathbb{R}^{nu}$

Implements ActuationModelAbstractTpl< _Scalar >.

◆ calcDiff() [2/2]

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

◆ commands()

template<typename _Scalar>
virtual void commands(const std::shared_ptr< ActuationDataAbstract > &data,
const Eigen::Ref< const VectorXs > &x,
const Eigen::Ref< const VectorXs > &tau )
overridevirtual

Compute the joint torque input from the generalized torques.

It stores the results in ActuationDataAbstractTpl::u.

Parameters
[in]dataActuation data
[in]xState point $\mathbf{x}\in\mathbb{R}^{ndx}$
[in]tauGeneralized torques $\mathbf{u}\in\mathbb{R}^{nv}$

Implements ActuationModelAbstractTpl< _Scalar >.

◆ torqueTransform()

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

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

It stores the results in ActuationDataAbstractTpl::Mtau.

Parameters
[in]dataActuation data
[in]xState point $\mathbf{x}\in\mathbb{R}^{ndx}$
[in]tauJoint-torque inputs $\mathbf{u}\in\mathbb{R}^{nu}$

Reimplemented from ActuationModelAbstractTpl< _Scalar >.

◆ createData()

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

Create the actuation data.

Returns
the actuation data

Reimplemented from ActuationModelAbstractTpl< _Scalar >.

Member Data Documentation

◆ Scalar

template<typename _Scalar>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Definition at line 36 of file actuation.hpp.

◆ nu_

template<typename _Scalar>
std::size_t nu_
protected

Dimension of joint torque inputs.

Definition at line 173 of file actuation-base.hpp.


The documentation for this class was generated from the following files:
  • /build/source/include/crocoddyl/core/fwd.hpp
  • /build/source/include/crocoddyl/core/numdiff/actuation.hpp