5 #include "pinocchio/multibody/data.hpp" 6 #include "pinocchio/multibody/model.hpp" 7 #include "pinocchio/parsers/sample-models.hpp" 9 #include "pinocchio/algorithm/check.hpp" 11 #include <boost/test/unit_test.hpp> 12 #include <boost/utility/binary.hpp> 16 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
21 Data empty_data(empty_model);
23 BOOST_CHECK(empty_model.
check(empty_data));
38 for(
int k = 0; k < nv_joint; ++k)
41 BOOST_CHECK(data.
end_idx_v_fromRow[(
size_t)(idx_joint+k)] == idx_joint+nv_joint-1);
53 for(
size_t k = 0; k < (size_t)model.
nv; ++k)
60 const std::vector<int> & support_parent = data.
supports_fromRow[(size_t)parent_id];
61 BOOST_CHECK(support.size() == support_parent.size()+1);
62 for(
size_t j = 0; j < support_parent.size(); ++j)
64 BOOST_CHECK(support[j] == support_parent[j]);
68 BOOST_CHECK(support.back() == (int)k);
80 BOOST_CHECK(data == data);
81 BOOST_CHECK(data == data_copy);
83 data_copy.oMi[0].setRandom();
84 BOOST_CHECK(data != data_copy);
95 data.f[0].setRandom();
97 BOOST_CHECK(data.f[0] == f[0]);
106 for(
size_t k = 0; k < 20; ++k)
107 datas.push_back(
Data(model));
110 BOOST_AUTO_TEST_SUITE_END()
typedef PINOCCHIO_ALIGNED_STD_VECTOR(JointData) JointDataVector
JointModelVector joints
Model of joint i, encapsulated in a JointModelAccessor.
std::vector< std::vector< int > > supports_fromRow
Each element of this vector corresponds to the ordered list of indexes belonging to the supporting tr...
int njoints
Number of joints.
std::vector< int > end_idx_v_fromRow
End index of the Joint motion subspace.
Specialization of an std::vector with an aligned allocator. This specialization might be used when th...
bool check(const AlgorithmCheckerBase< D > &checker=AlgorithmCheckerBase< D >()) const
Check the validity of the attributes of Model with respect to the specification of some algorithms...
pinocchio::JointIndex JointIndex
Main pinocchio namespace.
std::vector< int > start_idx_v_fromRow
Starting index of the Joint motion subspace.
int nv
Dimension of the velocity vector space.
std::vector< int > parents_fromRow
First previous non-zero row in M (used in Cholesky Decomposition).
BOOST_AUTO_TEST_CASE(test_empty_model)
void humanoidRandom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true)
Create a humanoid kinematic tree with 6-DOF limbs and random joint placements.
JointCollectionTpl & model