crocoddyl  1.8.1
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/core/utils/exception.hpp"
18 
19 #include "crocoddyl/multibody/frames-deprecated.hpp"
20 
21 namespace crocoddyl {
22 
23 #pragma GCC diagnostic push // TODO: Remove once the deprecated FrameXX has been removed in a future release
24 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
25 
41 template <typename _Scalar>
43  public:
44  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
45 
46  typedef _Scalar Scalar;
53  typedef typename MathBase::VectorXs VectorXs;
54  typedef typename MathBase::Matrix3xs Matrix3xs;
55 
64  CostModelFrameTranslationTpl(boost::shared_ptr<StateMultibody> state,
65  boost::shared_ptr<ActivationModelAbstract> activation, const FrameTranslation& xref,
66  const std::size_t nu);
67 
77  CostModelFrameTranslationTpl(boost::shared_ptr<StateMultibody> state,
78  boost::shared_ptr<ActivationModelAbstract> activation, const FrameTranslation& xref);
79 
89  CostModelFrameTranslationTpl(boost::shared_ptr<StateMultibody> state, const FrameTranslation& xref,
90  const std::size_t nu);
91 
101  CostModelFrameTranslationTpl(boost::shared_ptr<StateMultibody> state, const FrameTranslation& xref);
102  virtual ~CostModelFrameTranslationTpl();
103 
104  protected:
108  virtual void get_referenceImpl(const std::type_info& ti, void* pv);
109 
113  virtual void set_referenceImpl(const std::type_info& ti, const void* pv);
114 
115  using Base::activation_;
116  using Base::nu_;
117  using Base::residual_;
118  using Base::state_;
119  using Base::unone_;
120 
121  private:
122  FrameTranslation xref_;
123 };
124 
125 } // namespace crocoddyl
126 
127 /* --- Details -------------------------------------------------------------- */
128 /* --- Details -------------------------------------------------------------- */
129 /* --- Details -------------------------------------------------------------- */
130 #include "crocoddyl/multibody/costs/frame-translation.hxx"
131 
132 #pragma GCC diagnostic pop
133 
134 #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