rofunc.utils.robolab.formatter.mjcf_parser.attribute#

Classes representing various MJCF attribute data types.

1.  Module Contents#

1.1.  Classes#

String

A string MJCF attribute.

Integer

An integer MJCF attribute.

Float

An float MJCF attribute.

Keyword

A keyword MJCF attribute.

Array

An array MJCF attribute.

Identifier

A string attribute that represents a unique identifier of an element.

Reference

A string attribute that represents a reference to an identifier.

BasePath

A string attribute that represents a base path for an asset type.

BaseAsset

Base class for binary assets.

Asset

Class representing a binary asset.

SkinAsset

Class representing a binary asset corresponding to a skin.

File

Attribute representing an asset file.

1.2.  API#

class rofunc.utils.robolab.formatter.mjcf_parser.attribute.String(name, required, parent, value, conflict_allowed, conflict_behavior)[source]#

Bases: rofunc.utils.robolab.formatter.mjcf_parser.attribute._Attribute

A string MJCF attribute.

Initialization

class rofunc.utils.robolab.formatter.mjcf_parser.attribute.Integer(name, required, parent, value, conflict_allowed, conflict_behavior)[source]#

Bases: rofunc.utils.robolab.formatter.mjcf_parser.attribute._Attribute

An integer MJCF attribute.

Initialization

class rofunc.utils.robolab.formatter.mjcf_parser.attribute.Float(name, required, parent, value, conflict_allowed, conflict_behavior)[source]#

Bases: rofunc.utils.robolab.formatter.mjcf_parser.attribute._Attribute

An float MJCF attribute.

Initialization

to_xml_string(prefix_root=None, *, precision=constants.XML_DEFAULT_PRECISION, zero_threshold=0, **kwargs)[source]#
class rofunc.utils.robolab.formatter.mjcf_parser.attribute.Keyword(name, required, parent, value, conflict_allowed, conflict_behavior, valid_values)[source]#

Bases: rofunc.utils.robolab.formatter.mjcf_parser.attribute._Attribute

A keyword MJCF attribute.

Initialization

property valid_values#
class rofunc.utils.robolab.formatter.mjcf_parser.attribute.Array(name, required, parent, value, conflict_allowed, conflict_behavior, length, dtype)[source]#

Bases: rofunc.utils.robolab.formatter.mjcf_parser.attribute._Attribute

An array MJCF attribute.

Initialization

to_xml_string(prefix_root=None, *, precision=constants.XML_DEFAULT_PRECISION, zero_threshold=0, **kwargs)[source]#
class rofunc.utils.robolab.formatter.mjcf_parser.attribute.Identifier(name, required, parent, value, conflict_allowed, conflict_behavior)[source]#

Bases: rofunc.utils.robolab.formatter.mjcf_parser.attribute._Attribute

A string attribute that represents a unique identifier of an element.

Initialization

to_xml_string(prefix_root=None, **kwargs)[source]#
class rofunc.utils.robolab.formatter.mjcf_parser.attribute.Reference(name, required, parent, value, conflict_allowed, conflict_behavior, reference_namespace)[source]#

Bases: rofunc.utils.robolab.formatter.mjcf_parser.attribute._Attribute

A string attribute that represents a reference to an identifier.

Initialization

property value#
property reference_namespace#
to_xml_string(prefix_root, **kwargs)[source]#
class rofunc.utils.robolab.formatter.mjcf_parser.attribute.BasePath(name, required, parent, value, conflict_allowed, conflict_behavior, path_namespace)[source]#

Bases: rofunc.utils.robolab.formatter.mjcf_parser.attribute._Attribute

A string attribute that represents a base path for an asset type.

Initialization

to_xml_string(prefix_root=None, **kwargs)[source]#
class rofunc.utils.robolab.formatter.mjcf_parser.attribute.BaseAsset(extension, prefix='')[source]#

Base class for binary assets.

Initialization

get_vfs_filename()[source]#

Returns the name of the asset file as registered in MuJoCo’s VFS.

class rofunc.utils.robolab.formatter.mjcf_parser.attribute.Asset(contents, extension, prefix='')[source]#

Bases: rofunc.utils.robolab.formatter.mjcf_parser.attribute.BaseAsset

Class representing a binary asset.

Initialization

Initializes a new Asset.

Args:

contents: The contents of the file as a bytestring. extension: A string specifying the file extension (e.g. ‘.png’, ‘.stl’). prefix: (optional) A prefix applied to the filename given in MuJoCo’s VFS.

class rofunc.utils.robolab.formatter.mjcf_parser.attribute.SkinAsset(contents, parent, extension, prefix='')[source]#

Bases: rofunc.utils.robolab.formatter.mjcf_parser.attribute.BaseAsset

Class representing a binary asset corresponding to a skin.

Initialization

property contents#
class rofunc.utils.robolab.formatter.mjcf_parser.attribute.File(name, required, parent, value, conflict_allowed, conflict_behavior, path_namespace)[source]#

Bases: rofunc.utils.robolab.formatter.mjcf_parser.attribute._Attribute

Attribute representing an asset file.

Initialization

get_contents()[source]#

Returns a bytestring representing the contents of the asset.

to_xml_string(prefix_root=None, **kwargs)[source]#

Returns the asset filename as it will appear in the generated XML.