URDFType

class urdfpy.URDFType[source]

Bases: object

Abstract base class for all URDF types.

This has useful class methods for automatic parsing/unparsing of XML trees.

There are three overridable class variables:

  • _ATTRIBS - This is a dictionary mapping attribute names to a tuple, (type, required) where type is the Python type for the attribute and required is a boolean stating whether the attribute is required to be present.
  • _ELEMENTS - This is a dictionary mapping element names to a tuple, (type, required, multiple) where type is the Python type for the element, required is a boolean stating whether the element is required to be present, and multiple is a boolean indicating whether multiple elements of this type could be present. Elements are child nodes in the XML tree, and their type must be a subclass of URDFType.
  • _TAG - This is a string that represents the XML tag for the node containing this type of object.