Skip to main content

A simpler and easier-to-use library for loading, manipulating, saving, and visualizing URDF files.

Project description

Build Status Documentation Status Coverage Status PyPI version

yourdfpy

Yet anOther URDF parser for Python. Yup, it's another one. Deal with it.

Yourdfpy is a simpler and easier-to-use library for loading, manipulating, validating, saving, and visualizing URDF files.

Installation

You can install yourdfpy directly from pip:

pip install yourdfpy

But why another one?!?

Why are you wasting not only your but also our time? you might ask. Fair point. There are already urdfpy and urdf_parser_py that deal with URDFs. Unfortunately, none of these solutions allow customizable URDF parsing that is fully independent of validation and mesh loading. Dealing with filenames, outdated dependencies, open bug reports, and limited flexibility when it comes to serialization are other disadvantages. As shown in the table below, yourdfpy is the most robust one when it comes to loading URDFs in the wild.

Example URDFs

urdfpy urdf_parser_py yourdfpy
Decouple parsing from validation :heavy_check_mark:
Decouple parsing from loading meshes :heavy_check_mark: :heavy_check_mark:
Visualize URDF :heavy_check_mark: :heavy_check_mark:
Forward Kinematics :heavy_check_mark: :heavy_check_mark:
Robustness test: loading 12 URDF files from here 4/12 6/12 12/12
Avg. loading time per file (w/ mesh loading) 480 ms 370 ms
(w/o mesh loading) 3.2 ms 6.2 ms
Test on 4 URDF files on which urdfpy succeeds 347.5 ms 203 ms
Test on 6 URDF files on which urdf_parser_py succeeds 2.6 ms 3.8 ms
Click to expand code listing that produces the above table entries.
robot_assets = ['robot-assets/urdfs/robots/barret_hand/bhand_model.URDF', 'robot-assets/urdfs/robots/robotiq_gripper/robotiq_arg85_description.URDF', 'robot-assets/urdfs/robots/anymal/anymal.urdf', 'robot-assets/urdfs/robots/franka_panda/panda.urdf', 'robot-assets/urdfs/robots/ginger_robot/gingerurdf.urdf', 'robot-assets/urdfs/robots/halodi/eve_r3.urdf', 'robot-assets/urdfs/robots/kinova/kinova.urdf', 'robot-assets/urdfs/robots/kuka_iiwa/model.urdf', 'robot-assets/urdfs/robots/pr2/pr2.urdf', 'robot-assets/urdfs/robots/ur10/ur10_robot.urdf', 'robot-assets/urdfs/robots/ur5/ur5_gripper.urdf', 'robot-assets/urdfs/robots/yumi/yumi.urdf']

import urdfpy
import urdf_parser_py
import yourdfpy

from functools import partial

def load_urdfs(fnames, load_fn):
    results = {fname: None for fname in fnames}
    for fname in fnames:
        try:
            x = load_fn(fname)
            results[fname] = x
        except:
            pass
    print(sum([1 for x, y in results.items() if y is not None]), "/", len(fnames))
    return results

# parsing success rate
load_urdfs(robot_assets, urdfpy.URDF.load)
load_urdfs(robot_assets, urdf_parser_py.urdf.URDF.load)
load_urdfs(robot_assets, yourdfpy.URDF.load)

# parsing times
%timeit load_urdfs(robot_assets, urdfpy.URDF.load)
%timeit load_urdfs(robot_assets, urdf_parser_py.urdf.URDF.load)
%timeit load_urdfs(robot_assets, yourdfpy.URDF.load)
%timeit load_urdfs(robot_assets, partial(yourdfpy.URDF.load, load_meshes=False, build_scene_graph=False))

# fairer comparison with yourdfpy
urdfpy_fnames = [x for x, y in load_urdfs(robot_assets, urdfpy.URDF.load).items() if y is not None]
%timeit load_urdfs(urdfpy_fnames, yourdfpy.URDF.load)

# fairer comparison with urdf_parser_py
urdfparser_fnames = [x for x, y in load_urdfs(robot_assets, urdf_parser_py.urdf.URDF.from_xml_file).items() if y is not None]
%timeit load_urdfs(urdfparser_fnames, functools.partial(yourdfpy.URDF.load, load_meshes=False, build_scene_graph=False))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yourdfpy-0.0.42.tar.gz (532.9 kB view details)

Uploaded Source

Built Distribution

yourdfpy-0.0.42-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file yourdfpy-0.0.42.tar.gz.

File metadata

  • Download URL: yourdfpy-0.0.42.tar.gz
  • Upload date:
  • Size: 532.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for yourdfpy-0.0.42.tar.gz
Algorithm Hash digest
SHA256 b102734d292a6d017864db0d42d64f18e302a829072b3004f4d1fee4b5d1607c
MD5 7cbcd68717fe154eecb4ccb4f4f84383
BLAKE2b-256 b21f09eeb362a5f3c9c095483b0a6ebe982e53b9c81e6f7270c00614def6c1af

See more details on using hashes here.

File details

Details for the file yourdfpy-0.0.42-py3-none-any.whl.

File metadata

  • Download URL: yourdfpy-0.0.42-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for yourdfpy-0.0.42-py3-none-any.whl
Algorithm Hash digest
SHA256 239071eea1ec0eb26cead122872470d8c4854d3b42db97e82f15d9735dcdb2bb
MD5 99557f6c2fa7686002c41fe51af17ff5
BLAKE2b-256 5764b13675fd63af24e7b6d7c3f716324d890491a59097f5e322f44a07e521b6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page