from-collada-to-fcl.hpp File Reference
#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>
Include dependency graph for from-collada-to-fcl.hpp:

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 Documentation

typedef boost::shared_ptr<PolyhedronType> PolyhedronPtrType
typedef fcl::BVHModel< fcl::OBBRSS > PolyhedronType

Function Documentation

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.

Parameters:
[in]scaleScale to apply when reading the ressource
[in]scenePointer to the assimp scene
[in]nodeCurrent node of the scene
subMeshIndexesSubmesh triangles indexes interval
[in]meshThe mesh that must be built
tvTriangles 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.

Parameters:
[in]urdf_mesh_pathThe path given in the urdf file (package://..)
[in]meshRootDirRoot path to the directory where meshes are located
Returns:
The absolute path to the mesh file

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.

Parameters:
[in]resource_pathPath to the ressource mesh file to be read
[in]scaleScale to apply when reading the ressource
[in]polyhedronThe 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.

Parameters:
[in]nameFile (ressource) transformed into an assimp scene in loa
[in]scaleScale to apply when reading the ressource
[in]scenePointer to the assimp scene
[in]meshThe mesh that must be built

References buildMesh(), TriangleAndVertices::clear(), TriangleAndVertices::triangles_, and TriangleAndVertices::vertices_.

Referenced by loadPolyhedronFromResource().