Line |
Branch |
Exec |
Source |
1 |
|
|
/////////////////////////////////////////////////////////////////////////////// |
2 |
|
|
// BSD 3-Clause License |
3 |
|
|
// |
4 |
|
|
// Copyright (C) 2021, University of Edinburgh |
5 |
|
|
// Copyright note valid unless otherwise stated in individual files. |
6 |
|
|
// All rights reserved. |
7 |
|
|
/////////////////////////////////////////////////////////////////////////////// |
8 |
|
|
|
9 |
|
|
#ifndef CROCODDYL_IMPULSE_CONSTRAINT_FACTORY_HPP_ |
10 |
|
|
#define CROCODDYL_IMPULSE_CONSTRAINT_FACTORY_HPP_ |
11 |
|
|
|
12 |
|
|
#include "activation.hpp" |
13 |
|
|
#include "actuation.hpp" |
14 |
|
|
#include "crocoddyl/core/action-base.hpp" |
15 |
|
|
#include "crocoddyl/core/numdiff/action.hpp" |
16 |
|
|
#include "state.hpp" |
17 |
|
|
|
18 |
|
|
namespace crocoddyl { |
19 |
|
|
namespace unittest { |
20 |
|
|
|
21 |
|
|
struct ImpulseConstraintModelTypes { |
22 |
|
|
enum Type { |
23 |
|
|
CostModelResidualImpulseCoMEquality, |
24 |
|
|
ConstraintModelResidualImpulseForceEquality, |
25 |
|
|
ConstraintModelResidualImpulseCoPPositionInequality, |
26 |
|
|
ConstraintModelResidualImpulseFrictionConeInequality, |
27 |
|
|
ConstraintModelResidualImpulseWrenchConeInequality, |
28 |
|
|
NbImpulseConstraintModelTypes |
29 |
|
|
}; |
30 |
|
✗ |
static std::vector<Type> init_all() { |
31 |
|
✗ |
std::vector<Type> v; |
32 |
|
✗ |
v.reserve(NbImpulseConstraintModelTypes); |
33 |
|
✗ |
for (int i = 0; i < NbImpulseConstraintModelTypes; ++i) { |
34 |
|
✗ |
v.push_back((Type)i); |
35 |
|
|
} |
36 |
|
✗ |
return v; |
37 |
|
|
} |
38 |
|
|
static const std::vector<Type> all; |
39 |
|
|
}; |
40 |
|
|
|
41 |
|
|
std::ostream &operator<<(std::ostream &os, |
42 |
|
|
ImpulseConstraintModelTypes::Type type); |
43 |
|
|
|
44 |
|
|
class ImpulseConstraintModelFactory { |
45 |
|
|
public: |
46 |
|
|
EIGEN_MAKE_ALIGNED_OPERATOR_NEW |
47 |
|
|
|
48 |
|
|
typedef crocoddyl::MathBaseTpl<double> MathBase; |
49 |
|
|
|
50 |
|
|
explicit ImpulseConstraintModelFactory(); |
51 |
|
|
~ImpulseConstraintModelFactory(); |
52 |
|
|
|
53 |
|
|
std::shared_ptr<crocoddyl::ActionModelAbstract> create( |
54 |
|
|
ImpulseConstraintModelTypes::Type constraint_type, |
55 |
|
|
PinocchioModelTypes::Type model_type) const; |
56 |
|
|
}; |
57 |
|
|
|
58 |
|
|
} // namespace unittest |
59 |
|
|
} // namespace crocoddyl |
60 |
|
|
|
61 |
|
|
#endif // CROCODDYL_IMPULSE_CONSTRAINT_FACTORY_HPP_ |
62 |
|
|
|