DART  6.10.1
dart::utils::MjcfParser::detail Namespace Reference

Classes

class  Asset
 
class  Body
 
struct  BodyAttributes
 Intermediate raw data read from the XML file. More...
 
class  Compiler
 
class  Default
 
class  Defaults
 
class  Equality
 
class  Error
 
class  Geom
 
struct  GeomAttributes
 Intermediate raw data read from the XML file. More...
 
class  Inertial
 
class  Joint
 
struct  JointAttributes
 
class  Mesh
 
struct  MeshAttributes
 Intermediate raw data read from the XML file. More...
 
class  MujocoModel
 Main class to parse MJCF model file. More...
 
class  Option
 
class  Site
 
class  Size
 
class  Weld
 
struct  WeldAttributes
 
class  Worldbody
 

Typedefs

using Errors = std::vector< Error >
 

Enumerations

enum class  ErrorCode {
  NONE = 0 , FILE_READ , DUPLICATE_NAME , ATTRIBUTE_MISSING ,
  ATTRIBUTE_INVALID , ATTRIBUTE_DEPRECATED , ATTRIBUTE_CONFLICT , ELEMENT_MISSING ,
  ELEMENT_INVALID , INCORRECT_ELEMENT_TYPE , UNDEFINED_ERROR
}
 
enum class  Angle { DEGREE = 0 , RADIAN = 1 }
 This attribute specifies whether the angles in the MJCF model are expressed in units of degrees or radians. More...
 
enum class  Coordinate { LOCAL = 0 , GLOBAL = 1 }
 This attribute specifies whether the frame positions and orientations in the MJCF model are expressed in local or global coordinates; recall Coordinate frames. More...
 
enum class  Integrator { EULER = 0 , RK4 = 1 }
 This attribute selects the numerical integrator to be used. More...
 
enum class  InertiaFromGeom { FALSE , TRUE , AUTO }
 
enum class  CollisionType { ALL , PREDEFINED , DYNAMIC }
 
enum class  ConeType { PYRAMIDAL , ELLIPTIC }
 
enum class  JacobianType { DENSE , SPARSE , AUTO }
 
enum class  SolverType { PGS , CG , NEWTON }
 
enum class  GeomType {
  PLANE , HFIELD , SPHERE , CAPSULE ,
  ELLIPSOID , CYLINDER , BOX , MESH
}
 
enum class  JointType { FREE , BALL , SLIDE , HINGE }
 

Functions

Errors appendBodyAttributes (BodyAttributes &attributes, tinyxml2::XMLElement *element, const common::optional< Size > &size)
 
static bool canUseFromTo (GeomType type, const common::optional< Eigen::Vector6d > &fromto)
 
Errors appendGeomAttributes (GeomAttributes &attributes, tinyxml2::XMLElement *element)
 
Errors appendJointAttributes (JointAttributes &attributes, tinyxml2::XMLElement *element)
 
Errors appendMeshAttributes (MeshAttributes &attributes, tinyxml2::XMLElement *element)
 
static bool canUseFromTo (GeomType type, const common::optional< Eigen::Vector6d > &fromto)
 
Errors checkOrientationValidity (const tinyxml2::XMLElement *element)
 Checks if orientation elements (i.e., <quat>, <axisangle>, <euler>, <xyaxes>, <zaxis>) are properly set in element. More...
 
Eigen::Matrix3d compileRotation (const Eigen::Quaterniond &quat, const common::optional< Eigen::Vector4d > &axisAngle, const common::optional< Eigen::Vector3d > &euler, const common::optional< Eigen::Vector6d > &xyAxes, const common::optional< Eigen::Vector3d > &zAxis, const Compiler &compiler)
 Extracts rotation matrix from "pre-parsed" orientation elements and the compiler settings. More...
 
Errors handleInclude (tinyxml2::XMLElement *element, const common::Uri &baseUri, const common::ResourceRetrieverPtr &retriever)
 Includes other MJCF model file into element. More...
 
std::vector< dynamics::BodyNode * > getBodyNodes (const simulation::World &world, const std::string &name)
 Finds all BodyNodes by name. More...
 
Errors appendWeldAttributes (WeldAttributes &attributes, tinyxml2::XMLElement *element)
 

Typedef Documentation

◆ Errors

using dart::utils::MjcfParser::detail::Errors = typedef std::vector<Error>

Enumeration Type Documentation

◆ Angle

This attribute specifies whether the angles in the MJCF model are expressed in units of degrees or radians.

The compiler converts degrees into radians, and mjModel always uses radians. For URDF models the parser sets this attribute to "radian" internally, regardless of the XML setting.

Enumerator
DEGREE 

[Default] Always use for MJCF

RADIAN 

Always use for URDF.

◆ CollisionType

Enumerator
ALL 
PREDEFINED 
DYNAMIC 

◆ ConeType

Enumerator
PYRAMIDAL 
ELLIPTIC 

◆ Coordinate

This attribute specifies whether the frame positions and orientations in the MJCF model are expressed in local or global coordinates; recall Coordinate frames.

The compiler converts global into local coordinates, and mjModel always uses local coordinates. For URDF models the parser sets this attribute to "local" internally, regardless of the XML setting.

Enumerator
LOCAL 

[Default]

GLOBAL 

◆ ErrorCode

Enumerator
NONE 
FILE_READ 
DUPLICATE_NAME 
ATTRIBUTE_MISSING 
ATTRIBUTE_INVALID 
ATTRIBUTE_DEPRECATED 
ATTRIBUTE_CONFLICT 
ELEMENT_MISSING 
ELEMENT_INVALID 
INCORRECT_ELEMENT_TYPE 
UNDEFINED_ERROR 

◆ GeomType

Enumerator
PLANE 
HFIELD 
SPHERE 

[Default]

CAPSULE 
ELLIPSOID 
CYLINDER 
BOX 
MESH 

◆ InertiaFromGeom

Enumerator
FALSE 
TRUE 
AUTO 

◆ Integrator

This attribute selects the numerical integrator to be used.

Currently the available integrators are the semi-implicit Euler method and the fixed-step 4-th order Runge Kutta method.

Enumerator
EULER 

[Default]

RK4 

◆ JacobianType

Enumerator
DENSE 
SPARSE 
AUTO 

◆ JointType

Enumerator
FREE 
BALL 
SLIDE 
HINGE 

[Default]

◆ SolverType

Enumerator
PGS 
CG 
NEWTON 

Function Documentation

◆ appendBodyAttributes()

Errors dart::utils::MjcfParser::detail::appendBodyAttributes ( BodyAttributes attributes,
tinyxml2::XMLElement *  element,
const common::optional< Size > &  size 
)

◆ appendGeomAttributes()

Errors dart::utils::MjcfParser::detail::appendGeomAttributes ( GeomAttributes attributes,
tinyxml2::XMLElement *  element 
)

◆ appendJointAttributes()

Errors dart::utils::MjcfParser::detail::appendJointAttributes ( JointAttributes attributes,
tinyxml2::XMLElement *  element 
)

◆ appendMeshAttributes()

Errors dart::utils::MjcfParser::detail::appendMeshAttributes ( MeshAttributes attributes,
tinyxml2::XMLElement *  element 
)

◆ appendWeldAttributes()

Errors dart::utils::MjcfParser::detail::appendWeldAttributes ( WeldAttributes attributes,
tinyxml2::XMLElement *  element 
)

◆ canUseFromTo() [1/2]

static bool dart::utils::MjcfParser::detail::canUseFromTo ( GeomType  type,
const common::optional< Eigen::Vector6d > &  fromto 
)
static

◆ canUseFromTo() [2/2]

static bool dart::utils::MjcfParser::detail::canUseFromTo ( GeomType  type,
const common::optional< Eigen::Vector6d > &  fromto 
)
static

◆ checkOrientationValidity()

Errors dart::utils::MjcfParser::detail::checkOrientationValidity ( const tinyxml2::XMLElement *  element)

Checks if orientation elements (i.e., <quat>, <axisangle>, <euler>, <xyaxes>, <zaxis>) are properly set in element.

◆ compileRotation()

Eigen::Matrix3d dart::utils::MjcfParser::detail::compileRotation ( const Eigen::Quaterniond &  quat,
const common::optional< Eigen::Vector4d > &  axisAngle,
const common::optional< Eigen::Vector3d > &  euler,
const common::optional< Eigen::Vector6d > &  xyAxes,
const common::optional< Eigen::Vector3d > &  zAxis,
const Compiler compiler 
)

Extracts rotation matrix from "pre-parsed" orientation elements and the compiler settings.

◆ getBodyNodes()

std::vector< dynamics::BodyNode * > dart::utils::MjcfParser::detail::getBodyNodes ( const simulation::World world,
const std::string &  name 
)

Finds all BodyNodes by name.

◆ handleInclude()

Errors dart::utils::MjcfParser::detail::handleInclude ( tinyxml2::XMLElement *  element,
const common::Uri baseUri,
const common::ResourceRetrieverPtr retriever 
)

Includes other MJCF model file into element.

Parameters
[in]baseUriThe URI of the main MJCF model file
[in]retrieverThe resource retriever used for the main MJCF model file
Returns
Errors occured in hadling elements