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.

Layout

  • src/chain.rs – core kinematics implementation
  • src/python.rs – PyO3 bindings exposed to Python
  • examples/ – ready-to-run assets (planar.urdf, quickstart.py)

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);

Why provide base_link / end_link

  • A URDF describes a tree (or forest), so the loader must know which branch to treat as the active sub-chain.
  • Explicit base_link and end_link let the library search only between those two links and ignore unrelated branches when extracting the shortest path.
  • This also clarifies behavior for floating bases or multi–end-effector robots: callers can choose different start/end pairs from one URDF to construct multiple chains as needed.

Development commands

Rust:

cargo fmt
cargo test

Python (using uv):

uv venv
source .venv/bin/activate
uv run pip install maturin  # build backend
uv run pip install .        # build + install the wheel
uv run python examples/quickstart.py

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 run pip install maturin
uv run 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. Run the bundled sample
uv run python examples/quickstart.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.1.tar.gz (18.3 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.1-cp38-abi3-macosx_11_0_arm64.whl (356.3 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for literobo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4c048b450317d204d4a6d5d466c4250685eaf879542f6a30191ac90a63dd5bc8
MD5 d6cfdfc0c8c22a9237585a4f2c34846d
BLAKE2b-256 2758b7dc5b2a6b4fa3324253156ceb716fceb8d3b22f4a52c88cd86847411c87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for literobo-0.1.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b6d355d101b60f5c7adfe41a7b486c491ba57816a2eede02e24fd925f79830bc
MD5 fc345eacd9db5c5e331692287abe0dcf
BLAKE2b-256 6ebb33bd2c6e512036ad56ab2ba8660f819cd301afe2f565b927265f3d0809c8

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