crocoddyl  1.8.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
contact-force.hpp
1 // 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_CONTACT_FORCE_HPP_
10 #define CROCODDYL_MULTIBODY_COSTS_CONTACT_FORCE_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/contact-force.hpp"
16 #include "crocoddyl/multibody/frames.hpp"
17 
18 namespace crocoddyl {
19 
38 template <typename _Scalar>
40  public:
41  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
42 
43  typedef _Scalar Scalar;
50  typedef typename MathBase::VectorXs VectorXs;
51  typedef typename MathBase::MatrixXs MatrixXs;
52 
63  CostModelContactForceTpl(boost::shared_ptr<StateMultibody> state,
64  boost::shared_ptr<ActivationModelAbstract> activation, const FrameForce& fref,
65  const std::size_t nu);
66 
77  CostModelContactForceTpl(boost::shared_ptr<StateMultibody> state,
78  boost::shared_ptr<ActivationModelAbstract> activation, const FrameForce& fref);
79 
91  CostModelContactForceTpl(boost::shared_ptr<StateMultibody> state, const FrameForce& fref, const std::size_t nr,
92  const std::size_t nu);
93 
105  CostModelContactForceTpl(boost::shared_ptr<StateMultibody> state, const FrameForce& fref, const std::size_t nr);
106 
116  CostModelContactForceTpl(boost::shared_ptr<StateMultibody> state, const FrameForce& fref);
117  virtual ~CostModelContactForceTpl();
118 
119  protected:
123  virtual void get_referenceImpl(const std::type_info& ti, void* pv);
124 
128  virtual void set_referenceImpl(const std::type_info& ti, const void* pv);
129 
130  using Base::activation_;
131  using Base::nu_;
132  using Base::residual_;
133  using Base::state_;
134  using Base::unone_;
135 
136  protected:
137  FrameForce fref_;
138 };
139 
140 } // namespace crocoddyl
141 
142 /* --- Details -------------------------------------------------------------- */
143 /* --- Details -------------------------------------------------------------- */
144 /* --- Details -------------------------------------------------------------- */
145 #include "crocoddyl/multibody/costs/contact-force.hxx"
146 
147 #endif // CROCODDYL_MULTIBODY_COSTS_CONTACT_FORCE_HPP_
boost::shared_ptr< ResidualModelAbstract > residual_
Residual model.
Definition: cost-base.hpp:236
Abstract class for cost models.
Definition: cost-base.hpp:49
Residual-based cost.
Definition: residual.hpp:36
Define a contact force cost function.
virtual void set_referenceImpl(const std::type_info &ti, const void *pv)
Return the reference spatial contact force .
boost::shared_ptr< ActivationModelAbstract > activation_
Activation model.
Definition: cost-base.hpp:235
Define a contact force residual function.
Definition: fwd.hpp:102
State multibody representation.
Definition: fwd.hpp:300
FrameForce fref_
Reference spatial contact force .
virtual void get_referenceImpl(const std::type_info &ti, void *pv)
Modify the reference spatial contact force .
VectorXs unone_
No control vector.
Definition: cost-base.hpp:238
std::size_t nu_
Control dimension.
Definition: cost-base.hpp:237
boost::shared_ptr< StateAbstract > state_
State description.
Definition: cost-base.hpp:234
CostModelContactForceTpl(boost::shared_ptr< StateMultibody > state, boost::shared_ptr< ActivationModelAbstract > activation, const FrameForce &fref, const std::size_t nu)
Initialize the contact force cost model.