Crocoddyl
ControlParametrizationModelPolyOneTpl< _Scalar > Class Template Reference

A polynomial function of time of degree one, that is a linear function. More...

#include <poly-one.hpp>

Inheritance diagram for ControlParametrizationModelPolyOneTpl< _Scalar >:
ControlParametrizationModelAbstractTpl< _Scalar >

Public Types

typedef ControlParametrizationModelAbstractTpl< Scalar > Base
 
typedef ControlParametrizationDataAbstractTpl< Scalar > ControlParametrizationDataAbstract
 
typedef ControlParametrizationDataPolyOneTpl< Scalar > Data
 
typedef MathBaseTpl< Scalar > MathBase
 
typedef MathBase::MatrixXs MatrixXs
 
typedef _Scalar Scalar
 
typedef MathBase::VectorXs VectorXs
 
- Public Types inherited from ControlParametrizationModelAbstractTpl< _Scalar >
typedef ControlParametrizationDataAbstractTpl< Scalar > ControlParametrizationDataAbstract
 
typedef MathBaseTpl< Scalar > MathBase
 
typedef MathBase::MatrixXs MatrixXs
 
typedef MathBase::VectorXs VectorXs
 

Public Member Functions

 ControlParametrizationModelPolyOneTpl (const std::size_t nw)
 Initialize the poly-one control parametrization. More...
 
virtual void calc (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Scalar t, const Eigen::Ref< const VectorXs > &u) const
 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
 Get the value of the Jacobian of the control with respect to the parameters. More...
 
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
 Map the specified bounds from the control space to the parameter space. More...
 
virtual boost::shared_ptr< ControlParametrizationDataAbstractcreateData ()
 Create the control-parametrization data. More...
 
virtual void multiplyByJacobian (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Eigen::Ref< const MatrixXs > &A, Eigen::Ref< MatrixXs > out, const AssignmentOp=setto) const
 Compute the product between a specified matrix and the Jacobian of the control (with respect to the parameters) More...
 
virtual void multiplyJacobianTransposeBy (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Eigen::Ref< const MatrixXs > &A, Eigen::Ref< MatrixXs > out, const AssignmentOp=setto) const
 Compute the product between the transposed Jacobian of the control (with respect to the parameters) and a specified matrix. More...
 
virtual void params (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Scalar t, const Eigen::Ref< const VectorXs > &w) const
 Get a value of the control parameters such that the control at the specified time t is equal to the specified value w. More...
 
- Public Member Functions inherited from ControlParametrizationModelAbstractTpl< _Scalar >
 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.
 
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 MatrixXs multiplyByJacobian_J (const boost::shared_ptr< ControlParametrizationDataAbstract > &data, const Eigen::Ref< const MatrixXs > &A, const AssignmentOp=setto) const
 
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...
 

Protected Attributes

std::size_t nu_
 Control parameters dimension.
 
std::size_t nw_
 Control dimension.
 
- Protected Attributes inherited from ControlParametrizationModelAbstractTpl< _Scalar >
std::size_t nu_
 Control parameters dimension.
 
std::size_t nw_
 Control dimension.
 

Additional Inherited Members

- Public Attributes inherited from ControlParametrizationModelAbstractTpl< _Scalar >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
 

Detailed Description

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

A polynomial function of time of degree one, that is a linear function.

The size of the parameters \(\mathbf{u}\) is twice the size of the control input \(\mathbf{w}\). The first half of \(\mathbf{u}\) represents the value of w at time 0. The second half of \(\mathbf{u}\) represents the value of \(\mathbf{w}\) at time 0.5.

The main computations are carried 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 the control input, i.e., it is the inverse of calc. Note that multiplyByJacobian and multiplyJacobianTransposeBy requires to run calc first.

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

Definition at line 41 of file poly-one.hpp.

Constructor & Destructor Documentation

◆ ControlParametrizationModelPolyOneTpl()

ControlParametrizationModelPolyOneTpl ( const std::size_t  nw)
explicit

Initialize the poly-one control parametrization.

Parameters
[in]nwDimension of control vector

Member Function Documentation

◆ calc()

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

Get the value of the control at the specified time.

Parameters
[in]dataControl-parametrization data
[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
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 from ControlParametrizationModelAbstractTpl< _Scalar >.

◆ params()

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

Get a value of the control parameters such that the control at the specified time t is equal to the specified value w.

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

◆ 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
virtual

Map the specified bounds from the control space to the parameter space.

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

Implements ControlParametrizationModelAbstractTpl< _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
virtual

Compute the product between a specified matrix and the Jacobian of the control (with respect to the parameters)

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

Implements ControlParametrizationModelAbstractTpl< _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
virtual

Compute the product between the transposed Jacobian of the control (with respect to the parameters) and a specified matrix.

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

Implements ControlParametrizationModelAbstractTpl< _Scalar >.


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