{"id":6570,"library":"cmeel-urdfdom","title":"cmeel-urdfdom: URDF Parser","description":"cmeel-urdfdom provides Python bindings for the `urdfdom` C++ library, which is used for parsing Unified Robot Description Format (URDF) XML files. It allows Python applications to load, manipulate, and query robot models defined in URDF. The current version is 4.0.1, with releases typically tracking the underlying `urdfdom` C++ library and often including `cmeel`-specific build suffixes.","status":"active","version":"4.0.1","language":"en","source_language":"en","source_url":"https://github.com/cmake-wheel/cmeel-urdfdom","tags":["urdf","robotics","xml","cmeel","parser"],"install":[{"cmd":"pip install cmeel-urdfdom","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Provides the necessary C++ headers for the underlying urdfdom library, essential for binding.","package":"urdfdom-headers","optional":false}],"imports":[{"symbol":"URDF","correct":"from urdfdom.urdf import URDF"}],"quickstart":{"code":"from urdfdom.urdf import URDF\n\n# A simple URDF string for a single link robot\nsimple_urdf_string = \"\"\"<?xml version=\\\"1.0\\\"?>\n<robot name=\\\"simple_robot\\\">\n  <link name=\\\"base_link\\\">\n    <visual>\n      <geometry>\n        <box size=\\\"1 1 1\\\"/>\n      </geometry>\n    </visual>\n  </link>\n  <joint name=\\\"fixed_joint\\\" type=\\\"fixed\\\">\n    <parent link=\\\"base_link\\\"/>\n    <child link=\\\"child_link\\\"/>\n    <origin xyz=\\\"0 0 1\\\" rpy=\\\"0 0 0\\\"/>\n  </joint>\n  <link name=\\\"child_link\\\">\n    <visual>\n      <geometry>\n        <cylinder radius=\\\"0.1\\\" length=\\\"0.5\\\"/>\n      </geometry>\n    </visual>\n  </link>\n</robot>\n\"\"\"\n\ntry:\n    robot = URDF.load_from_xml_string(simple_urdf_string)\n    print(f\"Successfully loaded robot: {robot.name}\")\n    print(f\"Number of links: {len(robot.links)}\")\n    print(f\"Number of joints: {len(robot.joints)}\")\n\n    # Access a link\n    if 'base_link' in robot.links:\n        print(f\"Base link geometry: {robot.links['base_link'].visuals[0].geometry.box.size}\")\n\n    # Access a joint\n    if 'fixed_joint' in robot.joints:\n        joint = robot.joints['fixed_joint']\n        print(f\"Fixed joint type: {joint.joint_type}\")\n        print(f\"Fixed joint origin: {joint.origin.xyz}\")\n\nexcept Exception as e:\n    print(f\"Error loading URDF: {e}\")","lang":"python","description":"This quickstart demonstrates how to load a URDF robot model from an XML string using `URDF.load_from_xml_string`. It then shows how to access basic properties like the robot's name, the number of links and joints, and specific details of a link and a joint."},"warnings":[{"fix":"Always check the release notes for `cmeel-urdfdom` and `urdfdom-headers` when upgrading, especially across major versions. Ensure your `urdfdom-headers` dependency matches the `cmeel-urdfdom` requirements as specified in its `pyproject.toml` or `setup.cfg`.","message":"Underlying C++ library version mismatches can cause API breaks. `cmeel-urdfdom` wraps the C++ `urdfdom` library, and major version updates in either `cmeel-urdfdom` or its dependency `urdfdom-headers` can introduce breaking changes due to alterations in the underlying C++ API or its Python bindings.","severity":"breaking","affected_versions":"All major version changes (e.g., 3.x to 4.x)."},{"fix":"Install in an environment with pre-built wheels (most common Linux, macOS, Windows systems). If installation fails, ensure you have necessary C++ build tools or refer to the `cmeel` documentation for custom build instructions.","message":"This is not a pure Python library; it relies on compiled C++ components. While `cmeel` aims to provide pre-built wheels for common platforms, environments without pre-built wheels may require a C++ compiler toolchain (e.g., CMake, C++ compiler) for installation, which can be complex.","severity":"gotcha","affected_versions":"All versions."},{"fix":"Validate URDF files with external tools (e.g., `check_urdf` from `ros_urdf_check` for ROS users, or a generic XML linter) before attempting to load them programmatically. Gradually build complex URDFs from simpler, verified components.","message":"XML parsing errors can be challenging to debug. When parsing malformed or syntactically incorrect URDF XML, the error messages originating from the underlying C++ `urdfdom` parser can sometimes be cryptic or not pinpoint the exact line or issue in the XML string or file.","severity":"gotcha","affected_versions":"All versions."}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}