diff --git a/CHANGELOG.md b/CHANGELOG.md index fef6ba3..718ed6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file. ### Changed - Update `piper_mj_description` to load `piper.xml` instead of `scene.xml` (thanks to @jonzamora) +- Allow passing `kwargs` to `yourdfpy.load_robot_description` (thanks to @sea-bass) ## [1.17.0] - 2025-05-08 diff --git a/robot_descriptions/loaders/yourdfpy.py b/robot_descriptions/loaders/yourdfpy.py index 205619a..fed79bc 100644 --- a/robot_descriptions/loaders/yourdfpy.py +++ b/robot_descriptions/loaders/yourdfpy.py @@ -23,6 +23,7 @@ def load_robot_description( description_name: str, commit: Optional[str] = None, + **kwargs, ) -> yourdfpy.URDF: """Load a robot description in yourdfpy. @@ -30,6 +31,11 @@ def load_robot_description( description_name: Name of the robot description. commit: If specified, check out that commit from the cloned robot description repository. + kwargs: arguments passed to yourdfpy.URDF.load function, including: + build_scene_graph: Whether to build a scene graph from visual elements. + build_collision_scene_graph: Whether to build a scene graph from collision elements. + load_meshes: Whether to load the meshes for the visual elements. + load_collision_meshes: Whether to load the meshes for the collision elements. Returns: Robot model for yourdfpy. @@ -42,4 +48,8 @@ def load_robot_description( if not hasattr(module, "URDF_PATH"): raise ValueError(f"{description_name} is not a URDF description") - return yourdfpy.URDF.load(module.URDF_PATH, mesh_dir=module.PACKAGE_PATH) + return yourdfpy.URDF.load( + module.URDF_PATH, + mesh_dir=module.PACKAGE_PATH, + **kwargs, + )