crocoddyl  1.8.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
frame-rotation.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_FRAME_ROTATION_HPP_
10 #define CROCODDYL_MULTIBODY_COSTS_FRAME_ROTATION_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/frame-rotation.hpp"
16 #include "crocoddyl/multibody/data/multibody.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  CostModelFrameRotationTpl(boost::shared_ptr<StateMultibody> state,
61  boost::shared_ptr<ActivationModelAbstract> activation, const FrameRotation& Fref,
62  const std::size_t nu);
63 
74  CostModelFrameRotationTpl(boost::shared_ptr<StateMultibody> state,
75  boost::shared_ptr<ActivationModelAbstract> activation, const FrameRotation& Fref);
76 
87  CostModelFrameRotationTpl(boost::shared_ptr<StateMultibody> state, const FrameRotation& Fref, const std::size_t nu);
88 
100  CostModelFrameRotationTpl(boost::shared_ptr<StateMultibody> state, const FrameRotation& Fref);
101  virtual ~CostModelFrameRotationTpl();
102 
103  protected:
107  virtual void get_referenceImpl(const std::type_info& ti, void* pv);
108 
112  virtual void set_referenceImpl(const std::type_info& ti, const void* pv);
113 
114  using Base::activation_;
115  using Base::nu_;
116  using Base::residual_;
117  using Base::state_;
118  using Base::unone_;
119 
120  private:
121  FrameRotation Rref_;
122 };
123 
124 } // namespace crocoddyl
125 
126 /* --- Details -------------------------------------------------------------- */
127 /* --- Details -------------------------------------------------------------- */
128 /* --- Details -------------------------------------------------------------- */
129 #include "crocoddyl/multibody/costs/frame-rotation.hxx"
130 
131 #endif // CROCODDYL_MULTIBODY_COSTS_FRAME_ROTATION_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
CostModelFrameRotationTpl(boost::shared_ptr< StateMultibody > state, boost::shared_ptr< ActivationModelAbstract > activation, const FrameRotation &Fref, const std::size_t nu)
Initialize the frame rotation cost model.
Frame rotation residual.
Definition: fwd.hpp:137
virtual void get_referenceImpl(const std::type_info &ti, void *pv)
Return the frame rotation reference.
virtual void set_referenceImpl(const std::type_info &ti, const void *pv)
Modify the frame rotation reference.
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