Template Class ControlParametrizationModelPolyTwoRKTpl
Defined in File poly-two-rk.hpp
Inheritance Relationships
Base Type
public crocoddyl::ControlParametrizationModelAbstractTpl< _Scalar >(Template Class ControlParametrizationModelAbstractTpl)
Class Documentation
-
template<typename _Scalar>
class ControlParametrizationModelPolyTwoRKTpl : public crocoddyl::ControlParametrizationModelAbstractTpl<_Scalar> A polynomial function of time of degree two, that is a quadratic function.
The size of the parameters \(\mathbf{u}\) is 3 times the size of the control input \(\mathbf{w}\). It defines a polynomial of degree two, customized for the RK4 and RK4 integrators (even though it can be used with whatever integration scheme). The first third of \(\mathbf{u}\) represents the value of \(\mathbf{w}\) at time 0. The second third of \(\mathbf{u}\) represents the value of \(\mathbf{w}\) at time 0.5 or 1/3 for RK4 and RK3 parametrization, respectively. The last third of \(\mathbf{u}\) represents the value of \(\mathbf{w}\) at time 1 or 2/3 for the RK4 and RK3 parametrization, respectively. This parametrization is suitable to be used with the RK-4 or RK-3 integration schemes, because they require the value of \(\mathbf{w}\) exactly at 0, 0.5, 1 (for RK4) or 0, 1/3, 2/3 (for RK3).
The main computations are carried out in
calc,multiplyByJacobianandmultiplyJacobianTransposeBy, where the former computes control input \(\mathbf{w}\in\mathbb{R}^{nw}\) from a set of control parameters \(\mathbf{u}\in\mathbb{R}^{nu}\) wherenwandnurepresent the dimension of the control inputs and parameters, respectively, and the latter defines useful operations across the Jacobian of the control-parametrization model. Finally,paramsallows us to obtain the control parameters from a the control input, i.e., it is the inverse ofcalc. Note thatmultiplyByJacobianandmultiplyJacobianTransposeByrequires to runcalcfirst.See also
ControlParametrizationAbstractTpl,calc(),calcDiff(),createData(),params,multiplyByJacobian,multiplyJacobianTransposeByPublic Types
-
typedef MathBaseTpl<Scalar> MathBase
-
typedef ControlParametrizationDataAbstractTpl<Scalar> ControlParametrizationDataAbstract
-
typedef ControlParametrizationModelAbstractTpl<Scalar> Base
-
typedef ControlParametrizationDataPolyTwoRKTpl<Scalar> Data
Public Functions
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW CROCODDYL_DERIVED_CAST (ControlParametrizationModelBase, ControlParametrizationModelPolyTwoRKTpl) typedef _Scalar Scalar
-
explicit ControlParametrizationModelPolyTwoRKTpl(const std::size_t nw, const RKType rktype)
Initialize the poly-two RK control parametrization.
- Parameters:
nw – [in] Dimension of control vector
rktype – [in] Type of RK parametrization
-
virtual ~ControlParametrizationModelPolyTwoRKTpl() = default
Get the value of the control at the specified time.
- Parameters:
data – [in] Poly-two-RK data
t – [in] Time in [0,1]
u – [in] Control parameters
Get the value of the Jacobian of the control with respect to the parameters.
It assumes that
calc()has been run first- Parameters:
data – [in] Poly-two-RK data
t – [in] Time in [0,1]
u – [in] Control parameters
-
virtual std::shared_ptr<ControlParametrizationDataAbstract> createData() override
Create the control-parametrization data.
- Returns:
the control-parametrization data
Get a value of the control parameters u such that the control at the specified time t is equal to the specified value w.
- Parameters:
data – [in] Poly-two-RK data
t – [in] Time in [0,1]
w – [in] Control values
-
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 override
Map the specified bounds from the control space to the parameter space.
- Parameters:
w_lb – [in] Control lower bound
w_ub – [in] Control lower bound
u_lb – [out] Control parameters lower bound
u_ub – [out] Control parameters upper bound
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:
data – [in] Poly-two-RK data
A – [in] A matrix to multiply times the Jacobian
out – [out] Product between the matrix A and the Jacobian of the control with respect to the parameters
op – [in] Assignment operator which sets, adds, or removes the given results
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:
data – [in] Poly-two-RK data
A – [in] A matrix to multiply times the Jacobian
out – [out] Product between the transposed Jacobian of the control with respect to the parameters and the matrix A
op – [in] Assignment operator which sets, adds, or removes the given results
-
template<typename NewScalar>
ControlParametrizationModelPolyTwoRKTpl<NewScalar> cast() const
-
virtual void print(std::ostream &os) const override
Print relevant information of the control model.
- Parameters:
os – [out] Output stream object
-
typedef MathBaseTpl<Scalar> MathBase