Go to the documentation of this file.
18 #include <boost/test/unit_test.hpp>
22 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
41 BOOST_CHECK(
data.nle.isApprox(data_other.
nle));
42 BOOST_CHECK(Eigen::MatrixXd(
data.M.triangularView<Eigen::Upper>())
43 .isApprox(Eigen::MatrixXd(data_other.
M.triangularView<Eigen::Upper>())));
44 BOOST_CHECK(
data.J.isApprox(data_other.
J));
45 BOOST_CHECK(
data.dJ.isApprox(data_other.
dJ));
46 BOOST_CHECK(
data.Jcom.isApprox(data_other.
Jcom));
47 BOOST_CHECK(
data.Ag.isApprox(data_other.
Ag));
48 BOOST_CHECK(
data.dAg.isApprox(data_other.
dAg));
49 BOOST_CHECK(
data.hg.isApprox(data_other.
hg));
50 BOOST_CHECK(
data.Ig.isApprox(data_other.
Ig));
51 BOOST_CHECK(
data.g.isApprox(data_other.
g));
53 for (
int k = 0; k <
model.njoints; ++k)
55 BOOST_CHECK(
data.com[(
size_t)k].isApprox(data_other.com[(
size_t)k]));
56 BOOST_CHECK(
data.vcom[(
size_t)k].isApprox(data_other.vcom[(
size_t)k]));
57 BOOST_CHECK_CLOSE(
data.mass[(
size_t)k], data_other.
mass[(
size_t)k], 1e-12);
66 using namespace Eigen;
71 VectorXd
q(VectorXd::Random(
model.nq));
72 VectorXd
v(VectorXd::Random(
model.nv));
101 BOOST_AUTO_TEST_SUITE_END()
MatrixXs M
The joint space inertia matrix (a square matrix of dim model.nv).
Scalar computePotentialEnergy(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data)
Computes the potential energy of the system, i.e. the potential energy linked to the gravity field....
VectorXs g
Vector of generalized gravity (dim model.nv).
Matrix6x dAg
Centroidal Momentum Matrix Time Variation.
std::vector< Scalar > mass
Vector of subtree mass. In other words, mass[j] is the mass of the subtree supported by joint ....
Matrix6x dJ
Derivative of the Jacobian with respect to the time.
Scalar kinetic_energy
Kinetic energy of the system.
void humanoidRandom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true)
Create a humanoid kinematic tree with 6-DOF limbs and random joint placements.
const DataTpl< Scalar, Options, JointCollectionTpl >::MatrixXs & crba(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Convention convention=Convention::LOCAL)
Computes the upper triangular part of the joint space inertia matrix M by using the Composite Rigid B...
const DataTpl< Scalar, Options, JointCollectionTpl >::Matrix6x & computeJointJacobiansTimeVariation(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v)
Computes the full model Jacobian variations with respect to time. It corresponds to dJ/dt which depen...
BOOST_AUTO_TEST_CASE(test_against_algo)
const DataTpl< Scalar, Options, JointCollectionTpl >::Matrix6x & dccrba(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v)
Computes the time derivative of the Centroidal Momentum Matrix according to the current configuration...
Scalar potential_energy
Potential energy of the system.
Matrix3x Jcom
Jacobian of center of mass.
Matrix6x Ag
Centroidal Momentum Matrix.
const DataTpl< Scalar, Options, JointCollectionTpl >::TangentVectorType & nonLinearEffects(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v)
Computes the non-linear effects (Corriolis, centrifual and gravitationnal effects),...
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
const DataTpl< Scalar, Options, JointCollectionTpl >::Matrix3x & getJacobianComFromCrba(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data)
Extracts both the jacobian of the center of mass (CoM), the total mass of the system and the CoM posi...
Scalar computeKineticEnergy(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data)
Computes the kinetic energy of the system. The result is accessible through data.kinetic_energy.
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
Matrix6x J
Jacobian of joint placements.
Force hg
Centroidal momentum quantity.
void run_test(const Model &model, const Eigen::VectorXd &q, const Eigen::VectorXd &v)
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...
Inertia Ig
Centroidal Composite Rigid Body Inertia.
void normalize(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &qout)
Normalize a configuration vector.
JointCollectionTpl & model
Main pinocchio namespace.
VectorXs nle
Vector of Non Linear Effects (dim model.nv). It corresponds to concatenation of the Coriolis,...
const DataTpl< Scalar, Options, JointCollectionTpl >::TangentVectorType & computeGeneralizedGravity(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q)
Computes the generalized gravity contribution of the Lagrangian dynamics:
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....
pinocchio
Author(s):
autogenerated on Thu Dec 19 2024 03:41:28