5 #include "pinocchio/algorithm/center-of-mass.hpp" 6 #include "pinocchio/algorithm/joint-configuration.hpp" 7 #include "pinocchio/algorithm/compute-all-terms.hpp" 8 #include "pinocchio/algorithm/center-of-mass-derivatives.hpp" 9 #include "pinocchio/parsers/sample-models.hpp" 11 #include <boost/test/unit_test.hpp> 12 #include <boost/utility/binary.hpp> 14 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
18 using namespace Eigen;
34 const Eigen::Vector3d vcom0 = data_ref.vcom[0];
35 const double alpha = 1e-8;
39 for(
int k = 0; k < model.
nv; ++k)
43 dvcom_dqn.col(k) = (data_ref.vcom[0]-vcom0)/alpha;
55 BOOST_CHECK(dvcom_dq.isApprox(dvcom_dqn,sqrt(alpha)));
66 BOOST_CHECK(dvcom_dq.isApprox(dvcom_dqn,sqrt(alpha)));
70 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(test_kinematics_derivatives_vcom)
void computeAllTerms(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v)
Computes efficiently all the terms needed for dynamic simulation. It is equivalent to the call at the...
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...
ConfigVectorType lowerPositionLimit
Lower joint configuration limit.
void getCenterOfMassVelocityDerivatives(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< Matrix3xOut > &vcom_partial_dq)
Computes the partial derivatie of the center-of-mass velocity with respect to the joint configuration...
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.
void humanoid(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true)
Create a 28-DOF kinematic chain of a floating humanoid robot.
Main pinocchio namespace.
int nv
Dimension of the velocity vector space.
Eigen::Matrix< Scalar, 3, Eigen::Dynamic, Options > Matrix3x
The 3d jacobian type (temporary)
const DataTpl< Scalar, Options, JointCollectionTpl >::Vector3 & centerOfMass(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const bool computeSubtreeComs=true)
Computes the center of mass position of a given model according to a particular joint configuration...
ConfigVectorType upperPositionLimit
Upper joint configuration limit.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorXd