$darkmode
pinocchio 4.0.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
check-model.hpp
1 //
2 // Copyright (c) 2025 INRIA
3 //
4 
5 #pragma once
6 
7 // IWYU pragma: begin_keep
8 #include <boost/fusion/container/list.hpp>
9 #include <boost/fusion/container/generation/make_list.hpp>
10 #include <boost/fusion/algorithm/iteration/accumulate.hpp>
11 
12 #include "pinocchio/multibody.hpp"
13 #include "pinocchio/algorithm/check-base.hpp"
14 // IWYU pragma: end_keep
15 
16 namespace pinocchio
17 {
18 
19 #define PINOCCHIO_DEFINE_ALGO_CHECKER(NAME) \
20  struct NAME##Checker : public AlgorithmCheckerBase<NAME##Checker> \
21  { \
22  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl> \
23  bool checkModel_impl(const ModelTpl<Scalar, Options, JointCollectionTpl> &) const; \
24  }
25 
27  PINOCCHIO_DEFINE_ALGO_CHECKER(Parent);
29  PINOCCHIO_DEFINE_ALGO_CHECKER(Mimic);
30 
31  template<class... D>
32  struct AlgorithmCheckerList : AlgorithmCheckerBase<AlgorithmCheckerList<D...>>
33  {
34  typedef typename boost::fusion::list<D...> ArgType;
35 
36  AlgorithmCheckerList(const ArgType & checkerList)
37  : checkerList(checkerList)
38  {
39  }
40 
41  // Calls model.check for each checker in the fusion::list.
42  // Each list element is supposed to implement the AlgorithmCheckerBase API.
43  template<typename Scalar, int Options, template<typename, int> class JointCollectionTpl>
44  bool checkModel_impl(const ModelTpl<Scalar, Options, JointCollectionTpl> & model) const;
45 
46  const ArgType & checkerList;
47  };
48 
49  template<class... T>
50  AlgorithmCheckerList<T...> makeAlgoCheckerList(const T &... args)
51  {
52  return AlgorithmCheckerList<T...>(boost::fusion::make_list(args...));
53  }
54 
55 } // namespace pinocchio
56 
57 /* --- Details -------------------------------------------------------------------- */
58 
59 // IWYU pragma: begin_exports
60 #include "pinocchio/src/algorithm/check-model.hxx"
61 // IWYU pragma: end_exports
Main pinocchio namespace.
Definition: treeview.dox:11