Line |
Branch |
Exec |
Source |
1 |
|
|
// |
2 |
|
|
// Copyright (c) 2015-2018 CNRS |
3 |
|
|
// |
4 |
|
|
|
5 |
|
|
#include <iostream> |
6 |
|
|
|
7 |
|
|
#include "pinocchio/multibody/model.hpp" |
8 |
|
|
#include "pinocchio/algorithm/joint-configuration.hpp" |
9 |
|
|
#include "pinocchio/algorithm/kinematics.hpp" |
10 |
|
|
#include "pinocchio/algorithm/geometry.hpp" |
11 |
|
|
#include "pinocchio/multibody/sample-models.hpp" |
12 |
|
|
|
13 |
|
|
#include <boost/test/unit_test.hpp> |
14 |
|
|
|
15 |
|
|
BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE) |
16 |
|
|
|
17 |
|
✗ |
BOOST_AUTO_TEST_CASE(build_model_sample_humanoid_random) |
18 |
|
|
{ |
19 |
|
✗ |
pinocchio::Model model; |
20 |
|
✗ |
pinocchio::buildModels::humanoidRandom(model, true); |
21 |
|
|
|
22 |
|
✗ |
BOOST_CHECK(model.nq == 33); |
23 |
|
✗ |
BOOST_CHECK(model.nv == 32); |
24 |
|
|
|
25 |
|
✗ |
pinocchio::Model modelff; |
26 |
|
✗ |
pinocchio::buildModels::humanoidRandom(modelff, false); |
27 |
|
|
|
28 |
|
✗ |
BOOST_CHECK(modelff.nq == 32); |
29 |
|
✗ |
BOOST_CHECK(modelff.nv == 32); |
30 |
|
|
} |
31 |
|
|
|
32 |
|
✗ |
BOOST_AUTO_TEST_CASE(build_model_sample_manipulator) |
33 |
|
|
{ |
34 |
|
✗ |
pinocchio::Model model; |
35 |
|
✗ |
pinocchio::buildModels::manipulator(model); |
36 |
|
|
|
37 |
|
✗ |
BOOST_CHECK(model.nq == 6); |
38 |
|
✗ |
BOOST_CHECK(model.nv == 6); |
39 |
|
|
|
40 |
|
|
#ifdef PINOCCHIO_WITH_HPP_FCL |
41 |
|
✗ |
pinocchio::Data data(model); |
42 |
|
✗ |
pinocchio::GeometryModel geom; |
43 |
|
✗ |
pinocchio::buildModels::manipulatorGeometries(model, geom); |
44 |
|
|
#endif |
45 |
|
|
} |
46 |
|
|
|
47 |
|
✗ |
BOOST_AUTO_TEST_CASE(build_model_sample_humanoid) |
48 |
|
|
{ |
49 |
|
✗ |
pinocchio::Model model; |
50 |
|
✗ |
pinocchio::buildModels::humanoid(model); |
51 |
|
✗ |
pinocchio::Data data(model); |
52 |
|
|
|
53 |
|
✗ |
BOOST_CHECK(model.nq == 35); |
54 |
|
✗ |
BOOST_CHECK(model.nv == 34); |
55 |
|
|
|
56 |
|
|
#ifdef PINOCCHIO_WITH_HPP_FCL |
57 |
|
✗ |
pinocchio::GeometryModel geom; |
58 |
|
✗ |
pinocchio::buildModels::humanoidGeometries(model, geom); |
59 |
|
✗ |
pinocchio::GeometryData geomdata(geom); |
60 |
|
|
|
61 |
|
✗ |
Eigen::VectorXd q = pinocchio::neutral(model); |
62 |
|
✗ |
pinocchio::forwardKinematics(model, data, q); |
63 |
|
✗ |
pinocchio::updateGeometryPlacements(model, data, geom, geomdata, q); |
64 |
|
|
#endif |
65 |
|
|
|
66 |
|
|
/* We might want to check here the joint namings, and validate the |
67 |
|
|
* direct geometry with respect to reference values. */ |
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
BOOST_AUTO_TEST_SUITE_END() |
71 |
|
|
|