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 implementationsrc/python.rs– PyO3 bindings exposed to Pythonexamples/– 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_linkandend_linklet 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 run pip install maturin # build backend
# 2. Build & install the wheel from the checked-out source
uv run 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file literobo-0.1.2.tar.gz.
File metadata
- Download URL: literobo-0.1.2.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c432cff60b1960ee634e51b311ccf18d3389ef168565cac2d6efe5de950c774c
|
|
| MD5 |
ac236a69ac233a341f4a09e38aabacc2
|
|
| BLAKE2b-256 |
04aa0dfd0570d7ea27c22ccf54d9791c184ac35952faf744b0f3fc765ee2b7db
|
File details
Details for the file literobo-0.1.2-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: literobo-0.1.2-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 356.3 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df2162f2d329ebc8c51c91743f07337bf01754014c83646c20a0f81df83786ef
|
|
| MD5 |
d11d1bbc32cd3353cc0a82d557083931
|
|
| BLAKE2b-256 |
20a00dbcb6a64fdbe7ca8dbead167711af33586e610bd1ba4fb86e5c6db735a1
|