conversion

Conversion from scene related things to other formats.

Package Contents

Functions

multi_body_system_to_urdf(→ tuple[str, ...)

Convert a multi-body system to URDF.

multi_body_system_to_urdf(multi_body_system: simulation.scene._multi_body_system.MultiBodySystem, name: str) tuple[str, list[simulation.scene.geometry.GeometryPlane], list[simulation.scene.geometry.GeometryHeightmap], list[tuple[simulation.scene._joint_hinge.JointHinge, str]], list[tuple[simulation.scene.geometry.Geometry, str]], list[tuple[simulation.scene._rigid_body.RigidBody, str]]]

Convert a multi-body system to URDF.

It must be acyclic and the root body must also be the tree root. Furthermore, for each joint, the first body will be considered the parent, and as such must be the parent in the tree.

Plane and heightmap cannot be represented in URDF and will be returned as in lists. It is checked they only exist as part of the root rigid body and for static multi-body systems.

Parameters:
  • multi_body_system – The multi-body system to convert.

  • name – The name to using in the URDF. It will be a prefix for every name in the model.

Returns:

A urdf string, plane geometries, heightmap geometries, joints and their names in the urdf, geometries and their names in the urdf, rigid bodies and their names in the urdf.

Raises:

ValueError – In case the graph is cyclic.

# noqa: DAR402 ValueError