5 #include "pinocchio/spatial/fwd.hpp" 6 #include "pinocchio/algorithm/parallel/rnea.hpp" 7 #include "pinocchio/algorithm/rnea.hpp" 8 #include "pinocchio/algorithm/joint-configuration.hpp" 9 #include "pinocchio/parsers/sample-models.hpp" 10 #include "pinocchio/utils/timer.hpp" 14 #include <boost/test/unit_test.hpp> 15 #include <boost/utility/binary.hpp> 19 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
30 const int num_thread = omp_get_max_threads();
32 Eigen::MatrixXd
q(model.
nq,batch_size);
33 Eigen::MatrixXd
v(model.
nv,batch_size);
34 Eigen::MatrixXd
a(model.
nv,batch_size);
35 Eigen::MatrixXd
tau(model.
nv,batch_size);
36 Eigen::MatrixXd tau_ref(model.
nv,batch_size);
41 v.col(
i) = Eigen::VectorXd::Random(model.
nv);
42 a.col(
i) = Eigen::VectorXd::Random(model.
nv);
46 rnea(num_thread,pool,q,v,a,tau);
50 tau_ref.col(
i) =
rnea(model,data_ref,q.col(
i),v.col(
i),a.col(
i));
53 BOOST_CHECK(tau == tau_ref);
57 BOOST_AUTO_TEST_SUITE_END()
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
void rnea(const int num_threads, ModelPoolTpl< Scalar, Options, JointCollectionTpl > &pool, const Eigen::MatrixBase< ConfigVectorPool > &q, const Eigen::MatrixBase< TangentVectorPool1 > &v, const Eigen::MatrixBase< TangentVectorPool2 > &a, const Eigen::MatrixBase< TangentVectorPool3 > &tau)
The Recursive Newton-Euler algorithm. It computes the inverse dynamics, aka the joint torques accordi...
ConfigVectorType lowerPositionLimit
Lower joint configuration limit.
void randomConfiguration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &lowerLimits, const Eigen::MatrixBase< ConfigVectorIn2 > &upperLimits, const Eigen::MatrixBase< ReturnType > &qout)
Generate a configuration vector uniformly sampled among provided limits.
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
Main pinocchio namespace.
int nv
Dimension of the velocity vector space.
BOOST_AUTO_TEST_CASE(test_parallel_rnea)
ConfigVectorType upperPositionLimit
Upper joint configuration limit.
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
int nq
Dimension of the configuration vector representation.