crocoddyl  1.8.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
frame-velocity.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_VELOCITY_HPP_
10 #define CROCODDYL_MULTIBODY_COSTS_FRAME_VELOCITY_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-velocity.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 
38 template <typename _Scalar>
40  public:
41  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
42 
43  typedef _Scalar Scalar;
51  typedef typename MathBase::VectorXs VectorXs;
52 
61  CostModelFrameVelocityTpl(boost::shared_ptr<StateMultibody> state,
62  boost::shared_ptr<ActivationModelAbstract> activation, const FrameMotion& Fref,
63  const std::size_t nu);
64 
74  CostModelFrameVelocityTpl(boost::shared_ptr<StateMultibody> state,
75  boost::shared_ptr<ActivationModelAbstract> activation, const FrameMotion& Fref);
76 
86  CostModelFrameVelocityTpl(boost::shared_ptr<StateMultibody> state, const FrameMotion& Fref, const std::size_t nu);
87 
97  CostModelFrameVelocityTpl(boost::shared_ptr<StateMultibody> state, const FrameMotion& Fref);
98  virtual ~CostModelFrameVelocityTpl();
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  FrameMotion vref_;
119 };
120 
121 } // namespace crocoddyl
122 
123 /* --- Details -------------------------------------------------------------- */
124 /* --- Details -------------------------------------------------------------- */
125 /* --- Details -------------------------------------------------------------- */
126 #include "crocoddyl/multibody/costs/frame-velocity.hxx"
127 
128 #endif // CROCODDYL_MULTIBODY_COSTS_FRAME_VELOCITY_HPP_
CostModelFrameVelocityTpl(boost::shared_ptr< StateMultibody > state, boost::shared_ptr< ActivationModelAbstract > activation, const FrameMotion &Fref, const std::size_t nu)
Initialize the frame velocity cost model.
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
Frame velocity residual.
Definition: fwd.hpp:147
boost::shared_ptr< ActivationModelAbstract > activation_
Activation model.
Definition: cost-base.hpp:235
State multibody representation.
Definition: fwd.hpp:300
virtual void get_referenceImpl(const std::type_info &ti, void *pv)
Return the frame velocity reference.
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 velocity reference.
std::size_t nu_
Control dimension.
Definition: cost-base.hpp:237
boost::shared_ptr< StateAbstract > state_
State description.
Definition: cost-base.hpp:234