GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: unittest/factory/state.hpp Lines: 6 6 100.0 %
Date: 2024-02-13 11:12:33 Branches: 4 6 66.7 %

Line Branch Exec Source
1
///////////////////////////////////////////////////////////////////////////////
2
// BSD 3-Clause License
3
//
4
// Copyright (C) 2019-2020, LAAS-CNRS, University of Edinburgh
5
// Copyright note valid unless otherwise stated in individual files.
6
// All rights reserved.
7
///////////////////////////////////////////////////////////////////////////////
8
9
#ifndef CROCODDYL_STATE_FACTORY_HPP_
10
#define CROCODDYL_STATE_FACTORY_HPP_
11
12
#include "crocoddyl/core/numdiff/state.hpp"
13
#include "crocoddyl/core/state-base.hpp"
14
#include "crocoddyl/core/utils/exception.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
23
  static std::vector<Type> init_all() {
32
23
    std::vector<Type> v;
33
23
    v.reserve(NbStateModelTypes);
34
184
    for (int i = 0; i < NbStateModelTypes; ++i) {
35
161
      v.push_back((Type)i);
36
    }
37
23
    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
  boost::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_