5 #include "pinocchio/codegen/cppadcg.hpp" 6 #include "pinocchio/codegen/code-generator-algo.hpp" 7 #include "pinocchio/multibody/model.hpp" 8 #include "pinocchio/algorithm/joint-configuration.hpp" 12 #include <boost/test/unit_test.hpp> 13 #include <boost/utility/binary.hpp> 17 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
32 std::vector<Eigen::VectorXd> results_q(2,Eigen::VectorXd::Zero(model.
nq));
33 std::vector<Eigen::VectorXd> results_v(2,Eigen::VectorXd::Zero(model.
nv));
42 BOOST_CHECK(results_q[1].
isApprox(results_q[0]));
45 BOOST_CHECK(results_q[0].
isApprox(q1));
54 BOOST_CHECK(results_v[1].
isApprox(results_v[0]));
57 BOOST_CHECK(results_v[0].
isZero());
65 std::vector<Eigen::MatrixXd> results_J(2,Eigen::MatrixXd::Zero(model.
nv,model.
nv));
68 BOOST_CHECK(results_J[1].
isApprox(results_J[0]));
73 BOOST_CHECK(results_J[1].
isApprox(results_J[0]));
77 BOOST_CHECK((-results_J[0]).isIdentity());
81 BOOST_CHECK(results_J[0].isIdentity());
85 BOOST_AUTO_TEST_SUITE_END()
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
void evalFunction(const Eigen::MatrixBase< ConfigVectorType1 > &q0, const Eigen::MatrixBase< ConfigVectorType2 > &q1, const Eigen::MatrixBase< TangentVector > &v)
void integrate(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v, const Eigen::MatrixBase< ReturnType > &qout)
Integrate a configuration vector for the specified model for a tangent vector during one unit time...
void dDifference(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVector1 > &q0, const Eigen::MatrixBase< ConfigVector2 > &q1, const Eigen::MatrixBase< JacobianMatrix > &J, const ArgumentPosition arg)
Computes the Jacobian of a small variation of the configuration vector into the tangent space at iden...
bool isZero(const Eigen::MatrixBase< MatrixLike > &m, const typename MatrixLike::RealScalar &prec=Eigen::NumTraits< typename MatrixLike::Scalar >::dummy_precision())
void difference(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &q0, const Eigen::MatrixBase< ConfigVectorIn2 > &q1, const Eigen::MatrixBase< ReturnType > &dvout)
Compute the tangent vector that must be integrated during one unit time to go from q0 to q1...
void evalFunction(const Eigen::MatrixBase< ConfigVectorType1 > &q0, const Eigen::MatrixBase< ConfigVectorType2 > &q1, const Eigen::MatrixBase< JacobianMatrix > &J, const ArgumentPosition arg)
BOOST_AUTO_TEST_CASE(test_joint_configuration_code_generation)
void loadLib(const bool generate_if_not_exist=true)
bool isApprox(const Shape &s1, const Shape &s2, const FCL_REAL tol)
void buildAllJointsModel(Model &model)
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorIn1 > const Eigen::MatrixBase< ConfigVectorIn2 > & q1
Main pinocchio namespace.
int nv
Dimension of the velocity vector space.
void normalize(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &qout)
Normalize a configuration vector.
void evalFunction(const Eigen::MatrixBase< ConfigVectorType1 > &q, const Eigen::MatrixBase< TangentVector > &v, const Eigen::MatrixBase< ConfigVectorType2 > &qout)
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorXd
JointCollectionTpl & model
int nq
Dimension of the configuration vector representation.