wbc
Constraint.hpp
Go to the documentation of this file.
1#ifndef CONSTRAINT_HPP
2#define CONSTRAINT_HPP
3
4#include "RobotModel.hpp"
5#include <base/Eigen.hpp>
6#include <base/Time.hpp>
7#include <base/NamedVector.hpp>
8#include <memory>
9
10namespace wbc{
11
20public:
21
22 enum Type {
25 bounds = 2
26 };
27
28 virtual ~Constraint() = default;
29
31 virtual void update(RobotModelPtr robot_model) = 0;
32
34 Type type();
35
37 const base::MatrixXd& A();
38
40 const base::VectorXd& b();
41
43 const base::VectorXd& lb();
44
46 const base::VectorXd& ub();
47
49 uint size();
50
51protected:
52
54 Constraint();
55
58
60
62 base::MatrixXd A_mtx;
63
65 base::VectorXd b_vec;
66
68 base::VectorXd lb_vec;
69
71 base::VectorXd ub_vec;
72
73};
74typedef std::shared_ptr<Constraint> ConstraintPtr;
75
76} // namespace wbc
77#endif
Abstract class to represent a generic hard (linear) constraint for a WBC optimization problem....
Definition Constraint.hpp:19
base::VectorXd ub_vec
Definition Constraint.hpp:71
Type c_type
Definition Constraint.hpp:59
Type
Definition Constraint.hpp:22
@ bounds
Definition Constraint.hpp:25
@ inequality
Definition Constraint.hpp:24
@ equality
Definition Constraint.hpp:23
Constraint()
Default constructor.
Definition Constraint.cpp:7
base::VectorXd lb_vec
Definition Constraint.hpp:68
const base::MatrixXd & A()
return constraint matrix A
Definition Constraint.cpp:21
base::MatrixXd A_mtx
Definition Constraint.hpp:62
Type type()
Return the type of this constraint.
Definition Constraint.cpp:17
base::VectorXd b_vec
Definition Constraint.hpp:65
const base::VectorXd & b()
return constraint vector b
Definition Constraint.cpp:25
virtual void update(RobotModelPtr robot_model)=0
Update constraint matrix and vectors, depending on the type. Abstract method.
const base::VectorXd & ub()
return constraint upper bound ub
Definition Constraint.cpp:33
const base::VectorXd & lb()
return constraint lower bound lb
Definition Constraint.cpp:29
virtual ~Constraint()=default
uint size()
return size of the constraint (i.e. number of rows of the constraint matrix)
Definition Constraint.cpp:37
Definition ContactsAccelerationConstraint.cpp:3
std::shared_ptr< Constraint > ConstraintPtr
Definition Constraint.hpp:74
std::shared_ptr< RobotModel > RobotModelPtr
Definition RobotModel.hpp:204