embodichain.toolkits#

Submodules

GraspKit#

URDF Assembly Tool#

Classes:

URDFAssemblyManager

A class to manage the assembly of URDF files and their components.

class embodichain.toolkits.urdf_assembly.URDFAssemblyManager[source]#

Bases: object

A class to manage the assembly of URDF files and their components.

Attributes:

Methods:

__init__([component_registry, ...])

add_component(component_type, urdf_path[, ...])

Add a URDF component to the component registry.

attach_sensor(sensor_name, sensor_source, ...)

Attach a sensor to a specific component and link, and register it in the sensor registry.

get_attached_sensors()

Get all attached sensors from the sensor registry.

get_component(component_type)

Retrieve a component from the registry by its type/name.

merge_urdfs([output_path, use_signature_check])

Merge URDF files according to single base link, connection point naming, and type compatibility matrix rules.

SUPPORTED_COMPONENTS = ['chassis', 'legs', 'torso', 'head', 'left_arm', 'right_arm', 'left_hand', 'right_hand', 'arm', 'hand']#
SUPPORTED_MESH_TYPES = ['stl', 'obj', 'ply', 'dae', 'glb']#
SUPPORTED_SENSORS = ['camera', 'lidar', 'imu', 'gps', 'force']#
SUPPORTED_WHEEL_TYPES = ['omni', 'differential', 'tracked']#
__init__(component_registry=None, sensor_registry=None, mesh_manager=None, component_manager=None, sensor_manager=None)[source]#
add_component(component_type, urdf_path, transform=None, **params)[source]#

Add a URDF component to the component registry.

This method creates a URDFComponent object and registers it in the component registry.

Parameters:
  • component_type (str) – The type/name of the component (e.g., ‘chassis’, ‘head’).

  • urdf_path (str or Path) – Path to the URDF file for this component.

  • transform (np.ndarray, optional) – 4x4 transformation matrix for positioning the component.

  • **params – Additional component-specific parameters (e.g., wheel_type for chassis).

Returns:

True if component added successfully, False otherwise.

Return type:

bool

attach_sensor(sensor_name, sensor_source, parent_component, parent_link, transform=None, **kwargs)[source]#

Attach a sensor to a specific component and link, and register it in the sensor registry.

This method creates a SensorAttachment object and registers it in the sensor registry.

Parameters:
  • sensor_name (str) – Unique name for the sensor (e.g., ‘camera’).

  • sensor_source (str or ET.Element) – Path to the sensor’s URDF file or an XML element.

  • parent_component (str) – Name of the component to which the sensor is attached.

  • parent_link (str) – Name of the link within the parent component for attachment.

  • **kwargs – Additional keyword arguments (e.g., transform, sensor_type).

Returns:

True if sensor attached successfully, False otherwise.

Return type:

bool

get_attached_sensors()[source]#

Get all attached sensors from the sensor registry.

Returns:

A dictionary mapping sensor names to SensorAttachment objects.

Return type:

dict

get_component(component_type)[source]#

Retrieve a component from the registry by its type/name.

Parameters:

component_type (str) – The type/name of the component to retrieve.

Returns:

The registered component object, or None if not found.

Return type:

URDFComponent or None

merge_urdfs(output_path='./assembly_robot.urdf', use_signature_check=True)[source]#

Merge URDF files according to single base link, connection point naming, and type compatibility matrix rules.

Parameters:
  • output_path (str) – Path where the merged URDF file will be saved.

  • use_signature_check (bool) – Whether to check signatures to avoid redundant processing.

Returns:

The root element of the merged URDF.

Return type:

ET.Element