newton.utils.parse_urdf#

class newton.utils.parse_urdf(urdf_filename, builder, xform=None, floating=False, base_joint=None, scale=1.0, hide_visuals=False, parse_visuals_as_colliders=False, up_axis=Axis.Z, force_show_colliders=False, enable_self_collisions=True, ignore_inertial_definitions=True, ensure_nonstatic_links=True, static_link_mass=1e-2, collapse_fixed_joints=False)#

Parses a URDF file and adds the bodies and joints to the given ModelBuilder.

Parameters:
  • urdf_filename (str) – The filename of the URDF file to parse.

  • builder (ModelBuilder) – The ModelBuilder to add the bodies and joints to.

  • xform (Transform) – The transform to apply to the root body. If None, the transform is set to identity.

  • floating (bool) – If True, the root body is a free joint. If False, the root body is connected via a fixed joint to the world, unless a base_joint is defined.

  • base_joint (Union[str, dict]) – The joint by which the root body is connected to the world. This can be either a string defining the joint axes of a D6 joint with comma-separated positional and angular axis names (e.g. β€œpx,py,rz” for a D6 joint with linear axes in x, y and an angular axis in z) or a dict with joint parameters (see ModelBuilder.add_joint()).

  • scale (float) – The scaling factor to apply to the imported mechanism.

  • hide_visuals (bool) – If True, hide visual shapes.

  • parse_visuals_as_colliders (bool) – If True, the geometry defined under the <visual> tags is used for collision handling instead of the <collision> geometries.

  • up_axis (AxisType) – The up axis of the URDF. This is used to transform the URDF to the builder’s up axis. It also determines the up axis of capsules and cylinders in the URDF. The default is Z.

  • force_show_colliders (bool) – If True, the collision shapes are always shown, even if there are visual shapes.

  • enable_self_collisions (bool) – If True, self-collisions are enabled.

  • ignore_inertial_definitions (bool) – If True, the inertial parameters defined in the URDF are ignored and the inertia is calculated from the shape geometry.

  • ensure_nonstatic_links (bool) – If True, links with zero mass are given a small mass (see static_link_mass) to ensure they are dynamic.

  • static_link_mass (float) – The mass to assign to links with zero mass (if ensure_nonstatic_links is set to True).

  • collapse_fixed_joints (bool) – If True, fixed joints are removed and the respective bodies are merged.

__init__(**kwargs)#