state.hpp
Go to the documentation of this file.
1 // BSD 3-Clause License
3 //
4 // Copyright (C) 2018-2020, LAAS-CNRS, University of Edinburgh
5 // Copyright note valid unless otherwise stated in individual files.
6 // All rights reserved.
8 
9 #ifndef SOBEC_STATELPF_HPP_
10 #define SOBEC_STATELPF_HPP_
11 #include <pinocchio/multibody/model.hpp>
12 
13 #include "crocoddyl/core/state-base.hpp"
14 #include "sobec/fwd.hpp"
15 namespace sobec {
16 using namespace crocoddyl;
17 
18 template <typename _Scalar>
19 class StateLPFTpl : public StateAbstractTpl<_Scalar> {
20  public:
21  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
22 
23  typedef _Scalar Scalar;
24  typedef MathBaseTpl<Scalar> MathBase;
25  typedef StateAbstractTpl<Scalar> Base;
26  typedef typename MathBase::VectorXs VectorXs;
27  typedef typename MathBase::MatrixXs MatrixXs;
28 
29  enum JointType { FreeFlyer = 0, Spherical, Simple };
30 
31  explicit StateLPFTpl(boost::shared_ptr<pinocchio::ModelTpl<Scalar> > model,
32  std::vector<int> lpf_joint_ids);
33  virtual ~StateLPFTpl();
34 
35  virtual VectorXs zero() const;
36  virtual VectorXs rand() const;
37  virtual void diff(const Eigen::Ref<const VectorXs>& y0,
38  const Eigen::Ref<const VectorXs>& y1,
39  Eigen::Ref<VectorXs> dyout) const;
40  virtual void integrate(const Eigen::Ref<const VectorXs>& y,
41  const Eigen::Ref<const VectorXs>& dy,
42  Eigen::Ref<VectorXs> yout) const;
43  virtual void Jdiff(const Eigen::Ref<const VectorXs>&,
44  const Eigen::Ref<const VectorXs>&,
45  Eigen::Ref<MatrixXs> Jfirst, Eigen::Ref<MatrixXs> Jsecond,
46  const Jcomponent firstsecond = both) const;
47 
48  virtual void Jintegrate(const Eigen::Ref<const VectorXs>& y,
49  const Eigen::Ref<const VectorXs>& dy,
50  Eigen::Ref<MatrixXs> Jfirst,
51  Eigen::Ref<MatrixXs> Jsecond,
52  const Jcomponent firstsecond = both,
53  const AssignmentOp = setto) const;
54  virtual void JintegrateTransport(const Eigen::Ref<const VectorXs>& y,
55  const Eigen::Ref<const VectorXs>& dy,
56  Eigen::Ref<MatrixXs> Jin,
57  const Jcomponent firstsecond) const;
58 
59  const boost::shared_ptr<pinocchio::ModelTpl<Scalar> >& get_pinocchio() const;
60  const std::size_t& get_ntau() const;
61  const std::size_t& get_ny() const;
62  const std::size_t& get_ndy() const;
63 
64  protected:
65  using Base::has_limits_;
66  using Base::lb_;
67  using Base::ndx_;
68  using Base::nq_;
69  using Base::nv_;
70  using Base::nx_;
71  using Base::ub_;
72  std::size_t ntau_;
73  std::size_t ny_;
74  std::size_t ndy_;
75 
76  private:
77  boost::shared_ptr<pinocchio::ModelTpl<Scalar> > pinocchio_;
78  VectorXs y0_;
79  JointType joint_type_;
80 };
81 
82 } // namespace sobec
83 
84 /* --- Details -------------------------------------------------------------- */
85 /* --- Details -------------------------------------------------------------- */
86 /* --- Details -------------------------------------------------------------- */
88 
89 #endif // SOBEC_STATELPF_HPP_
sobec::StateLPFTpl::ny_
std::size_t ny_
Definition: state.hpp:73
sobec::StateLPFTpl::MatrixXs
MathBase::MatrixXs MatrixXs
Definition: state.hpp:27
sobec::newcontacts::y
@ y
Definition: contact1d.hpp:26
sobec::StateLPFTpl::JointType
JointType
Definition: state.hpp:29
fwd.hpp
sobec::StateLPFTpl::ndy_
std::size_t ndy_
Definition: state.hpp:74
sobec::StateLPFTpl
Definition: state.hpp:19
sobec::StateLPFTpl::MathBase
MathBaseTpl< Scalar > MathBase
Definition: state.hpp:24
sobec
Definition: activation-quad-ref.hpp:19
sobec::StateLPFTpl::ntau_
std::size_t ntau_
Definition: state.hpp:72
sobec::StateLPFTpl::Scalar
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
Definition: state.hpp:23
sobec::StateLPFTpl::Spherical
@ Spherical
Definition: state.hpp:29
sobec::StateLPFTpl::Base
StateAbstractTpl< Scalar > Base
Definition: state.hpp:25
sobec::StateLPFTpl::VectorXs
MathBase::VectorXs VectorXs
Definition: state.hpp:26
state.hxx