DART  6.10.1
dart::utils::MjcfParser::detail::Body Class Referencefinal

#include <Body.hpp>

Public Member Functions

 Body ()=default
 Default constructor. More...
 
Attributes
const std::string & getName () const
 Returns 'name' attribute. More...
 
bool getMocap () const
 Returns 'mocap' attribute. More...
 
void setRelativeTransform (const Eigen::Isometry3d &tf)
 Sets the transform relative to the parent <body> or <worldbody>. More...
 
const Eigen::Isometry3d & getRelativeTransform () const
 Returns the transform relative to the parent <body> or <worldbody>. More...
 
void setWorldTransform (const Eigen::Isometry3d &tf)
 Sets the world transform of this <body>. More...
 
const Eigen::Isometry3d & getWorldTransform () const
 Returns the world transform of this <body>. More...
 
Child elements
const InertialgetInertial () const
 Returns <inertial> element. More...
 
std::size_t getNumJoints () const
 Returns the number of <joint> elements. More...
 
const JointgetJoint (std::size_t index) const
 Returns a <joint> element at index. More...
 
std::size_t getNumChildBodies () const
 Returns the number of child <body> elements. More...
 
const BodygetChildBody (std::size_t index) const
 Returns a child <body> element at index. More...
 
std::size_t getNumGeoms () const
 Returns the number of <geom> elements. More...
 
const GeomgetGeom (std::size_t index) const
 Returns a <geom> element at index. More...
 
std::size_t getNumSites () const
 Returns the number of <site> elements. More...
 
const SitegetSite (std::size_t index) const
 Returns a <site> element at index. More...
 

Private Member Functions

Errors read (tinyxml2::XMLElement *element, const common::optional< Size > &size, const Defaults &defaults, const Default *currentDefault)
 
Errors preprocess (const Compiler &compiler)
 Updates attributes and elements that doesn't require any other elements. More...
 
Errors compile (const Compiler &compiler)
 Updates attributes and elements that require the preprocessed child elements of this <body>. More...
 
Errors postprocess (const Body *body, const Compiler &compiler)
 Updates attributes and elements that require the compiled parent element. More...
 
Inertial computeInertialFromGeoms (const std::vector< Geom > &geoms, const Compiler &compiler)
 

Private Attributes

BodyAttributes mAttributes
 
std::string mName {""}
 Name of the body. More...
 
bool mMocap {false}
 If this attribute is "true", the body is labeled as a mocap body. More...
 
Eigen::Isometry3d mRelativeTransform {Eigen::Isometry3d::Identity()}
 
Eigen::Isometry3d mWorldTransform {Eigen::Isometry3d::Identity()}
 
Eigen::VectorXd mUser
 
Inertial mInertial
 
std::vector< JointmJoints
 
std::vector< BodymChildBodies
 
std::vector< GeommGeoms
 
std::vector< SitemSites
 

Friends

class Worldbody
 

Constructor & Destructor Documentation

◆ Body()

dart::utils::MjcfParser::detail::Body::Body ( )
default

Default constructor.

Member Function Documentation

◆ compile()

Errors dart::utils::MjcfParser::detail::Body::compile ( const Compiler compiler)
private

Updates attributes and elements that require the preprocessed child elements of this <body>.

◆ computeInertialFromGeoms()

Inertial dart::utils::MjcfParser::detail::Body::computeInertialFromGeoms ( const std::vector< Geom > &  geoms,
const Compiler compiler 
)
private

◆ getChildBody()

const Body & dart::utils::MjcfParser::detail::Body::getChildBody ( std::size_t  index) const

Returns a child <body> element at index.

◆ getGeom()

const Geom & dart::utils::MjcfParser::detail::Body::getGeom ( std::size_t  index) const

Returns a <geom> element at index.

◆ getInertial()

const Inertial & dart::utils::MjcfParser::detail::Body::getInertial ( ) const

Returns <inertial> element.

When <inertial> element is not specified in the XML file, then it's inferred from <geom> elements. If both of <inertial> and <inertial> are missing, then the parser must be failed to parse the file.

◆ getJoint()

const Joint & dart::utils::MjcfParser::detail::Body::getJoint ( std::size_t  index) const

Returns a <joint> element at index.

◆ getMocap()

bool dart::utils::MjcfParser::detail::Body::getMocap ( ) const

Returns 'mocap' attribute.

◆ getName()

const std::string & dart::utils::MjcfParser::detail::Body::getName ( ) const

Returns 'name' attribute.

◆ getNumChildBodies()

std::size_t dart::utils::MjcfParser::detail::Body::getNumChildBodies ( ) const

Returns the number of child <body> elements.

◆ getNumGeoms()

std::size_t dart::utils::MjcfParser::detail::Body::getNumGeoms ( ) const

Returns the number of <geom> elements.

◆ getNumJoints()

std::size_t dart::utils::MjcfParser::detail::Body::getNumJoints ( ) const

Returns the number of <joint> elements.

◆ getNumSites()

std::size_t dart::utils::MjcfParser::detail::Body::getNumSites ( ) const

Returns the number of <site> elements.

◆ getRelativeTransform()

const Eigen::Isometry3d & dart::utils::MjcfParser::detail::Body::getRelativeTransform ( ) const

Returns the transform relative to the parent <body> or <worldbody>.

◆ getSite()

const Site & dart::utils::MjcfParser::detail::Body::getSite ( std::size_t  index) const

Returns a <site> element at index.

◆ getWorldTransform()

const Eigen::Isometry3d & dart::utils::MjcfParser::detail::Body::getWorldTransform ( ) const

Returns the world transform of this <body>.

◆ postprocess()

Errors dart::utils::MjcfParser::detail::Body::postprocess ( const Body body,
const Compiler compiler 
)
private

Updates attributes and elements that require the compiled parent element.

◆ preprocess()

Errors dart::utils::MjcfParser::detail::Body::preprocess ( const Compiler compiler)
private

Updates attributes and elements that doesn't require any other elements.

◆ read()

Errors dart::utils::MjcfParser::detail::Body::read ( tinyxml2::XMLElement *  element,
const common::optional< Size > &  size,
const Defaults defaults,
const Default currentDefault 
)
private

◆ setRelativeTransform()

void dart::utils::MjcfParser::detail::Body::setRelativeTransform ( const Eigen::Isometry3d &  tf)

Sets the transform relative to the parent <body> or <worldbody>.

◆ setWorldTransform()

void dart::utils::MjcfParser::detail::Body::setWorldTransform ( const Eigen::Isometry3d &  tf)

Sets the world transform of this <body>.

Friends And Related Function Documentation

◆ Worldbody

friend class Worldbody
friend

Member Data Documentation

◆ mAttributes

BodyAttributes dart::utils::MjcfParser::detail::Body::mAttributes
private

◆ mChildBodies

std::vector<Body> dart::utils::MjcfParser::detail::Body::mChildBodies
private

◆ mGeoms

std::vector<Geom> dart::utils::MjcfParser::detail::Body::mGeoms
private

◆ mInertial

Inertial dart::utils::MjcfParser::detail::Body::mInertial
private

◆ mJoints

std::vector<Joint> dart::utils::MjcfParser::detail::Body::mJoints
private

◆ mMocap

bool dart::utils::MjcfParser::detail::Body::mMocap {false}
private

If this attribute is "true", the body is labeled as a mocap body.

◆ mName

std::string dart::utils::MjcfParser::detail::Body::mName {""}
private

Name of the body.

◆ mRelativeTransform

Eigen::Isometry3d dart::utils::MjcfParser::detail::Body::mRelativeTransform {Eigen::Isometry3d::Identity()}
private

◆ mSites

std::vector<Site> dart::utils::MjcfParser::detail::Body::mSites
private

◆ mUser

Eigen::VectorXd dart::utils::MjcfParser::detail::Body::mUser
private

◆ mWorldTransform

Eigen::Isometry3d dart::utils::MjcfParser::detail::Body::mWorldTransform {Eigen::Isometry3d::Identity()}
private