crocoddyl 1.9.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
 
Loading...
Searching...
No Matches
state.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_STATE_HPP_
10#define CROCODDYL_MULTIBODY_COSTS_STATE_HPP_
11
12#include "crocoddyl/core/fwd.hpp"
13#include "crocoddyl/multibody/fwd.hpp"
14#include "crocoddyl/core/costs/residual.hpp"
15#include "crocoddyl/multibody/residuals/state.hpp"
16#include "crocoddyl/multibody/states/multibody.hpp"
17
18namespace crocoddyl {
19
36template <typename _Scalar>
37class CostModelStateTpl : public CostModelResidualTpl<_Scalar> {
38 public:
39 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
40
41 typedef _Scalar Scalar;
48 typedef typename MathBase::VectorXs VectorXs;
49 typedef typename MathBase::MatrixXs MatrixXs;
50
59 CostModelStateTpl(boost::shared_ptr<typename Base::StateAbstract> state,
60 boost::shared_ptr<ActivationModelAbstract> activation, const VectorXs& xref, const std::size_t nu);
61
71 CostModelStateTpl(boost::shared_ptr<typename Base::StateAbstract> state,
72 boost::shared_ptr<ActivationModelAbstract> activation, const VectorXs& xref);
73
83 CostModelStateTpl(boost::shared_ptr<typename Base::StateAbstract> state, const VectorXs& xref, const std::size_t nu);
84
94 CostModelStateTpl(boost::shared_ptr<typename Base::StateAbstract> state, const VectorXs& xref);
95
105 CostModelStateTpl(boost::shared_ptr<typename Base::StateAbstract> state,
106 boost::shared_ptr<ActivationModelAbstract> activation, const std::size_t nu);
107
117 CostModelStateTpl(boost::shared_ptr<typename Base::StateAbstract> state, const std::size_t nu);
118
128 CostModelStateTpl(boost::shared_ptr<typename Base::StateAbstract> state,
129 boost::shared_ptr<ActivationModelAbstract> activation);
130
140 explicit CostModelStateTpl(boost::shared_ptr<typename Base::StateAbstract> state);
141 virtual ~CostModelStateTpl();
142
150 virtual void calcDiff(const boost::shared_ptr<CostDataAbstract>& data, const Eigen::Ref<const VectorXs>& x,
151 const Eigen::Ref<const VectorXs>& u);
152
153 protected:
157 virtual void get_referenceImpl(const std::type_info& ti, void* pv);
158
162 virtual void set_referenceImpl(const std::type_info& ti, const void* pv);
163
164 using Base::activation_;
165 using Base::nu_;
166 using Base::residual_;
167 using Base::state_;
168 using Base::unone_;
169
170 private:
171 VectorXs xref_;
172 boost::shared_ptr<typename StateMultibody::PinocchioModel> pin_model_;
173};
174
175} // namespace crocoddyl
176
177/* --- Details -------------------------------------------------------------- */
178/* --- Details -------------------------------------------------------------- */
179/* --- Details -------------------------------------------------------------- */
180#include "crocoddyl/multibody/costs/state.hxx"
181
182#endif // CROCODDYL_MULTIBODY_COSTS_STATE_HPP_
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
virtual void set_referenceImpl(const std::type_info &ti, const void *pv)
Modify the state reference.
CostModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state, const std::size_t nu)
Initialize the state cost model.
CostModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation, const std::size_t nu)
Initialize the state cost model.
CostModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state, const VectorXs &xref)
Initialize the state cost model.
CostModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state)
Initialize the state cost model.
CostModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation, const VectorXs &xref, const std::size_t nu)
Initialize the state cost model.
CostModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation, const VectorXs &xref)
Initialize the state cost model.
virtual void calcDiff(const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the derivatives of the state cost.
CostModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state, const VectorXs &xref, const std::size_t nu)
Initialize the state cost model.
virtual void get_referenceImpl(const std::type_info &ti, void *pv)
Return the state reference.
CostModelStateTpl(boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation)
Initialize the state cost model.
State multibody representation.
Definition: multibody.hpp:31