7 #include "pinocchio/multibody/model.hpp" 8 #include "pinocchio/parsers/urdf.hpp" 9 #include "pinocchio/parsers/srdf.hpp" 11 #include <boost/test/unit_test.hpp> 16 BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE )
22 const string model_filename =
PINOCCHIO_MODEL_DIR + std::string(
"/example-robot-data/robots/romeo_description/urdf/romeo_small.urdf");
30 vector<string> paths; paths.push_back(model_dir);
35 const size_t num_init_col_pairs = geom_model.
collisionPairs.size();
40 BOOST_CHECK(num_init_col_pairs > num_col_pairs);
56 BOOST_CHECK(q.size() == model.
nq);
57 BOOST_CHECK(!q.isZero());
59 BOOST_CHECK(q2.size() == model.
nq);
60 BOOST_CHECK(!q2.isZero());
69 "<link name='base_link'/>" 70 "<link name='child_link'/>" 71 "<joint type='revolute' name='joint'>" 72 " <parent link='base_link'/>" 73 " <child link='child_link'/>" 74 " <limit effort='30' velocity='1.0' />" 79 "<group_state name='reference' group='all'>" 80 " <joint name='joint' value='0.0' />" 87 std::istringstream iss (srdf);
92 BOOST_CHECK(q.size() == model.
nq);
93 BOOST_CHECK(q.isApprox(qexpected));
100 "<link name='base_link'/>" 101 "<link name='child_link'/>" 102 "<joint type='continuous' name='joint'>" 103 " <parent link='base_link'/>" 104 " <child link='child_link'/>" 105 " <limit effort='30' velocity='1.0' />" 109 "<robot name='test'>" 110 "<group_state name='reference' group='all'>" 111 " <joint name='joint' value='0.0' />" 118 std::istringstream iss (srdf);
123 BOOST_CHECK(q.size() == model.
nq);
124 BOOST_CHECK(q.isApprox(qexpected));
143 BOOST_AUTO_TEST_SUITE_END()
void loadReferenceConfigurations(ModelTpl< Scalar, Options, JointCollectionTpl > &model, const std::string &filename, const bool verbose=false)
Get the reference configurations of a given model associated to a SRDF file. It throws if the SRDF fi...
JointModelVector joints
Model of joint i, encapsulated in a JointModelAccessor.
void removeCollisionPairs(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, GeometryModel &geom_model, const std::string &filename, const bool verbose=false)
Deactive all possible collision pairs mentioned in the SRDF file. It throws if the SRDF file is incor...
CollisionPairVector collisionPairs
Vector of collision pairs.
TangentVectorType rotorInertia
Vector of rotor inertia parameters.
#define PINOCCHIO_MODEL_DIR
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
ConfigVectorMap referenceConfigurations
Map of reference configurations, indexed by user given names.
TangentVectorType rotorGearRatio
Vector of rotor gear ratio parameters.
GeometryModel & buildGeom(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const std::string &filename, const GeometryType type, GeometryModel &geom_model, const std::vector< std::string > &package_paths=std::vector< std::string >(), ::hpp::fcl::MeshLoaderPtr mesh_loader=::hpp::fcl::MeshLoaderPtr())
Build The GeometryModel from a URDF file. Search for meshes in the directories specified by the user ...
bool loadRotorParameters(ModelTpl< Scalar, Options, JointCollectionTpl > &model, const std::string &filename, const bool verbose=false)
Load the rotor params of a given model associated to a SRDF file. It throws if the SRDF file is incor...
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 addAllCollisionPairs()
Add all possible collision pairs.
Model buildModel(const std::string &filename, const std::string &model_name)
Load a model from a Python script.
Main pinocchio namespace.
JointIndex getJointId(const std::string &name) const
Return the index of a joint given by its name.
ModelTpl< Scalar, Options, JointCollectionTpl > & buildModelFromXML(const std::string &xml_stream, const typename ModelTpl< Scalar, Options, JointCollectionTpl >::JointModel &rootJoint, 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...
BOOST_AUTO_TEST_CASE(test_removeCollisionPairs)
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorXd
JointCollectionTpl & model
int nq
Dimension of the configuration vector representation.