The graph which contains all information taken from the mjcf file. More...
#include <pinocchio/parsers/mjcf/mjcf-graph.hpp>

Public Types | |
| typedef std::unordered_map< std::string, MjcfBody > | BodyMap_t |
| typedef std::unordered_map< std::string, MjcfClass > | ClassMap_t |
| typedef std::unordered_map< std::string, Eigen::VectorXd > | ConfigMap_t |
| typedef std::map< std::string, MjcfEquality > | EqualityMap_t |
| typedef std::unordered_map< std::string, MjcfMaterial > | MaterialMap_t |
| typedef std::unordered_map< std::string, MjcfMesh > | MeshMap_t |
| typedef boost::property_tree::ptree | ptree |
| typedef std::unordered_map< std::string, MjcfTexture > | TextureMap_t |
| typedef std::vector< std::string > | VectorOfStrings |
Public Member Functions | |
| MjcfGraph (UrdfVisitor &urdfVisitor, const std::string &modelPath) | |
| graph constructor More... | |
| void | addKeyFrame (const Eigen::VectorXd &keyframe, const std::string &keyName) |
| Add a keyframe to the model (ie reference configuration) More... | |
| void | addSoloJoint (const MjcfJoint &jointInfo, const MjcfBody ¤tBody, SE3 &bodyInJoint) |
| Add a joint to the model. only needed when a body has a solo joint child. More... | |
| Inertia | convertInertiaFromMjcf (const ptree &el) const |
| Convert Inertia of an mjcf element into Inertia model of pinocchio. More... | |
| SE3 | convertPosition (const ptree &el) const |
| Convert pose of an mjcf element into SE3. More... | |
| template<typename TypeX , typename TypeY , typename TypeZ , typename TypeUnaligned > | |
| JointModel | createJoint (const Eigen::Vector3d &axis) |
| Create a joint to add to the joint composite if needed. More... | |
| void | fillModel (const std::string &nameOfBody) |
| Use all the infos that were parsed from the xml file to add a body and joint to the model. More... | |
| void | fillReferenceConfig (const MjcfBody ¤tBody) |
| Fill reference configuration for a body and all it's associated dof. More... | |
| void | parseAsset (const ptree &el) |
| Parse all the info from the meta tag asset (mesh, material, texture) More... | |
| void | parseCompiler (const ptree &el) |
| Parse all the info from the compile node into compilerInfo. More... | |
| void | parseContactInformation (const Model &model, PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(RigidConstraintModel) &contact_models) |
| Parse the equality constraints and add them to the model. More... | |
| void | parseDefault (ptree &el, const ptree &parent, const std::string &parentTag) |
| Go through the default part of the file and get all the class name. Fill the mapOfDefault for later use. More... | |
| void | parseEquality (const ptree &el) |
| Parse all the info from the equality tag. More... | |
| void | parseGeomTree (const GeometryType &type, GeometryModel &geomModel, ::hpp::fcl::MeshLoaderPtr &meshLoader) |
| Fill geometry model with all the info taken from the mjcf model file. More... | |
| void | parseGraph () |
| parse the mjcf file into a graph | |
| void | parseGraphFromXML (const std::string &xmlStr) |
| parse the mjcf file into a graph More... | |
| void | parseJointAndBody (const ptree &el, const boost::optional< std::string > &childClass, const std::string &parentName="") |
| Go through the main body of the mjcf file "worldbody" to get all the info ready to create the model. More... | |
| void | parseKeyFrame (const ptree &el) |
| Parse all the info from the meta tag keyframe. More... | |
| void | parseMaterial (const ptree &el) |
| Parse all the info from a material node. More... | |
| void | parseMesh (const ptree &el) |
| Parse all the info from a mesh node. More... | |
| void | parseRootTree () |
| Fill the pinocchio model with all the infos from the graph. | |
| void | parseTexture (const ptree &el) |
| Parse all the info from a texture node. More... | |
Public Attributes | |
| VectorOfStrings | bodiesList |
| MjcfCompiler | compilerInfo |
| BodyMap_t | mapOfBodies |
| ClassMap_t | mapOfClasses |
| ConfigMap_t | mapOfConfigs |
| EqualityMap_t | mapOfEqualities |
| MaterialMap_t | mapOfMaterials |
| MeshMap_t | mapOfMeshes |
| TextureMap_t | mapOfTextures |
| std::string | modelName |
| std::string | modelPath |
| ptree | pt |
| Eigen::VectorXd | referenceConfig |
The graph which contains all information taken from the mjcf file.
Definition at line 381 of file mjcf-graph.hpp.
|
inline |
| void addKeyFrame | ( | const Eigen::VectorXd & | keyframe, |
| const std::string & | keyName | ||
| ) |
Add a keyframe to the model (ie reference configuration)
| keyframe | Keyframe to add |
| keyName | Name of the keyframe |
Add a joint to the model. only needed when a body has a solo joint child.
| jointInfo | The joint to add to the tree |
| currentBody | The body associated with the joint |
| bodyInJoint | Position of the body wrt to its joint |
| Inertia convertInertiaFromMjcf | ( | const ptree & | el | ) | const |
Convert Inertia of an mjcf element into Inertia model of pinocchio.
| el | ptree element with all the inertial information |
| SE3 convertPosition | ( | const ptree & | el | ) | const |
Convert pose of an mjcf element into SE3.
| el | ptree element with all the pose element |
| JointModel createJoint | ( | const Eigen::Vector3d & | axis | ) |
Create a joint to add to the joint composite if needed.
| TypeX | joint with axis X |
| TypeY | joint with axis Y |
| TypeZ | joint with axis Z |
| TypeUnaligned | joint with axis unaligned |
| axis | axis of the joint |
| void fillModel | ( | const std::string & | nameOfBody | ) |
Use all the infos that were parsed from the xml file to add a body and joint to the model.
| nameOfBody | Name of the body to add |
| void fillReferenceConfig | ( | const MjcfBody & | currentBody | ) |
Fill reference configuration for a body and all it's associated dof.
| currentBody | body to check |
| void parseAsset | ( | const ptree & | el | ) |
Parse all the info from the meta tag asset (mesh, material, texture)
| el | ptree texture node |
| void parseCompiler | ( | const ptree & | el | ) |
Parse all the info from the compile node into compilerInfo.
| el | ptree compile node |
| void parseContactInformation | ( | const Model & | model, |
| PINOCCHIO_STD_VECTOR_WITH_EIGEN_ALLOCATOR(RigidConstraintModel) & | contact_models | ||
| ) |
Parse the equality constraints and add them to the model.
| model | Model to add the constraints to |
| contact_models | Vector of contact models to add the constraints to |
| void parseDefault | ( | ptree & | el, |
| const ptree & | parent, | ||
| const std::string & | parentTag | ||
| ) |
Go through the default part of the file and get all the class name. Fill the mapOfDefault for later use.
| el | ptree element. Root of the default |
| void parseEquality | ( | const ptree & | el | ) |
Parse all the info from the equality tag.
| el | ptree equality node |
| void parseGeomTree | ( | const GeometryType & | type, |
| GeometryModel & | geomModel, | ||
| ::hpp::fcl::MeshLoaderPtr & | meshLoader | ||
| ) |
Fill geometry model with all the info taken from the mjcf model file.
| type | Type of geometry to parse (COLLISION or VISUAL) |
| geomModel | geometry model to fill |
| meshLoader | mesh loader from hpp::fcl |
| void parseGraphFromXML | ( | const std::string & | xmlStr | ) |
parse the mjcf file into a graph
| xmlStr | xml file name |
| void parseJointAndBody | ( | const ptree & | el, |
| const boost::optional< std::string > & | childClass, | ||
| const std::string & | parentName = "" |
||
| ) |
Go through the main body of the mjcf file "worldbody" to get all the info ready to create the model.
| el | root of the tree |
| parentName | name of the parentBody in the robot tree |
| void parseKeyFrame | ( | const ptree & | el | ) |
Parse all the info from the meta tag keyframe.
| el | ptree keyframe node |
| void parseMaterial | ( | const ptree & | el | ) |
Parse all the info from a material node.
| el | ptree material node |
| void parseMesh | ( | const ptree & | el | ) |
Parse all the info from a mesh node.
| el | ptree mesh node |
| void parseTexture | ( | const ptree & | el | ) |
Parse all the info from a texture node.
| el | ptree texture node |