crocoddyl  1.8.1
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/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 
42 template <typename _Scalar>
44  public:
45  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
46 
47  typedef _Scalar Scalar;
55  typedef typename MathBase::VectorXs VectorXs;
56 
65  CostModelFrameVelocityTpl(boost::shared_ptr<StateMultibody> state,
66  boost::shared_ptr<ActivationModelAbstract> activation, const FrameMotion& Fref,
67  const std::size_t nu);
68 
78  CostModelFrameVelocityTpl(boost::shared_ptr<StateMultibody> state,
79  boost::shared_ptr<ActivationModelAbstract> activation, const FrameMotion& Fref);
80 
90  CostModelFrameVelocityTpl(boost::shared_ptr<StateMultibody> state, const FrameMotion& Fref, const std::size_t nu);
91 
101  CostModelFrameVelocityTpl(boost::shared_ptr<StateMultibody> state, const FrameMotion& Fref);
102  virtual ~CostModelFrameVelocityTpl();
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  FrameMotion vref_;
123 };
124 
125 } // namespace crocoddyl
126 
127 /* --- Details -------------------------------------------------------------- */
128 /* --- Details -------------------------------------------------------------- */
129 /* --- Details -------------------------------------------------------------- */
130 #include "crocoddyl/multibody/costs/frame-velocity.hxx"
131 
132 #pragma GCC diagnostic pop
133 
134 #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