Line |
Branch |
Exec |
Source |
1 |
|
|
/////////////////////////////////////////////////////////////////////////////// |
2 |
|
|
// BSD 3-Clause License |
3 |
|
|
// |
4 |
|
|
// Copyright (C) 2019-2025, LAAS-CNRS, University of Edinburgh, |
5 |
|
|
// Heriot-Watt University |
6 |
|
|
// Copyright note valid unless otherwise stated in individual files. |
7 |
|
|
// All rights reserved. |
8 |
|
|
/////////////////////////////////////////////////////////////////////////////// |
9 |
|
|
|
10 |
|
|
#ifndef CROCODDYL_STATE_FACTORY_HPP_ |
11 |
|
|
#define CROCODDYL_STATE_FACTORY_HPP_ |
12 |
|
|
|
13 |
|
|
#include "crocoddyl/core/numdiff/state.hpp" |
14 |
|
|
#include "crocoddyl/core/state-base.hpp" |
15 |
|
|
#include "pinocchio_model.hpp" |
16 |
|
|
|
17 |
|
|
namespace crocoddyl { |
18 |
|
|
namespace unittest { |
19 |
|
|
|
20 |
|
|
struct StateModelTypes { |
21 |
|
|
enum Type { |
22 |
|
|
StateVector, |
23 |
|
|
StateMultibody_Hector, |
24 |
|
|
StateMultibody_TalosArm, |
25 |
|
|
StateMultibodyContact2D_TalosArm, |
26 |
|
|
StateMultibody_HyQ, |
27 |
|
|
StateMultibody_Talos, |
28 |
|
|
StateMultibody_RandomHumanoid, |
29 |
|
|
NbStateModelTypes |
30 |
|
|
}; |
31 |
|
✗ |
static std::vector<Type> init_all() { |
32 |
|
✗ |
std::vector<Type> v; |
33 |
|
✗ |
v.reserve(NbStateModelTypes); |
34 |
|
✗ |
for (int i = 0; i < NbStateModelTypes; ++i) { |
35 |
|
✗ |
v.push_back((Type)i); |
36 |
|
|
} |
37 |
|
✗ |
return v; |
38 |
|
|
} |
39 |
|
|
static const std::vector<Type> all; |
40 |
|
|
}; |
41 |
|
|
|
42 |
|
|
std::ostream& operator<<(std::ostream& os, StateModelTypes::Type type); |
43 |
|
|
|
44 |
|
|
class StateModelFactory { |
45 |
|
|
public: |
46 |
|
|
EIGEN_MAKE_ALIGNED_OPERATOR_NEW |
47 |
|
|
|
48 |
|
|
explicit StateModelFactory(); |
49 |
|
|
~StateModelFactory(); |
50 |
|
|
|
51 |
|
|
std::shared_ptr<crocoddyl::StateAbstract> create( |
52 |
|
|
StateModelTypes::Type state_type) const; |
53 |
|
|
}; |
54 |
|
|
|
55 |
|
|
} // namespace unittest |
56 |
|
|
} // namespace crocoddyl |
57 |
|
|
|
58 |
|
|
#endif // CROCODDYL_STATE_FACTORY_HPP_ |
59 |
|
|
|