algo-check.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016-2022 CNRS INRIA
3 //
4 
5 #include <boost/fusion/container/generation/make_list.hpp>
13 #include <iostream>
14 
15 using namespace pinocchio;
16 
17 #include <boost/test/unit_test.hpp>
18 #include <boost/utility/binary.hpp>
19 
20 // Dummy checker.
21 struct Check1 : public AlgorithmCheckerBase<Check1>
22 {
23  bool checkModel_impl(const Model &) const
24  {
25  return true;
26  }
27 };
28 
29 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
30 
32 {
33  using namespace boost::fusion;
34 
37 
38  BOOST_CHECK(model.check(Check1()));
39  BOOST_CHECK(model.check(CRBAChecker()));
40  BOOST_CHECK(model.check(ABAChecker()));
41 
42  BOOST_CHECK(model.check(makeAlgoCheckerList(Check1(), ParentChecker(), CRBAChecker())));
43  BOOST_CHECK(model.check(DEFAULT_CHECKERS));
44 
46  BOOST_CHECK(checkData(model, data));
47  BOOST_CHECK(model.check(data));
48 
49  BOOST_FOREACH (Inertia & Y, model.inertias)
50  {
51  Y.inertia().data().fill(-1.);
52  }
53  BOOST_CHECK(!model.check(ABAChecker())); // some inertias are negative ... check fail.
54 }
55 
56 BOOST_AUTO_TEST_SUITE_END()
pinocchio::InertiaTpl< context::Scalar, context::Options >
pinocchio::DataTpl
Definition: context/generic.hpp:25
pinocchio::AlgorithmCheckerBase
CRTP class describing the API of the checkers.
Definition: algorithm/check.hpp:22
Check1
Definition: algo-check.cpp:21
model.hpp
setup.data
data
Definition: cmake/cython/setup.in.py:48
pinocchio::buildModels::humanoidRandom
void humanoidRandom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true)
Create a humanoid kinematic tree with 6-DOF limbs and random joint placements.
aba.hpp
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(test_check)
Definition: algo-check.cpp:31
data.hpp
default-check.hpp
check.hpp
pinocchio::checkData
bool checkData(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const DataTpl< Scalar, Options, JointCollectionTpl > &data)
Check1::checkModel_impl
bool checkModel_impl(const Model &) const
Definition: algo-check.cpp:23
DEFAULT_CHECKERS
#define DEFAULT_CHECKERS
Definition: default-check.hpp:20
boost::fusion
Definition: fusion.hpp:27
Y
Y
sample-models.hpp
pinocchio::ModelTpl
Definition: context/generic.hpp:20
crba.hpp
pinocchio::model
JointCollectionTpl & model
Definition: joint-configuration.hpp:1082
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Thu Dec 19 2024 03:41:25