crocoddyl  1.8.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
frame-translation.hpp
1 
3 // BSD 3-Clause License
4 //
5 // Copyright (C) 2019-2021, LAAS-CNRS, University of Edinburgh, INRIA
6 // Copyright note valid unless otherwise stated in individual files.
7 // All rights reserved.
9 
10 #ifndef CROCODDYL_MULTIBODY_COSTS_FRAME_TRANSLATION_HPP_
11 #define CROCODDYL_MULTIBODY_COSTS_FRAME_TRANSLATION_HPP_
12 
13 #include "crocoddyl/multibody/fwd.hpp"
14 #include "crocoddyl/core/costs/residual.hpp"
15 #include "crocoddyl/multibody/states/multibody.hpp"
16 #include "crocoddyl/multibody/residuals/frame-translation.hpp"
17 #include "crocoddyl/multibody/frames.hpp"
18 #include "crocoddyl/core/utils/exception.hpp"
19 
20 namespace crocoddyl {
21 
37 template <typename _Scalar>
39  public:
40  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
41 
42  typedef _Scalar Scalar;
49  typedef typename MathBase::VectorXs VectorXs;
50  typedef typename MathBase::Matrix3xs Matrix3xs;
51 
60  CostModelFrameTranslationTpl(boost::shared_ptr<StateMultibody> state,
61  boost::shared_ptr<ActivationModelAbstract> activation, const FrameTranslation& xref,
62  const std::size_t nu);
63 
73  CostModelFrameTranslationTpl(boost::shared_ptr<StateMultibody> state,
74  boost::shared_ptr<ActivationModelAbstract> activation, const FrameTranslation& xref);
75 
85  CostModelFrameTranslationTpl(boost::shared_ptr<StateMultibody> state, const FrameTranslation& xref,
86  const std::size_t nu);
87 
97  CostModelFrameTranslationTpl(boost::shared_ptr<StateMultibody> state, const FrameTranslation& xref);
99 
100  protected:
104  virtual void get_referenceImpl(const std::type_info& ti, void* pv);
105 
109  virtual void set_referenceImpl(const std::type_info& ti, const void* pv);
110 
111  using Base::activation_;
112  using Base::nu_;
113  using Base::residual_;
114  using Base::state_;
115  using Base::unone_;
116 
117  private:
118  FrameTranslation xref_;
119 };
120 
121 } // namespace crocoddyl
122 
123 /* --- Details -------------------------------------------------------------- */
124 /* --- Details -------------------------------------------------------------- */
125 /* --- Details -------------------------------------------------------------- */
126 #include "crocoddyl/multibody/costs/frame-translation.hxx"
127 
128 #endif // CROCODDYL_MULTIBODY_COSTS_FRAME_TRANSLATION_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
boost::shared_ptr< ActivationModelAbstract > activation_
Activation model.
Definition: cost-base.hpp:235
State multibody representation.
Definition: fwd.hpp:300
CostModelFrameTranslationTpl(boost::shared_ptr< StateMultibody > state, boost::shared_ptr< ActivationModelAbstract > activation, const FrameTranslation &xref, const std::size_t nu)
Initialize the frame translation cost model.
virtual void get_referenceImpl(const std::type_info &ti, void *pv)
Return the frame translation reference.
Frame translation residual.
Definition: fwd.hpp:142
VectorXs unone_
No control vector.
Definition: cost-base.hpp:238
virtual void set_referenceImpl(const std::type_info &ti, const void *pv)
Modify the frame translation reference.
std::size_t nu_
Control dimension.
Definition: cost-base.hpp:237
boost::shared_ptr< StateAbstract > state_
State description.
Definition: cost-base.hpp:234