Skip to main content

Lightweight URDF kinematics (forward kinematics + Jacobian) with Rust speed and Python bindings.

Project description

literobo

Lightweight kinematics utilities for URDF robots, implemented in Rust with Python bindings.

Features

  • Parse URDF files and build a kinematic chain between any two links.
  • Forward kinematics that returns a homogeneous transform.
  • Geometric Jacobian for revolute and prismatic joints.
  • Python bindings powered by PyO3 and packaged with maturin.

Rust usage

use literobo::KinematicChain;

let chain = KinematicChain::from_urdf_file("robot.urdf", "base_link", "tool_link")?;
let pose = chain.forward_kinematics(&[0.0, 0.5, -1.0])?;
let jacobian = chain.jacobian(&[0.0, 0.5, -1.0])?;
println!("Pose:\n{}", pose.to_homogeneous());
println!("Jacobian:\n{}", jacobian);

Python usage

The project is configured for uv so you can manage dependencies and builds without a virtualenv toolchain mismatch.

# Create an isolated environment
uv venv
source .venv/bin/activate

# Install build dependency and compile the wheel
uv pip install maturin
uv pip install .
import numpy as np
import literobo

robot = literobo.from_urdf_file("robot.urdf", "base_link", "tool_link")
q = np.array([0.0, 0.5, -1.0])
pose = robot.forward_kinematics(q)
jacobian = robot.jacobian(q)

print("Pose:\n", pose)
print("Jacobian:\n", jacobian)

To publish, run uv build (which delegates to maturin under the hood) and upload the wheel to PyPI with uv publish.

Quick sample run (Python)

Below is a minimal end-to-end example you can run locally:

# 1. Prepare environment (inside repo root)
uv venv
source .venv/bin/activate
uv pip install maturin  # build backend

# 2. Build & install the wheel from the checked-out source
uv pip install .

# 3. Create a tiny planar robot URDF
cat > planar.urdf <<'URDF'
<robot name="planar">
  <link name="base"/>
  <link name="link1"/>
  <link name="link2"/>
  <link name="tool"/>
  <joint name="joint1" type="revolute">
    <parent link="base"/>
    <child link="link1"/>
    <origin xyz="0 0 0" rpy="0 0 0"/>
    <axis xyz="0 0 1"/>
  </joint>
  <joint name="joint2" type="revolute">
    <parent link="link1"/>
    <child link="link2"/>
    <origin xyz="1 0 0" rpy="0 0 0"/>
    <axis xyz="0 0 1"/>
  </joint>
  <joint name="tip" type="fixed">
    <parent link="link2"/>
    <child link="tool"/>
    <origin xyz="1 0 0" rpy="0 0 0"/>
  </joint>
</robot>
URDF

# 4. Run a short script
python - <<'PY'
import numpy as np
import literobo

robot = literobo.from_urdf_file("planar.urdf", "base", "tool")
q = np.array([0.0, 0.5])

pose = robot.forward_kinematics(q)
jac = robot.jacobian(q)

print("Pose:\n", pose)
print("Jacobian:\n", jac)
PY

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

literobo-0.1.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

literobo-0.1.0-cp38-abi3-macosx_11_0_arm64.whl (356.2 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file literobo-0.1.0.tar.gz.

File metadata

  • Download URL: literobo-0.1.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.2

File hashes

Hashes for literobo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 40e716a345b959f720116aef15c9303c7aef91641d5d8f1d8ba78546285998cd
MD5 b034882f1bd9e02c9920104e54acbe81
BLAKE2b-256 d2c697ba2b3b1563f25db11b9718b45bfcd4738c75e43feb15f7750cd8e2b2cc

See more details on using hashes here.

File details

Details for the file literobo-0.1.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for literobo-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a8f2eb252b872d179ccc184325df368b97a2472d362318fe9641c137be618127
MD5 5dc9102f59067d46e96e913456766858
BLAKE2b-256 75e734198c236ba17f49447d402773c34e4f8671a9a9549faa1abbfd1ffdaeb9

See more details on using hashes here.

Supported by

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