crocoddyl  1.9.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
cop-support.hpp
1 // BSD 3-Clause License
3 //
4 // Copyright (C) 2021, University of Edinburgh, University of Oxford
5 // Copyright note valid unless otherwise stated in individual files.
6 // All rights reserved.
8 
9 #ifndef CROCODDYL_MULTIBODY_COP_SUPPORT_HPP_
10 #define CROCODDYL_MULTIBODY_COP_SUPPORT_HPP_
11 
12 #include "crocoddyl/multibody/fwd.hpp"
13 #include "crocoddyl/core/mathbase.hpp"
14 
15 namespace crocoddyl {
16 
24 template <typename _Scalar>
26  public:
27  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
28 
29  typedef _Scalar Scalar;
31  typedef typename MathBase::Vector2s Vector2s;
32  typedef typename MathBase::Vector3s Vector3s;
33  typedef typename MathBase::Vector4s Vector4s;
34  typedef typename MathBase::Matrix3s Matrix3s;
35  typedef typename MathBase::Matrix46s Matrix46s;
36  typedef typename MathBase::Quaternions Quaternions;
37 
41  explicit CoPSupportTpl();
42 
49  CoPSupportTpl(const Matrix3s& R, const Vector2s& box);
50 
56  CoPSupportTpl(const WrenchConeTpl<Scalar>& support);
57 
63  CoPSupportTpl(const CoPSupportTpl<Scalar>& support);
64  ~CoPSupportTpl();
65 
75  void update();
76 
80  const Matrix46s& get_A() const;
81 
85  const Vector4s& get_ub() const;
86 
90  const Vector4s& get_lb() const;
91 
95  const Vector2s& get_box() const;
96 
100  const Matrix3s& get_R() const;
101 
107  void set_R(const Matrix3s& R);
108 
114  void set_box(const Vector2s& box);
115 
116  CoPSupportTpl<Scalar>& operator=(const CoPSupportTpl<Scalar>& other);
117 
118  template <class Scalar>
119  friend std::ostream& operator<<(std::ostream& os, const CoPSupportTpl<Scalar>& X);
120 
121  private:
122  Matrix46s A_;
123  Vector4s ub_;
124  Vector4s lb_;
125  Matrix3s R_;
126  Vector2s box_;
127 };
128 
129 } // namespace crocoddyl
130 
131 #include "crocoddyl/multibody/cop-support.hxx"
132 
133 #endif // CROCODDYL_MULTIBODY_COP_SUPPORT_HPP_
crocoddyl::CoPSupportTpl::get_R
const Matrix3s & get_R() const
Return the rotation matrix that defines the support orientation w.r.t. the inertial frame.
crocoddyl::MathBaseTpl< Scalar >
crocoddyl::CoPSupportTpl::get_ub
const Vector4s & get_ub() const
Return the upper bound of the center of pressure support.
crocoddyl::CoPSupportTpl::set_R
void set_R(const Matrix3s &R)
Modify the rotation matrix that defines the support orientation w.r.t. the inertial frame.
crocoddyl::CoPSupportTpl::get_lb
const Vector4s & get_lb() const
Return the lower bound of the center of pressure support.
crocoddyl::CoPSupportTpl::set_box
void set_box(const Vector2s &box)
Modify dimension of the center of pressure support (length, width)
crocoddyl::WrenchConeTpl< Scalar >
crocoddyl::CoPSupportTpl::update
void update()
Update the matrix of center of pressure inequalities in the world frame.
crocoddyl::CoPSupportTpl
This class encapsulates a center of pressure support of a 6d contact.
Definition: cop-support.hpp:25
crocoddyl::CoPSupportTpl::get_box
const Vector2s & get_box() const
Return dimension of the center of pressure support (length, width)
crocoddyl::CoPSupportTpl::get_A
const Matrix46s & get_A() const
Return the matrix of center of pressure support.
crocoddyl::CoPSupportTpl::CoPSupportTpl
CoPSupportTpl()
Initialize the center of pressure support.