Go to the documentation of this file.
11 #include <boost/test/unit_test.hpp>
16 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
22 const string model_filename =
24 + std::string(
"/example-robot-data/robots/romeo_description/urdf/romeo_small.urdf");
28 + std::string(
"/example-robot-data/robots/romeo_description/srdf/romeo.srdf");
35 paths.push_back(model_dir);
40 const size_t num_init_col_pairs =
geom_model.collisionPairs.size();
43 const size_t num_col_pairs =
geom_model.collisionPairs.size();
45 BOOST_CHECK(num_init_col_pairs > num_col_pairs);
59 Eigen::VectorXd
q =
model.referenceConfigurations[
"half_sitting"];
60 Eigen::VectorXd
q2 =
model.referenceConfigurations[
"half_sitting2"];
61 BOOST_CHECK(
q.size() ==
model.nq);
62 BOOST_CHECK(!
q.isZero());
64 BOOST_CHECK(
q2.size() ==
model.nq);
65 BOOST_CHECK(!
q2.isZero());
70 const string urdf =
"<robot name='test'>"
71 "<link name='base_link'/>"
72 "<link name='child_link'/>"
73 "<joint type='revolute' name='joint'>"
74 " <parent link='base_link'/>"
75 " <child link='child_link'/>"
76 " <limit effort='30' velocity='1.0' />"
79 const string srdf =
"<robot name='test'>"
80 "<group_state name='reference' group='all'>"
81 " <joint name='joint' value='0.0' />"
88 std::istringstream iss(srdf);
91 Eigen::VectorXd
q =
model.referenceConfigurations[
"reference"];
92 Eigen::VectorXd qexpected(1);
94 BOOST_CHECK(
q.size() ==
model.nq);
95 BOOST_CHECK(
q.isApprox(qexpected));
100 const string urdf =
"<robot name='test'>"
101 "<link name='base_link'/>"
102 "<link name='child_link'/>"
103 "<joint type='continuous' name='joint'>"
104 " <parent link='base_link'/>"
105 " <child link='child_link'/>"
106 " <limit effort='30' velocity='1.0' />"
109 const string srdf =
"<robot name='test'>"
110 "<group_state name='reference' group='all'>"
111 " <joint name='joint' value='0.0' />"
118 std::istringstream iss(srdf);
121 Eigen::VectorXd
q =
model.referenceConfigurations[
"reference"];
122 Eigen::VectorXd qexpected(2);
124 BOOST_CHECK(
q.size() ==
model.nq);
125 BOOST_CHECK(
q.isApprox(qexpected));
140 BOOST_CHECK(
model.rotorInertia(
model.joints[
model.getJointId(
"WAIST_P")].idx_v()) == 1.0);
141 BOOST_CHECK(
model.rotorGearRatio(
model.joints[
model.getJointId(
"WAIST_R")].idx_v()) == 1.0);
144 BOOST_AUTO_TEST_SUITE_END()
void loadReferenceConfigurations(Model &model, const bp::object &filename, const bool verbose=false)
ModelTpl< Scalar, Options, JointCollectionTpl > & buildModelFromXML(const std::string &xml_stream, const typename ModelTpl< Scalar, Options, JointCollectionTpl >::JointModel &rootJoint, const std::string &rootJointName, ModelTpl< Scalar, Options, JointCollectionTpl > &model, const bool verbose=false)
Build the model from an XML stream with a particular joint as root of the model tree inside the model...
bool loadRotorParameters(Model &model, const bp::object &filename, const bool verbose=false)
BOOST_AUTO_TEST_CASE(test_removeCollisionPairs)
GeometryModel & buildGeom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, const std::string &filename, const GeometryType type, GeometryModel &geom_model, ::hpp::fcl::MeshLoaderPtr mesh_loader=::hpp::fcl::MeshLoaderPtr())
Build The GeometryModel from a Mjcf file.
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
ModelTpl< Scalar, Options, JointCollectionTpl > & buildModel(const std::string &filename, ModelTpl< Scalar, Options, JointCollectionTpl > &model, const bool verbose=false)
Build the model from a MJCF file with a fixed joint as root of the model tree.
void loadReferenceConfigurationsFromXML(ModelTpl< Scalar, Options, JointCollectionTpl > &model, std::istream &xmlStream, const bool verbose=false)
Get the reference configurations of a given model associated to a SRDF file. It throws if the SRDF fi...
void removeCollisionPairs(const Model &model, GeometryModel &geom_model, const bp::object &filename, const bool verbose=false)
JointCollectionTpl & model
Main pinocchio namespace.
#define PINOCCHIO_MODEL_DIR
pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:12