1 |
|
|
/////////////////////////////////////////////////////////////////////////////// |
2 |
|
|
// BSD 3-Clause License |
3 |
|
|
// |
4 |
|
|
// Copyright (C) 2021, LAAS-CNRS, University of Edinburgh, University of Trento |
5 |
|
|
// Copyright note valid unless otherwise stated in individual files. |
6 |
|
|
// All rights reserved. |
7 |
|
|
/////////////////////////////////////////////////////////////////////////////// |
8 |
|
|
|
9 |
|
|
#ifndef CROCODDYL_CONTROL_FACTORY_HPP_ |
10 |
|
|
#define CROCODDYL_CONTROL_FACTORY_HPP_ |
11 |
|
|
|
12 |
|
|
#include <vector> |
13 |
|
|
|
14 |
|
|
#include "crocoddyl/core/control-base.hpp" |
15 |
|
|
#include "crocoddyl/core/fwd.hpp" |
16 |
|
|
#include "crocoddyl/core/utils/exception.hpp" |
17 |
|
|
|
18 |
|
|
namespace crocoddyl { |
19 |
|
|
namespace unittest { |
20 |
|
|
|
21 |
|
|
struct ControlTypes { |
22 |
|
|
enum Type { PolyZero, PolyOne, PolyTwoRK3, PolyTwoRK4, NbControlTypes }; |
23 |
|
23 |
static std::vector<Type> init_all() { |
24 |
|
23 |
std::vector<Type> v; |
25 |
✓✗ |
23 |
v.reserve(NbControlTypes); |
26 |
✓✓ |
115 |
for (int i = 0; i < NbControlTypes; ++i) { |
27 |
✓✗ |
92 |
v.push_back((Type)i); |
28 |
|
|
} |
29 |
|
23 |
return v; |
30 |
|
|
} |
31 |
|
|
static const std::vector<Type> all; |
32 |
|
|
}; |
33 |
|
|
|
34 |
|
|
std::ostream& operator<<(std::ostream& os, ControlTypes::Type type); |
35 |
|
|
|
36 |
|
|
class ControlFactory { |
37 |
|
|
public: |
38 |
|
|
EIGEN_MAKE_ALIGNED_OPERATOR_NEW |
39 |
|
|
|
40 |
|
|
explicit ControlFactory(); |
41 |
|
|
~ControlFactory(); |
42 |
|
|
|
43 |
|
|
boost::shared_ptr<crocoddyl::ControlParametrizationModelAbstract> create( |
44 |
|
|
ControlTypes::Type control_type, const std::size_t nu) const; |
45 |
|
|
}; |
46 |
|
|
|
47 |
|
|
} // namespace unittest |
48 |
|
|
} // namespace crocoddyl |
49 |
|
|
|
50 |
|
|
#endif // CROCODDYL_CONTROL_FACTORY_HPP_ |