Classes | Public Member Functions | Protected Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
collada_urdf::ColladaWriter Class Reference

Implements writing urdf::Model objects to a COLLADA DOM. More...

Inheritance diagram for collada_urdf::ColladaWriter:
Inheritance graph
[legend]

Classes

struct  axis_sids
 
struct  instance_articulated_system_output
 
struct  instance_kinematics_model_output
 
struct  instance_physics_model_output
 
struct  kinbody_models
 
struct  kinematics_model_output
 
struct  LINKOUTPUT
 
struct  physics_model_output
 
struct  SCENE
 

Public Member Functions

 ColladaWriter (const urdf::Model &robot, int writeoptions)
 
bool convert ()
 
daeDocument * doc ()
 
bool writeTo (string const &file)
 
virtual ~ColladaWriter ()
 

Protected Member Functions

void _buildAiMesh (const aiScene *scene, aiNode *node, domMeshRef pdommesh, domFloat_arrayRef parray, const string &geomid, const urdf::Vector3 &scale, urdf::Pose *org_trans=NULL)
 
void _CreateScene ()
 
void _loadMesh (std::string const &filename, domGeometryRef pdomgeom, const urdf::Vector3 &scale, urdf::Pose *org_trans)
 
void _loadVertices (const shapes::Mesh *mesh, domGeometryRef pdomgeom)
 
void _WriteBindingsInstance_kinematics_scene ()
 
domEffectRef _WriteEffect (std::string const &effect_id, urdf::Color const &color_ambient, urdf::Color const &color_diffuse)
 
domGeometryRef _WriteGeometry (urdf::GeometrySharedPtr geometry, const std::string &geometry_id, urdf::Pose *org_trans=NULL)
 
virtual void _WriteInstance_kinematics_model (daeElementRef parent, const string &sidscope, int id)
 Write kinematic body in a given scene. More...
 
boost::shared_ptr< instance_physics_model_output_WriteInstance_physics_model (int id, daeElementRef parent, const string &sidscope, const MAPLINKPOSES &maplinkposes)
 
virtual LINKOUTPUT _WriteLink (urdf::LinkConstSharedPtr plink, daeElementRef pkinparent, domNodeRef pnodeparent, const string &strModelUri)
 Write link of a kinematic body. More...
 
void _WriteMaterial (const string &geometry_id, urdf::MaterialSharedPtr material)
 
void _WritePhysics ()
 
void _WriteRobot (int id=0)
 Write kinematic body in a given scene. More...
 
void _WriteTransformation (daeElementRef pelt, const urdf::Pose &t)
 Write transformation. More...
 
virtual void handleError (daeString msg)
 
virtual void handleWarning (daeString msg)
 
virtual boost::shared_ptr< kinematics_model_outputWriteKinematics_model (int id)
 
boost::shared_ptr< physics_model_outputWritePhysics_model (int id, const MAPLINKPOSES &maplinkposes)
 

Private Types

typedef std::map< urdf::LinkConstSharedPtr, urdf::Pose > MAPLINKPOSES
 

Static Private Member Functions

static std::string _ComputeId (const std::string &name)
 computes a collada-compliant sid from the urdf name More...
 
static std::string _ComputeKinematics_modelId (int id)
 
static urdf::Pose _poseInverse (const urdf::Pose &p)
 
static urdf::Vector3 _poseMult (const urdf::Pose &p, const urdf::Vector3 &v)
 
static urdf::Pose _poseMult (const urdf::Pose &p0, const urdf::Pose &p1)
 
static urdf::Rotation _quatFromMatrix (const boost::array< double, 12 > &mat)
 
static urdf::Rotation _quatMult (const urdf::Rotation &quat0, const urdf::Rotation &quat1)
 

Private Attributes

domLibrary_articulated_systemsRef _articulatedSystemsLib
 
DAE _collada
 
daeDocument * _doc
 
domCOLLADA * _dom
 
domLibrary_effectsRef _effectsLib
 
domLibrary_geometriesRef _geometriesLib
 
domCOLLADA::domSceneRef _globalscene
 
boost::shared_ptr< instance_articulated_system_output_iasout
 
boost::shared_ptr< instance_kinematics_model_output_ikmout
 
Assimp::Importer _importer
 
domLibrary_kinematics_modelsRef _kinematicsModelsLib
 
domLibrary_kinematics_scenesRef _kinematicsScenesLib
 
std::map< urdf::JointConstSharedPtr, int > _mapjointindices
 
std::map< urdf::LinkConstSharedPtr, int > _maplinkindices
 
std::map< urdf::MaterialConstSharedPtr, int > _mapmaterialindices
 
domLibrary_materialsRef _materialsLib
 
domLibrary_physics_modelsRef _physicsModelsLib
 
domLibrary_physics_scenesRef _physicsScenesLib
 
const urdf::Model_robot
 
SCENE _scene
 
domTechniqueRef _sensorsLib
 custom sensors library More...
 
domLibrary_visual_scenesRef _visualScenesLib
 
int _writeoptions
 

Detailed Description

Implements writing urdf::Model objects to a COLLADA DOM.

Definition at line 537 of file collada_urdf.cpp.

Member Typedef Documentation

typedef std::map< urdf::LinkConstSharedPtr, urdf::Pose > collada_urdf::ColladaWriter::MAPLINKPOSES
private

Definition at line 550 of file collada_urdf.cpp.

Constructor & Destructor Documentation

collada_urdf::ColladaWriter::ColladaWriter ( const urdf::Model robot,
int  writeoptions 
)
inline

Definition at line 621 of file collada_urdf.cpp.

virtual collada_urdf::ColladaWriter::~ColladaWriter ( )
inlinevirtual

Definition at line 625 of file collada_urdf.cpp.

Member Function Documentation

void collada_urdf::ColladaWriter::_buildAiMesh ( const aiScene *  scene,
aiNode *  node,
domMeshRef  pdommesh,
domFloat_arrayRef  parray,
const string &  geomid,
const urdf::Vector3 &  scale,
urdf::Pose *  org_trans = NULL 
)
inlineprotected

Definition at line 1542 of file collada_urdf.cpp.

static std::string collada_urdf::ColladaWriter::_ComputeId ( const std::string &  name)
inlinestaticprivate

computes a collada-compliant sid from the urdf name

Definition at line 1897 of file collada_urdf.cpp.

static std::string collada_urdf::ColladaWriter::_ComputeKinematics_modelId ( int  id)
inlinestaticprivate

Definition at line 1891 of file collada_urdf.cpp.

void collada_urdf::ColladaWriter::_CreateScene ( )
inlineprotected

Definition at line 728 of file collada_urdf.cpp.

void collada_urdf::ColladaWriter::_loadMesh ( std::string const &  filename,
domGeometryRef  pdomgeom,
const urdf::Vector3 &  scale,
urdf::Pose *  org_trans 
)
inlineprotected

Definition at line 1493 of file collada_urdf.cpp.

void collada_urdf::ColladaWriter::_loadVertices ( const shapes::Mesh mesh,
domGeometryRef  pdomgeom 
)
inlineprotected

Definition at line 1440 of file collada_urdf.cpp.

static urdf::Pose collada_urdf::ColladaWriter::_poseInverse ( const urdf::Pose &  p)
inlinestaticprivate

Definition at line 1805 of file collada_urdf.cpp.

static urdf::Vector3 collada_urdf::ColladaWriter::_poseMult ( const urdf::Pose &  p,
const urdf::Vector3 &  v 
)
inlinestaticprivate

Definition at line 1787 of file collada_urdf.cpp.

static urdf::Pose collada_urdf::ColladaWriter::_poseMult ( const urdf::Pose &  p0,
const urdf::Pose &  p1 
)
inlinestaticprivate

Definition at line 1835 of file collada_urdf.cpp.

static urdf::Rotation collada_urdf::ColladaWriter::_quatFromMatrix ( const boost::array< double, 12 > &  mat)
inlinestaticprivate

Definition at line 1843 of file collada_urdf.cpp.

static urdf::Rotation collada_urdf::ColladaWriter::_quatMult ( const urdf::Rotation &  quat0,
const urdf::Rotation &  quat1 
)
inlinestaticprivate

Definition at line 1819 of file collada_urdf.cpp.

void collada_urdf::ColladaWriter::_WriteBindingsInstance_kinematics_scene ( )
inlineprotected

Definition at line 1771 of file collada_urdf.cpp.

domEffectRef collada_urdf::ColladaWriter::_WriteEffect ( std::string const &  effect_id,
urdf::Color const &  color_ambient,
urdf::Color const &  color_diffuse 
)
inlineprotected

Definition at line 1676 of file collada_urdf.cpp.

domGeometryRef collada_urdf::ColladaWriter::_WriteGeometry ( urdf::GeometrySharedPtr  geometry,
const std::string &  geometry_id,
urdf::Pose *  org_trans = NULL 
)
inlineprotected

Definition at line 1282 of file collada_urdf.cpp.

virtual void collada_urdf::ColladaWriter::_WriteInstance_kinematics_model ( daeElementRef  parent,
const string &  sidscope,
int  id 
)
inlineprotectedvirtual

Write kinematic body in a given scene.

Definition at line 884 of file collada_urdf.cpp.

boost::shared_ptr<instance_physics_model_output> collada_urdf::ColladaWriter::_WriteInstance_physics_model ( int  id,
daeElementRef  parent,
const string &  sidscope,
const MAPLINKPOSES maplinkposes 
)
inlineprotected

Definition at line 1358 of file collada_urdf.cpp.

virtual LINKOUTPUT collada_urdf::ColladaWriter::_WriteLink ( urdf::LinkConstSharedPtr  plink,
daeElementRef  pkinparent,
domNodeRef  pnodeparent,
const string &  strModelUri 
)
inlineprotectedvirtual

Write link of a kinematic body.

Parameters
linkLink to write
pkinparentKinbody parent
pnodeparentNode parent
strModelUri

Definition at line 1137 of file collada_urdf.cpp.

void collada_urdf::ColladaWriter::_WriteMaterial ( const string &  geometry_id,
urdf::MaterialSharedPtr  material 
)
inlineprotected

Definition at line 1321 of file collada_urdf.cpp.

void collada_urdf::ColladaWriter::_WritePhysics ( )
inlineprotected

Definition at line 758 of file collada_urdf.cpp.

void collada_urdf::ColladaWriter::_WriteRobot ( int  id = 0)
inlineprotected

Write kinematic body in a given scene.

Definition at line 766 of file collada_urdf.cpp.

void collada_urdf::ColladaWriter::_WriteTransformation ( daeElementRef  pelt,
const urdf::Pose &  t 
)
inlineprotected

Write transformation.

Parameters
peltElement to transform
tTransform to write

Definition at line 1733 of file collada_urdf.cpp.

bool collada_urdf::ColladaWriter::convert ( )
inline

< documented profile on robot extensions

Definition at line 632 of file collada_urdf.cpp.

daeDocument* collada_urdf::ColladaWriter::doc ( )
inline

Definition at line 628 of file collada_urdf.cpp.

virtual void collada_urdf::ColladaWriter::handleError ( daeString  msg)
inlineprotectedvirtual

Definition at line 721 of file collada_urdf.cpp.

virtual void collada_urdf::ColladaWriter::handleWarning ( daeString  msg)
inlineprotectedvirtual

Definition at line 724 of file collada_urdf.cpp.

virtual boost::shared_ptr<kinematics_model_output> collada_urdf::ColladaWriter::WriteKinematics_model ( int  id)
inlineprotectedvirtual

Definition at line 937 of file collada_urdf.cpp.

boost::shared_ptr<physics_model_output> collada_urdf::ColladaWriter::WritePhysics_model ( int  id,
const MAPLINKPOSES maplinkposes 
)
inlineprotected

!inertial));

Definition at line 1385 of file collada_urdf.cpp.

bool collada_urdf::ColladaWriter::writeTo ( string const &  file)
inline

Definition at line 710 of file collada_urdf.cpp.

Member Data Documentation

domLibrary_articulated_systemsRef collada_urdf::ColladaWriter::_articulatedSystemsLib
private

Definition at line 1919 of file collada_urdf.cpp.

DAE collada_urdf::ColladaWriter::_collada
private

Definition at line 1911 of file collada_urdf.cpp.

daeDocument* collada_urdf::ColladaWriter::_doc
private

Definition at line 1913 of file collada_urdf.cpp.

domCOLLADA* collada_urdf::ColladaWriter::_dom
private

Definition at line 1912 of file collada_urdf.cpp.

domLibrary_effectsRef collada_urdf::ColladaWriter::_effectsLib
private

Definition at line 1923 of file collada_urdf.cpp.

domLibrary_geometriesRef collada_urdf::ColladaWriter::_geometriesLib
private

Definition at line 1924 of file collada_urdf.cpp.

domCOLLADA::domSceneRef collada_urdf::ColladaWriter::_globalscene
private

Definition at line 1914 of file collada_urdf.cpp.

boost::shared_ptr<instance_articulated_system_output> collada_urdf::ColladaWriter::_iasout
private

Definition at line 1929 of file collada_urdf.cpp.

boost::shared_ptr<instance_kinematics_model_output> collada_urdf::ColladaWriter::_ikmout
private

Definition at line 1928 of file collada_urdf.cpp.

Assimp::Importer collada_urdf::ColladaWriter::_importer
private

Definition at line 1933 of file collada_urdf.cpp.

domLibrary_kinematics_modelsRef collada_urdf::ColladaWriter::_kinematicsModelsLib
private

Definition at line 1918 of file collada_urdf.cpp.

domLibrary_kinematics_scenesRef collada_urdf::ColladaWriter::_kinematicsScenesLib
private

Definition at line 1917 of file collada_urdf.cpp.

std::map< urdf::JointConstSharedPtr, int > collada_urdf::ColladaWriter::_mapjointindices
private

Definition at line 1930 of file collada_urdf.cpp.

std::map< urdf::LinkConstSharedPtr, int > collada_urdf::ColladaWriter::_maplinkindices
private

Definition at line 1931 of file collada_urdf.cpp.

std::map< urdf::MaterialConstSharedPtr, int > collada_urdf::ColladaWriter::_mapmaterialindices
private

Definition at line 1932 of file collada_urdf.cpp.

domLibrary_materialsRef collada_urdf::ColladaWriter::_materialsLib
private

Definition at line 1922 of file collada_urdf.cpp.

domLibrary_physics_modelsRef collada_urdf::ColladaWriter::_physicsModelsLib
private

Definition at line 1921 of file collada_urdf.cpp.

domLibrary_physics_scenesRef collada_urdf::ColladaWriter::_physicsScenesLib
private

Definition at line 1920 of file collada_urdf.cpp.

const urdf::Model& collada_urdf::ColladaWriter::_robot
private

Definition at line 1910 of file collada_urdf.cpp.

SCENE collada_urdf::ColladaWriter::_scene
private

Definition at line 1926 of file collada_urdf.cpp.

domTechniqueRef collada_urdf::ColladaWriter::_sensorsLib
private

custom sensors library

Definition at line 1925 of file collada_urdf.cpp.

domLibrary_visual_scenesRef collada_urdf::ColladaWriter::_visualScenesLib
private

Definition at line 1916 of file collada_urdf.cpp.

int collada_urdf::ColladaWriter::_writeoptions
private

Definition at line 1908 of file collada_urdf.cpp.


The documentation for this class was generated from the following file:


collada_urdf
Author(s): Tim Field, Rosen Diankov, Ioan Sucan , Jackie Kay
autogenerated on Fri Jun 7 2019 21:50:26