urdf_utils¶
- mplib.urdf_utils.compute_default_collisions(
- robot: ArticulatedModel,
- *,
- num_samples=100000,
- verbose=False,
Compute default collision pairs for generating SRDF.
This function mimics MoveIt2’s
moveit_setup::srdf_setup::computeDefaultCollisions()- Parameters:
robot – an
ArticulatedModelnum_samples – number of samples to find the link that will always collide
verbose – print debug info
- Returns:
SRDF content as an XML string
- mplib.urdf_utils.replace_urdf_package_keyword(
- urdf_path: str | Path,
- new_package_keyword: str = '',
Some ROS URDF files use package:// keyword to refer the package dir. Replace it with the given string (default is empty)
- Parameters:
urdf_path – Path to a Unified Robot Description Format file.
new_package_keyword – the string to replace
package://keyword
- Returns:
Path to the modified URDF file
- mplib.urdf_utils.generate_srdf(
- urdf_path: str | Path,
- new_package_keyword: str = '',
- *,
- num_samples=100000,
- verbose=False,
Generate SRDF from URDF similar to MoveIt2’s setup assistant.
- Parameters:
urdf_path – Path to a Unified Robot Description Format file.
new_package_keyword – the string to replace
package://keywordnum_samples – number of samples to find the link that will always collide
verbose – print debug info
- Returns:
Path to the generated SRDF file