5 #include "pinocchio/spatial/fwd.hpp" 6 #include "pinocchio/algorithm/parallel/aba.hpp" 7 #include "pinocchio/algorithm/aba.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)
32 Eigen::MatrixXd
q(model.
nq,batch_size);
33 Eigen::MatrixXd
v(model.
nv,batch_size);
34 Eigen::MatrixXd
tau(model.
nv,batch_size);
35 Eigen::MatrixXd
a(model.
nv,batch_size);
36 Eigen::MatrixXd a_ref(model.
nv,batch_size);
41 v.col(
i) = Eigen::VectorXd::Random(model.
nv);
42 tau.col(
i) = Eigen::VectorXd::Random(model.
nv);
46 aba(num_threads,pool,q,v,tau,a);
50 a_ref.col(
i) =
aba(model,data_ref,q.col(
i),v.col(
i),tau.col(
i));
53 BOOST_CHECK(a == a_ref);
56 BOOST_AUTO_TEST_SUITE_END()
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
const DataTpl< Scalar, Options, JointCollectionTpl >::TangentVectorType & aba(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType1 > &v, const Eigen::MatrixBase< TangentVectorType2 > &tau)
The Articulated-Body algorithm. It computes the forward dynamics, aka the joint accelerations given t...
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
BOOST_AUTO_TEST_CASE(test_parallel_aba)
Main pinocchio namespace.
int nv
Dimension of the velocity vector space.
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.