#include <limits>
#include <boost/filesystem/fstream.hpp>
#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <assimp/DefaultLogger.hpp>
#include <assimp/IOStream.hpp>
#include <assimp/IOSystem.hpp>
#include <assimp/scene.h>
#include <assimp/Importer.hpp>
#include <assimp/postprocess.h>
#include <hpp/fcl/BV/OBBRSS.h>
#include <hpp/fcl/BVH/BVH_model.h>
Classes | |
struct | TriangleAndVertices |
Typedefs | |
typedef fcl::BVHModel < fcl::OBBRSS > | PolyhedronType |
typedef boost::shared_ptr < PolyhedronType > | PolyhedronPtrType |
Functions | |
void | buildMesh (const ::urdf::Vector3 &scale, const aiScene *scene, const aiNode *node, std::vector< unsigned > &subMeshIndexes, const PolyhedronPtrType &mesh, TriangleAndVertices &tv) |
Recursive procedure for building a mesh. | |
void | meshFromAssimpScene (const std::string &name, const ::urdf::Vector3 &scale, const aiScene *scene, const PolyhedronPtrType &mesh) |
Convert an assimp scene to a mesh. | |
void | loadPolyhedronFromResource (const std::string &resource_path, const ::urdf::Vector3 &scale, const PolyhedronPtrType &polyhedron) |
Read a mesh file and convert it to a polyhedral mesh. | |
std::string | fromURDFMeshPathToAbsolutePath (const std::string &urdf_mesh_path, const std::string &meshRootDir) |
Transform a cURL readable path (package://..) to an absolute path for urdf collision path. |
typedef boost::shared_ptr<PolyhedronType> PolyhedronPtrType |
typedef fcl::BVHModel< fcl::OBBRSS > PolyhedronType |
void buildMesh | ( | const ::urdf::Vector3 & | scale, |
const aiScene * | scene, | ||
const aiNode * | node, | ||
std::vector< unsigned > & | subMeshIndexes, | ||
const PolyhedronPtrType & | mesh, | ||
TriangleAndVertices & | tv | ||
) | [inline] |
Recursive procedure for building a mesh.
[in] | scale | Scale to apply when reading the ressource |
[in] | scene | Pointer to the assimp scene |
[in] | node | Current node of the scene |
subMeshIndexes | Submesh triangles indexes interval | |
[in] | mesh | The mesh that must be built |
tv | Triangles and Vertices of the mesh submodels |
References TriangleAndVertices::triangles_, and TriangleAndVertices::vertices_.
Referenced by meshFromAssimpScene().
std::string fromURDFMeshPathToAbsolutePath | ( | const std::string & | urdf_mesh_path, |
const std::string & | meshRootDir | ||
) | [inline] |
Transform a cURL readable path (package://..) to an absolute path for urdf collision path.
[in] | urdf_mesh_path | The path given in the urdf file (package://..) |
[in] | meshRootDir | Root path to the directory where meshes are located |
Referenced by se3::urdf::retrieveCollisionGeometry().
void loadPolyhedronFromResource | ( | const std::string & | resource_path, |
const ::urdf::Vector3 & | scale, | ||
const PolyhedronPtrType & | polyhedron | ||
) | [inline] |
Read a mesh file and convert it to a polyhedral mesh.
[in] | resource_path | Path to the ressource mesh file to be read |
[in] | scale | Scale to apply when reading the ressource |
[in] | polyhedron | The resulted polyhedron |
References meshFromAssimpScene().
Referenced by se3::urdf::retrieveCollisionGeometry().
void meshFromAssimpScene | ( | const std::string & | name, |
const ::urdf::Vector3 & | scale, | ||
const aiScene * | scene, | ||
const PolyhedronPtrType & | mesh | ||
) | [inline] |
Convert an assimp scene to a mesh.
[in] | name | File (ressource) transformed into an assimp scene in loa |
[in] | scale | Scale to apply when reading the ressource |
[in] | scene | Pointer to the assimp scene |
[in] | mesh | The mesh that must be built |
References buildMesh(), TriangleAndVertices::clear(), TriangleAndVertices::triangles_, and TriangleAndVertices::vertices_.
Referenced by loadPolyhedronFromResource().