unittest/sample-models.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2018 CNRS
3 //
4 
5 #include <iostream>
6 
12 
13 #include <boost/test/unit_test.hpp>
14 
15 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
16 
17 BOOST_AUTO_TEST_CASE(build_model_sample_humanoid_random)
18 {
21 
22  BOOST_CHECK(model.nq == 33);
23  BOOST_CHECK(model.nv == 32);
24 
25  pinocchio::Model modelff;
27 
28  BOOST_CHECK(modelff.nq == 32);
29  BOOST_CHECK(modelff.nv == 32);
30 }
31 
32 BOOST_AUTO_TEST_CASE(build_model_sample_manipulator)
33 {
36 
37  BOOST_CHECK(model.nq == 6);
38  BOOST_CHECK(model.nv == 6);
39 
40 #ifdef PINOCCHIO_WITH_HPP_FCL
43  pinocchio::buildModels::manipulatorGeometries(model, geom);
44 #endif
45 }
46 
47 BOOST_AUTO_TEST_CASE(build_model_sample_humanoid)
48 {
52 
53  BOOST_CHECK(model.nq == 35);
54  BOOST_CHECK(model.nv == 34);
55 
56 #ifdef PINOCCHIO_WITH_HPP_FCL
58  pinocchio::buildModels::humanoidGeometries(model, geom);
59  pinocchio::GeometryData geomdata(geom);
60 
61  Eigen::VectorXd q = pinocchio::neutral(model);
64 #endif
65 
66  /* We might want to check here the joint namings, and validate the
67  * direct geometry with respect to reference values. */
68 }
69 
70 BOOST_AUTO_TEST_SUITE_END()
pinocchio::DataTpl
Definition: context/generic.hpp:25
pinocchio::forwardKinematics
void forwardKinematics(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q)
Update the joint placements according to the current joint configuration.
pinocchio::updateGeometryPlacements
void updateGeometryPlacements(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const GeometryModel &geom_model, GeometryData &geom_data, const Eigen::MatrixBase< ConfigVectorType > &q)
Apply a forward kinematics and update the placement of the geometry objects.
kinematics.hpp
model.hpp
setup.data
data
Definition: cmake/cython/setup.in.py:48
pinocchio::buildModels::humanoidRandom
void humanoidRandom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true)
Create a humanoid kinematic tree with 6-DOF limbs and random joint placements.
pinocchio::buildModels::manipulator
void manipulator(ModelTpl< Scalar, Options, JointCollectionTpl > &model)
Create a 6-DOF kinematic chain shoulder-elbow-wrist.
pinocchio::GeometryData
Definition: multibody/geometry.hpp:233
anymal-simulation.model
model
Definition: anymal-simulation.py:8
joint-configuration.hpp
geometry.hpp
q
q
pinocchio::buildModels::humanoid
void humanoid(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true)
Create a 28-DOF kinematic chain of a floating humanoid robot.
pinocchio::ModelTpl::nv
int nv
Dimension of the velocity vector space.
Definition: multibody/model.hpp:101
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(build_model_sample_humanoid_random)
Definition: unittest/sample-models.cpp:17
pinocchio::GeometryModel
Definition: multibody/geometry.hpp:50
pinocchio::neutral
void neutral(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ReturnType > &qout)
Return the neutral configuration element related to the model configuration space.
Definition: joint-configuration.hpp:363
sample-models.hpp
pinocchio::ModelTpl
Definition: context/generic.hpp:20
pinocchio::ModelTpl::nq
int nq
Dimension of the configuration vector representation.
Definition: multibody/model.hpp:98


pinocchio
Author(s):
autogenerated on Fri Nov 1 2024 02:41:48