Implements writing urdf::Model objects to a COLLADA DOM. More...
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 std::vector< Triangle > vertices, domGeometryRef pdomgeom, urdf::Pose *org_trans) |
void | _WriteBindingsInstance_kinematics_scene () |
domEffectRef | _WriteEffect (std::string const &effect_id, urdf::Color const &color_ambient, urdf::Color const &color_diffuse) |
domGeometryRef | _WriteGeometry (boost::shared_ptr< urdf::Geometry > 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. | |
boost::shared_ptr < instance_physics_model_output > | _WriteInstance_physics_model (int id, daeElementRef parent, const string &sidscope, const MAPLINKPOSES &maplinkposes) |
virtual LINKOUTPUT | _WriteLink (boost::shared_ptr< const urdf::Link > plink, daeElementRef pkinparent, domNodeRef pnodeparent, const string &strModelUri) |
Write link of a kinematic body. | |
void | _WriteMaterial (const string &geometry_id, boost::shared_ptr< urdf::Material > material) |
void | _WritePhysics () |
void | _WriteRobot (int id=0) |
Write kinematic body in a given scene. | |
void | _WriteTransformation (daeElementRef pelt, const urdf::Pose &t) |
Write transformation. | |
virtual void | handleError (daeString msg) |
virtual void | handleWarning (daeString msg) |
virtual boost::shared_ptr < kinematics_model_output > | WriteKinematics_model (int id) |
boost::shared_ptr < physics_model_output > | WritePhysics_model (int id, const MAPLINKPOSES &maplinkposes) |
Private Types | |
typedef std::map < boost::shared_ptr< const urdf::Link >, urdf::Pose > | MAPLINKPOSES |
Static Private Member Functions | |
static std::string | _ComputeId (const std::string &name) |
computes a collada-compliant sid from the urdf name | |
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< boost::shared_ptr < const urdf::Joint >, int > | _mapjointindices |
std::map< boost::shared_ptr < const urdf::Link >, int > | _maplinkindices |
std::map< boost::shared_ptr < const urdf::Material >, int > | _mapmaterialindices |
domLibrary_materialsRef | _materialsLib |
domLibrary_physics_modelsRef | _physicsModelsLib |
domLibrary_physics_scenesRef | _physicsScenesLib |
const urdf::Model & | _robot |
SCENE | _scene |
domTechniqueRef | _sensorsLib |
custom sensors library | |
domLibrary_visual_scenesRef | _visualScenesLib |
int | _writeoptions |
Implements writing urdf::Model objects to a COLLADA DOM.
Definition at line 522 of file collada_urdf.cpp.
typedef std::map< boost::shared_ptr<const urdf::Link>, urdf::Pose > collada_urdf::ColladaWriter::MAPLINKPOSES [private] |
Definition at line 535 of file collada_urdf.cpp.
collada_urdf::ColladaWriter::ColladaWriter | ( | const urdf::Model & | robot, |
int | writeoptions | ||
) | [inline] |
Definition at line 606 of file collada_urdf.cpp.
virtual collada_urdf::ColladaWriter::~ColladaWriter | ( | ) | [inline, virtual] |
Definition at line 610 of file collada_urdf.cpp.
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 |
||
) | [inline, protected] |
Definition at line 1630 of file collada_urdf.cpp.
static std::string collada_urdf::ColladaWriter::_ComputeId | ( | const std::string & | name | ) | [inline, static, private] |
computes a collada-compliant sid from the urdf name
Definition at line 1984 of file collada_urdf.cpp.
static std::string collada_urdf::ColladaWriter::_ComputeKinematics_modelId | ( | int | id | ) | [inline, static, private] |
Definition at line 1978 of file collada_urdf.cpp.
void collada_urdf::ColladaWriter::_CreateScene | ( | ) | [inline, protected] |
Definition at line 713 of file collada_urdf.cpp.
void collada_urdf::ColladaWriter::_loadMesh | ( | std::string const & | filename, |
domGeometryRef | pdomgeom, | ||
const urdf::Vector3 & | scale, | ||
urdf::Pose * | org_trans | ||
) | [inline, protected] |
Definition at line 1581 of file collada_urdf.cpp.
void collada_urdf::ColladaWriter::_loadVertices | ( | const std::vector< Triangle > | vertices, |
domGeometryRef | pdomgeom, | ||
urdf::Pose * | org_trans | ||
) | [inline, protected] |
Definition at line 1500 of file collada_urdf.cpp.
static urdf::Pose collada_urdf::ColladaWriter::_poseInverse | ( | const urdf::Pose & | p | ) | [inline, static, private] |
Definition at line 1892 of file collada_urdf.cpp.
static urdf::Vector3 collada_urdf::ColladaWriter::_poseMult | ( | const urdf::Pose & | p, |
const urdf::Vector3 & | v | ||
) | [inline, static, private] |
Definition at line 1874 of file collada_urdf.cpp.
static urdf::Pose collada_urdf::ColladaWriter::_poseMult | ( | const urdf::Pose & | p0, |
const urdf::Pose & | p1 | ||
) | [inline, static, private] |
Definition at line 1922 of file collada_urdf.cpp.
static urdf::Rotation collada_urdf::ColladaWriter::_quatFromMatrix | ( | const boost::array< double, 12 > & | mat | ) | [inline, static, private] |
Definition at line 1930 of file collada_urdf.cpp.
static urdf::Rotation collada_urdf::ColladaWriter::_quatMult | ( | const urdf::Rotation & | quat0, |
const urdf::Rotation & | quat1 | ||
) | [inline, static, private] |
Definition at line 1906 of file collada_urdf.cpp.
void collada_urdf::ColladaWriter::_WriteBindingsInstance_kinematics_scene | ( | ) | [inline, protected] |
Definition at line 1858 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 | ||
) | [inline, protected] |
Definition at line 1763 of file collada_urdf.cpp.
domGeometryRef collada_urdf::ColladaWriter::_WriteGeometry | ( | boost::shared_ptr< urdf::Geometry > | geometry, |
const std::string & | geometry_id, | ||
urdf::Pose * | org_trans = NULL |
||
) | [inline, protected] |
Definition at line 1272 of file collada_urdf.cpp.
virtual void collada_urdf::ColladaWriter::_WriteInstance_kinematics_model | ( | daeElementRef | parent, |
const string & | sidscope, | ||
int | id | ||
) | [inline, protected, virtual] |
Write kinematic body in a given scene.
Definition at line 869 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 | ||
) | [inline, protected] |
Definition at line 1418 of file collada_urdf.cpp.
virtual LINKOUTPUT collada_urdf::ColladaWriter::_WriteLink | ( | boost::shared_ptr< const urdf::Link > | plink, |
daeElementRef | pkinparent, | ||
domNodeRef | pnodeparent, | ||
const string & | strModelUri | ||
) | [inline, protected, virtual] |
Write link of a kinematic body.
link | Link to write |
pkinparent | Kinbody parent |
pnodeparent | Node parent |
strModelUri |
Definition at line 1122 of file collada_urdf.cpp.
void collada_urdf::ColladaWriter::_WriteMaterial | ( | const string & | geometry_id, |
boost::shared_ptr< urdf::Material > | material | ||
) | [inline, protected] |
Definition at line 1381 of file collada_urdf.cpp.
void collada_urdf::ColladaWriter::_WritePhysics | ( | ) | [inline, protected] |
Definition at line 743 of file collada_urdf.cpp.
void collada_urdf::ColladaWriter::_WriteRobot | ( | int | id = 0 | ) | [inline, protected] |
Write kinematic body in a given scene.
Definition at line 751 of file collada_urdf.cpp.
void collada_urdf::ColladaWriter::_WriteTransformation | ( | daeElementRef | pelt, |
const urdf::Pose & | t | ||
) | [inline, protected] |
Write transformation.
pelt | Element to transform |
t | Transform to write |
Definition at line 1820 of file collada_urdf.cpp.
bool collada_urdf::ColladaWriter::convert | ( | ) | [inline] |
< documented profile on robot extensions
Definition at line 617 of file collada_urdf.cpp.
daeDocument* collada_urdf::ColladaWriter::doc | ( | ) | [inline] |
Definition at line 613 of file collada_urdf.cpp.
virtual void collada_urdf::ColladaWriter::handleError | ( | daeString | msg | ) | [inline, protected, virtual] |
Definition at line 706 of file collada_urdf.cpp.
virtual void collada_urdf::ColladaWriter::handleWarning | ( | daeString | msg | ) | [inline, protected, virtual] |
Definition at line 709 of file collada_urdf.cpp.
virtual boost::shared_ptr<kinematics_model_output> collada_urdf::ColladaWriter::WriteKinematics_model | ( | int | id | ) | [inline, protected, virtual] |
Definition at line 922 of file collada_urdf.cpp.
boost::shared_ptr<physics_model_output> collada_urdf::ColladaWriter::WritePhysics_model | ( | int | id, |
const MAPLINKPOSES & | maplinkposes | ||
) | [inline, protected] |
!inertial));
Definition at line 1445 of file collada_urdf.cpp.
bool collada_urdf::ColladaWriter::writeTo | ( | string const & | file | ) | [inline] |
Definition at line 695 of file collada_urdf.cpp.
domLibrary_articulated_systemsRef collada_urdf::ColladaWriter::_articulatedSystemsLib [private] |
Definition at line 2006 of file collada_urdf.cpp.
DAE collada_urdf::ColladaWriter::_collada [private] |
Definition at line 1998 of file collada_urdf.cpp.
daeDocument* collada_urdf::ColladaWriter::_doc [private] |
Definition at line 2000 of file collada_urdf.cpp.
domCOLLADA* collada_urdf::ColladaWriter::_dom [private] |
Definition at line 1999 of file collada_urdf.cpp.
domLibrary_effectsRef collada_urdf::ColladaWriter::_effectsLib [private] |
Definition at line 2010 of file collada_urdf.cpp.
domLibrary_geometriesRef collada_urdf::ColladaWriter::_geometriesLib [private] |
Definition at line 2011 of file collada_urdf.cpp.
domCOLLADA::domSceneRef collada_urdf::ColladaWriter::_globalscene [private] |
Definition at line 2001 of file collada_urdf.cpp.
boost::shared_ptr<instance_articulated_system_output> collada_urdf::ColladaWriter::_iasout [private] |
Definition at line 2016 of file collada_urdf.cpp.
boost::shared_ptr<instance_kinematics_model_output> collada_urdf::ColladaWriter::_ikmout [private] |
Definition at line 2015 of file collada_urdf.cpp.
Assimp::Importer collada_urdf::ColladaWriter::_importer [private] |
Definition at line 2020 of file collada_urdf.cpp.
domLibrary_kinematics_modelsRef collada_urdf::ColladaWriter::_kinematicsModelsLib [private] |
Definition at line 2005 of file collada_urdf.cpp.
domLibrary_kinematics_scenesRef collada_urdf::ColladaWriter::_kinematicsScenesLib [private] |
Definition at line 2004 of file collada_urdf.cpp.
std::map< boost::shared_ptr<const urdf::Joint>, int > collada_urdf::ColladaWriter::_mapjointindices [private] |
Definition at line 2017 of file collada_urdf.cpp.
std::map< boost::shared_ptr<const urdf::Link>, int > collada_urdf::ColladaWriter::_maplinkindices [private] |
Definition at line 2018 of file collada_urdf.cpp.
std::map< boost::shared_ptr<const urdf::Material>, int > collada_urdf::ColladaWriter::_mapmaterialindices [private] |
Definition at line 2019 of file collada_urdf.cpp.
domLibrary_materialsRef collada_urdf::ColladaWriter::_materialsLib [private] |
Definition at line 2009 of file collada_urdf.cpp.
domLibrary_physics_modelsRef collada_urdf::ColladaWriter::_physicsModelsLib [private] |
Definition at line 2008 of file collada_urdf.cpp.
domLibrary_physics_scenesRef collada_urdf::ColladaWriter::_physicsScenesLib [private] |
Definition at line 2007 of file collada_urdf.cpp.
const urdf::Model& collada_urdf::ColladaWriter::_robot [private] |
Definition at line 1997 of file collada_urdf.cpp.
SCENE collada_urdf::ColladaWriter::_scene [private] |
Definition at line 2013 of file collada_urdf.cpp.
domTechniqueRef collada_urdf::ColladaWriter::_sensorsLib [private] |
custom sensors library
Definition at line 2012 of file collada_urdf.cpp.
domLibrary_visual_scenesRef collada_urdf::ColladaWriter::_visualScenesLib [private] |
Definition at line 2003 of file collada_urdf.cpp.
int collada_urdf::ColladaWriter::_writeoptions [private] |
Definition at line 1995 of file collada_urdf.cpp.