crocoddyl 1.9.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
 
Loading...
Searching...
No Matches
centroidal-momentum.hpp
1
2// BSD 3-Clause License
3//
4// Copyright (C) 2019-2021, LAAS-CNRS, University of Edinburgh, INRIA
5// Copyright note valid unless otherwise stated in individual files.
6// All rights reserved.
8
9#ifndef CROCODDYL_MULTIBODY_COSTS_MOMENTUM_HPP_
10#define CROCODDYL_MULTIBODY_COSTS_MOMENTUM_HPP_
11
12#include "crocoddyl/multibody/fwd.hpp"
13#include "crocoddyl/core/costs/residual.hpp"
14#include "crocoddyl/multibody/states/multibody.hpp"
15#include "crocoddyl/multibody/residuals/centroidal-momentum.hpp"
16#include "crocoddyl/multibody/data/multibody.hpp"
17#include "crocoddyl/core/utils/exception.hpp"
18
19namespace crocoddyl {
20
36template <typename _Scalar>
38 public:
39 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
40
41 typedef _Scalar Scalar;
47 typedef typename MathBase::Vector6s Vector6s;
48 typedef typename MathBase::VectorXs VectorXs;
49 typedef typename MathBase::MatrixXs MatrixXs;
50 typedef typename MathBase::Matrix6xs Matrix6xs;
51
60 CostModelCentroidalMomentumTpl(boost::shared_ptr<StateMultibody> state,
61 boost::shared_ptr<ActivationModelAbstract> activation, const Vector6s& mref,
62 const std::size_t nu);
63
73 CostModelCentroidalMomentumTpl(boost::shared_ptr<StateMultibody> state,
74 boost::shared_ptr<ActivationModelAbstract> activation, const Vector6s& mref);
75
85 CostModelCentroidalMomentumTpl(boost::shared_ptr<StateMultibody> state, const Vector6s& mref, const std::size_t nu);
86
96 CostModelCentroidalMomentumTpl(boost::shared_ptr<StateMultibody> state, const Vector6s& mref);
98
99 protected:
103 virtual void set_referenceImpl(const std::type_info& ti, const void* pv);
104
108 virtual void get_referenceImpl(const std::type_info& ti, void* pv);
109
110 using Base::activation_;
111 using Base::nu_;
112 using Base::residual_;
113 using Base::state_;
114 using Base::unone_;
115
116 private:
117 Vector6s href_;
118};
119
120} // namespace crocoddyl
121
122/* --- Details -------------------------------------------------------------- */
123/* --- Details -------------------------------------------------------------- */
124/* --- Details -------------------------------------------------------------- */
125#include "crocoddyl/multibody/costs/centroidal-momentum.hxx"
126
127#endif // CROCODDYL_MULTIBODY_COSTS_MOMENTUM_HPP_
CostModelCentroidalMomentumTpl(boost::shared_ptr< StateMultibody > state, boost::shared_ptr< ActivationModelAbstract > activation, const Vector6s &mref, const std::size_t nu)
Initialize the centroidal momentum cost model.
virtual void set_referenceImpl(const std::type_info &ti, const void *pv)
Modify the centroidal momentum reference.
CostModelCentroidalMomentumTpl(boost::shared_ptr< StateMultibody > state, const Vector6s &mref)
Initialize the centroidal momentum cost model.
CostModelCentroidalMomentumTpl(boost::shared_ptr< StateMultibody > state, boost::shared_ptr< ActivationModelAbstract > activation, const Vector6s &mref)
Initialize the centroidal momentum cost model.
virtual void get_referenceImpl(const std::type_info &ti, void *pv)
Return the centroidal momentum reference.
CostModelCentroidalMomentumTpl(boost::shared_ptr< StateMultibody > state, const Vector6s &mref, const std::size_t nu)
Initialize the centroidal momentum cost model.
Residual-based cost.
Definition: residual.hpp:36
boost::shared_ptr< ActivationModelAbstract > activation_
Activation model.
Definition: cost-base.hpp:241
boost::shared_ptr< StateAbstract > state_
State description.
Definition: cost-base.hpp:240
std::size_t nu_
Control dimension.
Definition: cost-base.hpp:243
VectorXs unone_
No control vector.
Definition: cost-base.hpp:244
boost::shared_ptr< ResidualModelAbstract > residual_
Residual model.
Definition: cost-base.hpp:242
State multibody representation.
Definition: multibody.hpp:31