Skip to content

Daoming-Chen/Kinex

Repository files navigation

Kinex

License PyPI version npm version

中文文档 | Documentation | Examples

A modern C++20 robotics kinematics library with Python and WebAssembly bindings for browser-based robotics applications.

✨ Features

  • 🚀 High Performance: Analytical Jacobian computation 5-10x faster than automatic differentiation
  • 🎯 Inverse Kinematics: SQP-based solver with joint limit constraints (~100-300µs per solve)
  • 🌐 WebAssembly Support: Run kinematics in the browser with near-native performance
  • 🐍 Python Bindings: Easy-to-use Python API with NumPy integration
  • 📊 Production Ready: Comprehensive benchmarks and test coverage
  • 🎨 3D Visualization: Interactive Three.js examples for robot visualization

🎬 Live Demo

Try the interactive UR5 robot visualization: Live Demo

UR5 Visualization Demo

📦 Quick Install

Python (via pip)

pip install kinex

JavaScript/TypeScript (via npm)

npm install @daoming.chen/kinex

🚀 Quick Start

Python Example

import kinex
import numpy as np

# Load robot from URDF (Unified API)
robot = kinex.Robot.from_urdf("ur5e.urdf", "tool0")

# Forward kinematics
joint_angles = np.array([0.0, -1.57, 0.0, 0.0, 0.0, 0.0])
pose = robot.forward_kinematics(joint_angles)
print(f"Position: {pose.translation()}")

# Inverse kinematics
target_pose = ... # Transform object
solution, status = robot.inverse_kinematics(target_pose, q_init=np.zeros(6))
if status.converged:
    print(f"Joint solution: {solution}")

JavaScript/WebAssembly Example

import createKinexModule from '@daoming.chen/kinex';

// Initialize WASM module
const kinex = await createKinexModule();

// Load robot from URDF string (Unified API)
const robot = kinex.Robot.fromURDFString(urdfContent, "tool0");

// Compute forward kinematics
const pose = robot.forwardKinematics([0.0, -1.57, 0.0, 0.0, 0.0, 0.0]);
console.log('Position:', pose.position);

// Solve inverse kinematics
const targetPose = {
  position: [0.5, 0.0, 0.5],
  quaternion: [1.0, 0.0, 0.0, 0.0]
};
const result = robot.inverseKinematics(targetPose, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]);
console.log('Solution:', result.solution);

📊 Performance

Kinex is designed for production use with excellent performance characteristics:

Benchmark Results

IK solver performance across real-world robots showing solve times, iteration counts, and success rates.

Key Metrics:

  • Cold Start IK: ~100-300µs per solve
  • 🔥 Warm Start IK: ~50-150µs per solve
  • 📐 Jacobian Computation: <5µs (analytical)
  • Success Rate: >99% convergence
  • 🌐 WebAssembly: Near-native performance

See detailed benchmarks for more information.

📖 Documentation

🛠️ Building from Source

# Clone with submodules
git clone --recursive https://github.com/Daoming-Chen/kinex.git
cd kinex

# Build C++ library
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j

# Install
sudo cmake --install build

For platform-specific instructions, see the build guide.

🗺️ Roadmap

  • ✅ URDF parsing
  • ✅ Forward kinematics
  • ✅ Analytical Jacobian computation
  • ✅ Inverse kinematics (SQP solver)
  • ✅ WebAssembly bindings
  • ✅ Performance benchmarks
  • ✅ Three.js visualization examples
  • ✅ Python bindings
  • 🚧 Full-featured web application
  • 🔜 Collision detection (COAL integration)
  • 🔜 Multi-solution IK (IKFlow integration)
  • 🔜 Cartesian path tracking (RelaxedIK-inspired)
  • 🔜 ROS2 integration

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Eigen - Fast linear algebra library
  • DaQP - Efficient quadratic programming solver
  • pugixml - Lightweight XML parser for URDF parsing
  • nanobind - Efficient C++/Python bindings
  • spdlog - Fast C++ logging library
  • GoogleTest - C++ testing framework
  • Emscripten - WebAssembly compilation toolchain

📧 Support


Made with ❤️ for the robotics community

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •