pyrcf.utils.urdf_utils

Functions

_convert_to_fixed(urdf, joint_names_to_values)

Hack to modify urdf to fix specific joints to specified values.

temp_path_urdf_with_joints_fixed(urdf_file_path, ...)

Get the context of a temporary URDF file path after modifying the specified joints to be

create_new_urdf_with_joints_fixed(→ str)

Creates a new urdf file with the specified joints set to "fixed".

Module Contents

pyrcf.utils.urdf_utils._convert_to_fixed(urdf: yourdfpy.URDF, joint_names_to_values: Mapping[str, float])

Hack to modify urdf to fix specific joints to specified values.

Parameters:
  • urdf (yourdfpy.URDF) – The yourdfpy urdf object to modify.

  • joint_names_to_values (Mapping[str, float]) – Dictionary containing name of joints that should be locked as keys, and the joint values to lock them at as values.

pyrcf.utils.urdf_utils.temp_path_urdf_with_joints_fixed(urdf_file_path: str, joint_names_to_values: Mapping[str, float])

Get the context of a temporary URDF file path after modifying the specified joints to be “fixed”.

This method only provides a context. This is useful for temporarily writing the URDF to a file for consumption by other programs.

Parameters:
  • urdf_file_path (str) – Path to original urdf file.

  • joint_names_to_values (Mapping[str, float]) – Dictionary containing name of joints that should be locked as keys, and the joint values to lock them at as values.

Yields:

str – Path to new urdf file.

Examples

Use as a context manager:
>>> with temp_path_urdf_with_joints_fixed(...) as path:
        load_file_from_path(path)  # do something with this urdf
pyrcf.utils.urdf_utils.create_new_urdf_with_joints_fixed(urdf_file_path: str, joint_names_to_values: Mapping[str, float]) str

Creates a new urdf file with the specified joints set to “fixed”.

Parameters:
  • urdf_file_path (str) – Path to original urdf file.

  • joint_names_to_values (Mapping[str, float]) – Dictionary containing name of joints that should be locked as keys, and the joint values to lock them at as values.

Returns:

Path to new urdf file.

Return type:

str