Crocoddyl
Loading...
Searching...
No Matches
cop-support.hpp
1
2// BSD 3-Clause License
3//
4// Copyright (C) 2021-2026, University of Edinburgh, University of Oxford,
5// Heriot-Watt University
6// Copyright note valid unless otherwise stated in individual files.
7// All rights reserved.
9
10#ifndef CROCODDYL_MULTIBODY_COP_SUPPORT_HPP_
11#define CROCODDYL_MULTIBODY_COP_SUPPORT_HPP_
12
13#include "crocoddyl/core/utils/conversions.hpp"
14#include "crocoddyl/multibody/fwd.hpp"
15#include "crocoddyl/multibody/wrench-cone.hpp"
16
17namespace crocoddyl {
18
27template <typename _Scalar>
29 public:
30 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
31
32 typedef _Scalar Scalar;
33 typedef MathBaseTpl<Scalar> MathBase;
34 typedef typename MathBase::Vector2s Vector2s;
35 typedef typename MathBase::Vector3s Vector3s;
36 typedef typename MathBase::Vector4s Vector4s;
37 typedef typename MathBase::Matrix3s Matrix3s;
38 typedef typename MathBase::Matrix46s Matrix46s;
39 typedef typename MathBase::Quaternions Quaternions;
40
48 CoPSupportTpl(const Matrix3s& R, const Vector2s& box);
49
56
63
67 explicit CoPSupportTpl();
69
80 void update();
81
91 template <typename NewScalar>
93
97 const Matrix46s& get_A() const;
98
102 const Vector4s& get_ub() const;
103
107 const Vector4s& get_lb() const;
108
112 const Vector2s& get_box() const;
113
118 const Matrix3s& get_R() const;
119
127 void set_R(const Matrix3s& R);
128
135 void set_box(const Vector2s& box);
136
137 CoPSupportTpl<Scalar>& operator=(const CoPSupportTpl<Scalar>& other);
138
139 template <class Scalar>
140 friend std::ostream& operator<<(std::ostream& os,
141 const CoPSupportTpl<Scalar>& X);
142
143 private:
144 Matrix46s A_;
145 Vector4s ub_;
146 Vector4s lb_;
147 Matrix3s R_;
148 Vector2s box_;
149};
150
151} // namespace crocoddyl
152
153#include "crocoddyl/multibody/cop-support.hxx"
154
155CROCODDYL_DECLARE_EXTERN_TEMPLATE_CLASS(crocoddyl::CoPSupportTpl)
156
157#endif // CROCODDYL_MULTIBODY_COP_SUPPORT_HPP_
This class encapsulates a center of pressure support of a 6d contact.
const Vector2s & get_box() const
Return dimension of the center of pressure support (length, width).
const Vector4s & get_lb() const
Return the lower bound of the center of pressure support.
const Matrix3s & get_R() const
Return the rotation matrix that defines the support orientation w.r.t. the inertial frame.
CoPSupportTpl< NewScalar > cast() const
Cast the wrench cone to a different scalar type.
void set_box(const Vector2s &box)
Modify dimension of the center of pressure support (length, width).
CoPSupportTpl(const CoPSupportTpl< Scalar > &support)
Initialize the center of pressure support.
CoPSupportTpl(const Matrix3s &R, const Vector2s &box)
Initialize the center of pressure support.
const Matrix46s & get_A() const
Return the matrix of center of pressure support.
void set_R(const Matrix3s &R)
Modify the rotation matrix that defines the support orientation w.r.t. the inertial frame.
CoPSupportTpl()
Initialize the center of pressure support.
CoPSupportTpl(const WrenchConeTpl< Scalar > &support)
Initialize the center of pressure support.
void update()
Update the matrix of center of pressure inequalities in the world frame.
const Vector4s & get_ub() const
Return the upper bound of the center of pressure support.
This class encapsulates a wrench cone.