7 #include "pinocchio/multibody/geometry.hpp" 8 #include "pinocchio/algorithm/parallel/geometry.hpp" 9 #include "pinocchio/parsers/urdf.hpp" 10 #include "pinocchio/parsers/srdf.hpp" 13 #include <boost/test/unit_test.hpp> 17 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
28 hpp::fcl::MeshLoaderPtr mesh_loader = make_shared<hpp::fcl::CachedMeshLoader>();
30 std::vector<std::string> package_paths(1,package_path);
35 const int num_thread = omp_get_max_threads();
38 pool.
update(geometry_model);
54 hpp::fcl::MeshLoaderPtr mesh_loader = make_shared<hpp::fcl::CachedMeshLoader>();
56 std::vector<std::string> package_paths(1,package_path);
63 GeometryData geometry_data(geometry_model), geometry_data_ref(geometry_model);
68 const bool res_ref =
computeCollisions(model,data_ref,geometry_model,geometry_data_ref,q);
71 BOOST_CHECK(res_ref == res);
72 BOOST_CHECK(geometry_data_ref.collisionPairIndex == geometry_data.collisionPairIndex);
77 BOOST_CHECK(geometry_data_ref.oMg[cp.first] == geometry_data.oMg[cp.first]);
78 BOOST_CHECK(geometry_data_ref.oMg[cp.second] == geometry_data.oMg[cp.second]);
79 BOOST_CHECK( geometry_data_ref.collisionResults[k].getContacts()
80 == geometry_data.collisionResults[k].getContacts());
93 hpp::fcl::MeshLoaderPtr mesh_loader = make_shared<hpp::fcl::CachedMeshLoader>();
95 std::vector<std::string> package_paths(1,package_path);
106 const int num_thread = omp_get_max_threads();
108 Eigen::MatrixXd
q(model.
nq,batch_size);
114 typedef Eigen::Matrix<bool,Eigen::Dynamic,1>
VectorXb;
115 VectorXb
res(batch_size); res.fill(
false);
116 VectorXb res_ref(batch_size); res_ref.fill(
false);
125 BOOST_CHECK(res == res_ref);
128 BOOST_AUTO_TEST_SUITE_END()
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.
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.
#define PINOCCHIO_MODEL_DIR
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
bool computeCollisions(const int num_threads, const GeometryModel &geom_model, GeometryData &geom_data, const bool stopAtFirstCollision=false)
Eigen::Matrix< bool, Eigen::Dynamic, 1 > VectorXb
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 ...
ModelTpl< Scalar, Options, JointCollectionTpl > & buildModel(const std::string &filename, const typename ModelTpl< Scalar, Options, JointCollectionTpl >::JointModel &rootJoint, ModelTpl< Scalar, Options, JointCollectionTpl > &model, const bool verbose=false)
Build the model from a URDF file with a particular joint as root of the model tree inside the model g...
void addAllCollisionPairs()
Add all possible collision pairs.
Main pinocchio namespace.
JointModelFreeFlyerTpl< double > JointModelFreeFlyer
void update(const GeometryData &geometry_data)
Update the geometry datas with the new value.
const GeometryModel & geometry_model() const
Returns the geometry model.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > VectorXd
JointCollectionTpl & model
int nq
Dimension of the configuration vector representation.
BOOST_AUTO_TEST_CASE(test_pool)