crocoddyl  1.9.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
ControlParametrizationModelAbstractTpl< _Scalar > Class Template Referenceabstract

Abstract class for the control trajectory parametrization. More...

#include <crocoddyl/core/control-base.hpp>

Inheritance diagram for ControlParametrizationModelAbstractTpl< _Scalar >:

Public Types

typedef ControlParametrizationDataAbstractTpl< Scalar > ControlParametrizationDataAbstract
 
typedef MathBaseTpl< Scalar > MathBase
 
typedef MathBase::MatrixXs MatrixXs
 
typedef MathBase::VectorXs VectorXs
 

Public Member Functions

 ControlParametrizationModelAbstractTpl (const std::size_t nw, const std::size_t nu)
 Initialize the control dimensions. More...
 
virtual void calc (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Scalar t, const Eigen::Ref< const VectorXs > &u) const =0
 Get the value of the control at the specified time. More...
 
virtual void calcDiff (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Scalar t, const Eigen::Ref< const VectorXs > &u) const =0
 Get the value of the Jacobian of the control with respect to the parameters. More...
 
virtual bool checkData (const boost::shared_ptr< ControlParametrizationDataAbstract > &data)
 Checks that a specific data belongs to this model.
 
virtual void convertBounds (const Eigen::Ref< const VectorXs > &w_lb, const Eigen::Ref< const VectorXs > &w_ub, Eigen::Ref< VectorXs > u_lb, Eigen::Ref< VectorXs > u_ub) const =0
 Convert the bounds on the control inputs w to bounds on the control parameters u. More...
 
virtual boost::shared_ptr< ControlParametrizationDataAbstractcreateData ()
 Create the control-parametrization data. More...
 
std::size_t get_nu () const
 Return the dimension of control parameters.
 
std::size_t get_nw () const
 Return the dimension of the control inputs.
 
virtual void multiplyByJacobian (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Eigen::Ref< const MatrixXs > &A, Eigen::Ref< MatrixXs > out, const AssignmentOp=setto) const =0
 Compute the product between the given matrix A and the derivative of the control input with respect to the control parameters (i.e., A*dw_du). More...
 
virtual MatrixXs multiplyByJacobian_J (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Eigen::Ref< const MatrixXs > &A, const AssignmentOp=setto) const
 
virtual void multiplyJacobianTransposeBy (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Eigen::Ref< const MatrixXs > &A, Eigen::Ref< MatrixXs > out, const AssignmentOp=setto) const =0
 Compute the product between the transpose of the derivative of the control input with respect to the control parameters and a given matrix A (i.e., dw_du^T*A) More...
 
virtual MatrixXs multiplyJacobianTransposeBy_J (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Eigen::Ref< const MatrixXs > &A, const AssignmentOp=setto) const
 
virtual void params (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Scalar t, const Eigen::Ref< const VectorXs > &w) const =0
 Update the control parameters u for a specified time t given the control input w. More...
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
 

Protected Attributes

std::size_t nu_
 Control parameters dimension.
 
std::size_t nw_
 Control dimension.
 

Detailed Description

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

Abstract class for the control trajectory parametrization.

The control trajectory is a function of the (normalized) time. Normalized time is between 0 and 1, where 0 represents the beginning of the time step, and 1 represents its end. The trajectory depends on the control parameters u, whose size may be larger than the size of the control inputs w.

The main computations are carrying out in calc, multiplyByJacobian and multiplyJacobianTransposeBy, where the former computes control input \(\mathbf{w}\in\mathbb{R}^{nw}\) from a set of control parameters \(\mathbf{u}\in\mathbb{R}^{nu}\) where nw and nu represent the dimension of the control inputs and parameters, respectively, and the latter defines useful operations across the Jacobian of the control-parametrization model. Finally, params allows us to obtain the control parameters from a the control input, i.e., it is the dual of calc. Note that multiplyByJacobian and multiplyJacobianTransposeBy requires to run calc first.

See also
calc(), calcDiff(), createData(), params, multiplyByJacobian, multiplyJacobianTransposeBy

Definition at line 40 of file control-base.hpp.

Constructor & Destructor Documentation

◆ ControlParametrizationModelAbstractTpl()

ControlParametrizationModelAbstractTpl ( const std::size_t  nw,
const std::size_t  nu 
)

Initialize the control dimensions.

Parameters
[in]nwDimension of control inputs
[in]nuDimension of control parameters

Member Function Documentation

◆ calc()

virtual void calc ( const boost::shared_ptr< ControlParametrizationDataAbstract > &  data,
const Scalar  t,
const Eigen::Ref< const VectorXs > &  u 
) const
pure virtual

Get the value of the control at the specified time.

Parameters
[in]dataData structure containing the control vector to write
[in]tTime in [0,1]
[in]uControl parameters

◆ calcDiff()

virtual void calcDiff ( const boost::shared_ptr< ControlParametrizationDataAbstract > &  data,
const Scalar  t,
const Eigen::Ref< const VectorXs > &  u 
) const
pure virtual

Get the value of the Jacobian of the control with respect to the parameters.

It assumes that calc() has been run first

Parameters
[in]dataControl-parametrization data
[in]tTime in [0,1]
[in]uControl parameters

◆ createData()

virtual boost::shared_ptr<ControlParametrizationDataAbstract> createData ( )
virtual

Create the control-parametrization data.

Returns
the control-parametrization data

Reimplemented in ControlParametrizationModelPolyTwoRKTpl< _Scalar >, ControlParametrizationModelPolyOneTpl< _Scalar >, and ControlParametrizationModelPolyZeroTpl< _Scalar >.

◆ params()

virtual void params ( const boost::shared_ptr< ControlParametrizationDataAbstract > &  data,
const Scalar  t,
const Eigen::Ref< const VectorXs > &  w 
) const
pure virtual

Update the control parameters u for a specified time t given the control input w.

Parameters
[in]dataControl-parametrization data
[in]tTime in [0,1]
[in]wControl inputs

◆ convertBounds()

virtual void convertBounds ( const Eigen::Ref< const VectorXs > &  w_lb,
const Eigen::Ref< const VectorXs > &  w_ub,
Eigen::Ref< VectorXs >  u_lb,
Eigen::Ref< VectorXs >  u_ub 
) const
pure virtual

Convert the bounds on the control inputs w to bounds on the control parameters u.

Parameters
[in]w_lbControl lower bound
[in]w_ubControl lower bound
[out]u_lbControl parameters lower bound
[out]u_ubControl parameters upper bound

Implemented in ControlParametrizationModelPolyTwoRKTpl< _Scalar >, ControlParametrizationModelPolyOneTpl< _Scalar >, and ControlParametrizationModelPolyZeroTpl< _Scalar >.

◆ multiplyByJacobian()

virtual void multiplyByJacobian ( const boost::shared_ptr< ControlParametrizationDataAbstract > &  data,
const Eigen::Ref< const MatrixXs > &  A,
Eigen::Ref< MatrixXs >  out,
const  AssignmentOp = setto 
) const
pure virtual

Compute the product between the given matrix A and the derivative of the control input with respect to the control parameters (i.e., A*dw_du).

It assumes that calc() has been run first

Parameters
[in]dataControl-parametrization data
[in]AA matrix to multiply times the Jacobian
[out]outProduct between the matrix A and the Jacobian of the control with respect to the parameters
[in]opAssignment operator which sets, adds, or removes the given results

Implemented in ControlParametrizationModelPolyTwoRKTpl< _Scalar >, ControlParametrizationModelPolyOneTpl< _Scalar >, and ControlParametrizationModelPolyZeroTpl< _Scalar >.

◆ multiplyJacobianTransposeBy()

virtual void multiplyJacobianTransposeBy ( const boost::shared_ptr< ControlParametrizationDataAbstract > &  data,
const Eigen::Ref< const MatrixXs > &  A,
Eigen::Ref< MatrixXs >  out,
const  AssignmentOp = setto 
) const
pure virtual

Compute the product between the transpose of the derivative of the control input with respect to the control parameters and a given matrix A (i.e., dw_du^T*A)

It assumes that calc() has been run first

Parameters
[in]dataControl-parametrization data
[in]AA matrix to multiply times the Jacobian
[out]outProduct between the transposed Jacobian of the control with respect to the parameters and the matrix A
[in]opAssignment operator which sets, adds, or removes the given results

Implemented in ControlParametrizationModelPolyTwoRKTpl< _Scalar >, ControlParametrizationModelPolyOneTpl< _Scalar >, and ControlParametrizationModelPolyZeroTpl< _Scalar >.


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