esp::metadata::URDF::Model class

Generic structure representing an articulated object parsed from a URDF file independent from any physics implementation.

Constructors, destructors, conversion operators

Model() defaulted

Public functions

auto m_rootTransformInWorld(Magnum::Math::IdentityInitT) -> Magnum::Matrix4
world transform of the object root if provided
void printKinematicChain() const
auto getLink(const std::string& linkName) const -> std::shared_ptr<Link>
Get a link provided its name.
auto getLink(int linkIndex) const -> std::shared_ptr<Link>
Get a link provided its index.
auto getJoint(int linkIndex) const -> std::shared_ptr<Joint>
Get a parent joint of a link provided the link index.
void setGlobalScaling(float scaling)
Set global scaling and re-scale an existing model. Modifies various internal parameters.
auto getGlobalScaling() const -> float
Get the currently configured global model scaling.
void setMassScaling(float massScaling)
Set scaling for mass from initial values configured in URDF. Modifies various internal parameters.
auto getMassScaling() const -> float
Get the currently configured mass scaling of the model.

Public variables

std::string m_name
name of the articulated object or robot
std::string m_sourceFile
source file this model was built from (e.g. the .urdf file)
std::map<std::string, std::shared_ptr<Material>> m_materials
map of names to materials
std::map<std::string, std::shared_ptr<Link>> m_links
map of names to links
std::map<int, std::string> m_linkIndicesToNames
map of link indices to names
std::map<std::string, std::shared_ptr<Joint>> m_joints
map of names to joints
std::vector<std::shared_ptr<Link>> m_rootLinks
list of root links (usually 1)
std::map<std::string, std::string> m_parentLinkTree
Keyed by child link name, provides reference to parent link.
bool m_overrideFixedBase

Protected functions

void scaleShape(Shape& shape, float scale)
Scale the transformation and parameters of a Shape.

Protected variables

float m_globalScaling
float m_massScaling
Mass scaling of the model's Link inertias.

Function documentation

void esp::metadata::URDF::Model::printKinematicChain() const

output a string to console listing the link|joint hierarchy of this model for debugging and investigation purposes

std::shared_ptr<Link> esp::metadata::URDF::Model::getLink(const std::string& linkName) const

Get a link provided its name.

Parameters
linkName The link's configured name from the URDF file.
Returns The link metadata object or nullptr if no link with provided name.

std::shared_ptr<Link> esp::metadata::URDF::Model::getLink(int linkIndex) const

Get a link provided its index.

Parameters
linkIndex The link's index.
Returns The link metadata object or nullptr if no link with provided index.

std::shared_ptr<Joint> esp::metadata::URDF::Model::getJoint(int linkIndex) const

Get a parent joint of a link provided the link index.

Parameters
linkIndex The link's index.
Returns The parent joint metadata object or nullptr if no link with provided index.

void esp::metadata::URDF::Model::setGlobalScaling(float scaling)

Set global scaling and re-scale an existing model. Modifies various internal parameters.

Parameters
scaling The new absolute uniform scale.

void esp::metadata::URDF::Model::setMassScaling(float massScaling)

Set scaling for mass from initial values configured in URDF. Modifies various internal parameters.

Parameters
massScaling The new absolute uniform mass scale.

Variable documentation

bool esp::metadata::URDF::Model::m_overrideFixedBase

if true, force this model to produce a fixed base instance (e.g. the root is not dynamic)

float esp::metadata::URDF::Model::m_globalScaling protected

Global euclidean scaling applied to the model's transforms, asset scales, and prismatic joint limits. Does not affect mass.