Go to the documentation of this file.
10 #include "../utils/model-generator.hpp"
12 #include <boost/test/unit_test.hpp>
13 #include <boost/utility/binary.hpp>
19 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
29 Eigen::VectorXd
q1 = Eigen::VectorXd::Random(
model.nq);
30 Eigen::VectorXd
q2 = Eigen::VectorXd::Random(
model.nq);
34 Eigen::VectorXd
v = Eigen::VectorXd::Random(
model.nv);
35 std::vector<Eigen::VectorXd> results_q(2, Eigen::VectorXd::Zero(
model.nq));
36 std::vector<Eigen::VectorXd> results_v(2, Eigen::VectorXd::Zero(
model.nv));
45 BOOST_CHECK(results_q[1].
isApprox(results_q[0]));
57 BOOST_CHECK(results_v[1].
isApprox(results_v[0]));
60 BOOST_CHECK(results_v[0].
isZero());
68 std::vector<Eigen::MatrixXd> results_J(2, Eigen::MatrixXd::Zero(
model.nv,
model.nv));
71 BOOST_CHECK(results_J[1].
isApprox(results_J[0]));
76 BOOST_CHECK(results_J[1].
isApprox(results_J[0]));
80 BOOST_CHECK((-results_J[0]).isIdentity());
84 BOOST_CHECK(results_J[0].isIdentity());
88 std::remove(
"cg_integrate_eval_.dylib");
89 std::remove(
"cg_difference_eval_.dylib");
90 std::remove(
"cg_dDifference_eval_.dylib");
94 BOOST_AUTO_TEST_SUITE_END()
void evalFunction(const Eigen::MatrixBase< ConfigVectorType1 > &q0, const Eigen::MatrixBase< ConfigVectorType2 > &q1, const Eigen::MatrixBase< TangentVector > &v)
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 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 buildAllJointsModel(Model &model)
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
void compileAndLoadLib(const std::string &gcc_path)
bool DELETE_CODEGEN_LIBS_AFTER_TEST
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorIn1 > const Eigen::MatrixBase< ConfigVectorIn2 > & q1
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...
void evalFunction(const Eigen::MatrixBase< ConfigVectorType1 > &q, const Eigen::MatrixBase< TangentVector > &v, const Eigen::MatrixBase< ConfigVectorType2 > &qout)
ModelTpl< context::Scalar, context::Options > Model
void normalize(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &qout)
Normalize a configuration vector.
JointCollectionTpl & model
Main pinocchio namespace.
bool isApprox(const Box &s1, const Box &s2, const FCL_REAL tol)
pinocchio
Author(s):
autogenerated on Fri Nov 1 2024 02:41:45