Skip to main content

Python bindings for spherical-wrist industrial robot kinematics

Project description

spherical-wrist

spherical-wrist is a Python package for six-axis industrial robot kinematics, collision checking, path planning, and visualization.

spherical-wrist is backed by the rs-opw-kinematics crate. It wraps the same Rust library as py-opw-kinematics, but exposes a broader API surface: py-opw-kinematics intentionally publishes only a selected subset of rs-opw-kinematics.

The goal of spherical-wrist is to make the full potential of rs-opw-kinematics available from Python, including collision-free path and trajectory planning. Collision checking is separate from inverse kinematics, but collision-aware stroke planning needs both capabilities close together: available from multiple threads and without repeated Python-Rust boundary crossing overhead.

The public API is Python first: joint positions are tuples or arrays, poses are SciPy RigidTransform objects, and examples are plain Python scripts.

Install

python -m pip install spherical-wrist

The package requires Python 3.11 or newer.

For local development, source builds, and maturin, see Development With Maturin. The Rust dependencies are resolved from crates.io during the build.

Hello World

Create a kinematic model, compute a TCP pose from joint angles, then ask inverse kinematics for joint solutions that reach the same pose.

from scipy.spatial.transform import RigidTransform, Rotation
from spherical_wrist import KinematicModel, Robot

model = KinematicModel(
    a1=400,
    a2=-250,
    b=0,
    c1=830,
    c2=1175,
    c3=1444,
    c4=230,
    offsets=(0, 0, 0, 0, 0, 0),
    flip_axes=(True, False, True, True, False, True),
)

robot = Robot(model, degrees=True)

tool = RigidTransform.from_components(
    rotation=Rotation.from_euler("xyz", [0, -90, 0], degrees=True),
    translation=[0, 0, 0],
)

joints = (10, 0, -90, 0, 0, 0)
pose = robot.forward(joints, tool=tool)
solutions = robot.inverse(pose, tool=tool)

print("TCP position:", pose.translation)
print("IK solutions:", solutions)

The same script is in python/examples/readme_intro.py.

What It Does

  • analytical forward and inverse kinematics for spherical-wrist industrial arms
  • continuing inverse kinematics that handles wrist singularities with a previous joint position
  • optional joint constraints and solution ranking
  • 5-DOF inverse kinematics for tools that do not care about J6 rotation
  • base, tool, frame, and parallelogram transforms
  • mesh loading and collision/proximity checks
  • shaped robot models with tool, base, and environment geometry
  • RRT joint-space planning
  • Cartesian stroke planning with annotated path segments
  • Bevy-based visualization and path playback

Main Examples

The most useful examples are:

  • cartesian_stroke.py: builds a shaped Staubli RX160 robot, plans a Cartesian TCP stroke, annotates the path, and plays it in the visualization window.
  • path_planning_rrt.py: plans a collision-free joint-space path between start and goal configurations.

Run them with:

python python/examples/cartesian_stroke.py
python python/examples/path_planning_rrt.py

If your shell has ROS or another global Python stack on PYTHONPATH, unset it for these commands:

env -u PYTHONPATH python python/examples/cartesian_stroke.py

See Examples for the full example catalog.

Visualization Requirements

The default release includes visualization tools that are important for trying out the package easily and checking if the robot is properly configured. Headless release for advanced users who have RViz or comparable visualization as an alternative is planned.

Non-visual kinematics, collision, and planning APIs need only the Python dependencies installed by pip. Visualization opens a Bevy/wgpu desktop window, so it also needs a graphical session and a working GPU driver.

Linux:

  • run inside an X11 or Wayland desktop session; headless servers and minimal containers need a display server or virtual display setup
  • install GPU runtime drivers, including a Vulkan driver such as mesa-vulkan-drivers, vulkan-radeon, vulkan-intel, or the appropriate NVIDIA driver package for your system
  • if building from source, install Bevy's native build dependencies: g++, pkg-config, libx11-dev, libasound2-dev, libudev-dev, libxkbcommon-x11-0, libwayland-dev, and libxkbcommon-dev

macOS:

  • run in a normal graphical login session on a Metal-capable Mac
  • prebuilt wheels should not require Xcode or command line tools at runtime
  • source builds require Apple's command line tools or Xcode

Windows:

  • run in a normal graphical desktop session with current GPU drivers
  • prebuilt wheels should not require Visual Studio Build Tools at runtime
  • source builds require the Visual Studio C++ build tools and a Windows SDK

Documentation

Project Links

Please use the GitHub repository to raise issues and provide merge requests. The core Rust implementation is rs-opw-kinematics. A useful background article is An Analytical Solution of the Inverse Kinematics Problem of Industrial Serial Manipulators with an Ortho-parallel Basis and a Spherical Wrist.

Use cases

Use Robot when you only need kinematics. It provides forward kinematics for all roboto joints, not only the tool-tip pose.

Use KinematicsWithShape when robot geometry matters: collision checks, distance queries, path planning, or visualization.

Use RRTPlanner when you want to move the robot between the two known poses. It plans a collision-free joint-space path between them and can enforce a configurable safety distance around geometry. That margin matters in real cells: calibration error can otherwise turn a mathematically valid near-contact path into brief surface contact, resulting in scratches, or robot damage.

Use CartesianPlanner when the tool center point must follow a Cartesian stroke defined by poses. It can start from an arbitrary robot pose, plan the landing into best suitable joint configuration for the stroke when alternatives exist, and plan a collision-free path that follows the Cartesian line. Simple joint interpolation does not provide that guarantee.

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

spherical_wrist-0.0.1.tar.gz (994.5 kB view details)

Uploaded Source

Built Distributions

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

spherical_wrist-0.0.1-cp314-cp314-win_amd64.whl (22.3 MB view details)

Uploaded CPython 3.14Windows x86-64

spherical_wrist-0.0.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (31.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

spherical_wrist-0.0.1-cp314-cp314-macosx_11_0_arm64.whl (26.8 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

spherical_wrist-0.0.1-cp314-cp314-macosx_10_12_x86_64.whl (26.9 MB view details)

Uploaded CPython 3.14macOS 10.12+ x86-64

spherical_wrist-0.0.1-cp313-cp313-win_amd64.whl (22.3 MB view details)

Uploaded CPython 3.13Windows x86-64

spherical_wrist-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (31.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

spherical_wrist-0.0.1-cp313-cp313-macosx_11_0_arm64.whl (26.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

spherical_wrist-0.0.1-cp313-cp313-macosx_10_12_x86_64.whl (26.9 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

spherical_wrist-0.0.1-cp312-cp312-win_amd64.whl (22.3 MB view details)

Uploaded CPython 3.12Windows x86-64

spherical_wrist-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (31.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

spherical_wrist-0.0.1-cp312-cp312-macosx_11_0_arm64.whl (26.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

spherical_wrist-0.0.1-cp312-cp312-macosx_10_12_x86_64.whl (26.9 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

spherical_wrist-0.0.1-cp311-cp311-win_amd64.whl (22.3 MB view details)

Uploaded CPython 3.11Windows x86-64

spherical_wrist-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (31.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

spherical_wrist-0.0.1-cp311-cp311-macosx_11_0_arm64.whl (26.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

spherical_wrist-0.0.1-cp311-cp311-macosx_10_12_x86_64.whl (26.9 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

Details for the file spherical_wrist-0.0.1.tar.gz.

File metadata

  • Download URL: spherical_wrist-0.0.1.tar.gz
  • Upload date:
  • Size: 994.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for spherical_wrist-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8fc639da59346746029eea24a8146ecfd3e49953f0387d21db7fdc070af76416
MD5 cf7159b11fa2cbf1039f5dc893a3efb7
BLAKE2b-256 34f4a52c236df6e53ddfcf8fa117fcb84012f298beca7cb660b1dc10f8d1f897

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1.tar.gz:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 edbc2c72d2c4f915b468fd6b2a870db6ed1496c38d12931ea02062940ddf7f36
MD5 3886ed271df9ccee7ae34c1e2721f2da
BLAKE2b-256 7bdfc45b42e0c43a6b38abf54cdc05bc41fb5d56532b682bbc74685c70eddac6

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp314-cp314-win_amd64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c0152af5d61ab06fe39eeff9dae054914457848a4534c94313de7c535cec8243
MD5 5df443958ace05498d4654d9f077c380
BLAKE2b-256 80f2a75dcfe2d02bc5ec879d6377a65bbd504270301dd9a1076567c2ea3c542e

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 13b2d31d787147c49dfeb907c70714c9c976146964d8bfb02644d5df16968f38
MD5 9c26da7b7eec33a1557a8e835b37a919
BLAKE2b-256 9954d7942952b71a466cf904f8c29cb809df55d664cea8d468c9a1bcfca66bb5

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp314-cp314-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp314-cp314-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d0f0c3752fc2719580fd1268f851f58ebde76baa7804bd74914426f5ff1bf733
MD5 a0eca8c0ad062b045a75f9ab2eb5bf5d
BLAKE2b-256 c2500c5618989d3f6536c574afa738d9ce3dcfeb5da75be8ace3344dcc043449

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp314-cp314-macosx_10_12_x86_64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2a257bd27074f65e83c53e51de07815ea2dc69c63e9992590d987ba11a3886ee
MD5 61b9ff4828a2fa8303ebe22da7c81bcc
BLAKE2b-256 2c07459003364c0d839992b5a2d3d5708512524775d636430af96b917d7b94a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp313-cp313-win_amd64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 03c8a2399570f68680f1567dedbe9ac505fb2fea8e0fd1c17fe3f38c26699417
MD5 343286857f5b59a57f2189dc559dba09
BLAKE2b-256 8c236312069863a62867546fbc5f9ace4af21b0b08815ca980e6ba86de7df4f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 47016bb1261b8289f665b23ead57f68915aabf6df1bad063eb6c65b9c41b629b
MD5 46f7d216ddbddb9f55e6c932048cae46
BLAKE2b-256 eefe9b16689449c884d96e90208e751d6c894bcd3acba8a07941a69537031f61

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d8ae0fe52592d70816ea1d683fd2219f281e492a4bf7f1c664c1eee10195fc46
MD5 ead1ec684d9b151ed39c9d557175ffbc
BLAKE2b-256 44a552df339d9915b8cfab8da3d24b9a1d10cb99236aa028fc01a76cf2a49ca5

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 938f32a0aab0a44f98d2e6b1236459fadc8a08a997a23d48cc5c24e7404b2872
MD5 9f644216af46079e970b780279d685e1
BLAKE2b-256 fdf943c766c7b2ba1bdeffd3123dafe09ad0fb43bae4aba367fc7bcb80d9bbd7

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp312-cp312-win_amd64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 461ae81d56d3290429474abcca5af5fb9469f33226a332382f056529d31cc105
MD5 f02b4032a50b521529e0450df3ef4f90
BLAKE2b-256 fd8edea4bdf4b79e3be407a1015eab3cc4ae14f4fefbc70b26bbcb3bb7a8b60a

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 68e29613acecbe01416b487943a7caa7cd1292f14540bb164b59d5d5efe0470b
MD5 7dacc0e155ec309a4b28565a914536d8
BLAKE2b-256 2e488242914a049e3cd2c2b3b694d783d400c5c2fef45df88980614730d80ebd

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 edbab86b990a43f4db3a98ca9de9387cafc77ab6b60d58105fa12726984648d0
MD5 bfdc5abfabafe5fb5bae60448c21c4d0
BLAKE2b-256 0bfd1ad87670c35824a3454c3af8192c6350c74692b9d476b1fd0d5bc5540aa9

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 76c892a6a8afcb8cb795abc0803d787c59e3a98b82a9650389a2f737d32fef0c
MD5 f4d703660c61f8d6863fe5f218e088a2
BLAKE2b-256 a420cf7792cd5c1c4180c1fbd5d9ae2663ce27e555a5949fac22bac9e7186f81

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp311-cp311-win_amd64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8efcb5020efe5eb9adefd477b554f1cbf7bfe6c8e2b0902a4d8a1b3bdeaadf75
MD5 a2f24a9fe470a6f542a69ffeda92c784
BLAKE2b-256 b592f5f07f8c8fbb2a49076d1ab43016286d315fe3269815f1305bb2bc21e759

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 11549848add9cd2740dc550ec04616d07e6ab947a873587b5e8f0d613fb0af0a
MD5 be91b1ea09a00fa3b687fcebdbbae709
BLAKE2b-256 f5101db8472635bf74582358f76fc24749b4d9476ae5027086fde593eb5a22c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spherical_wrist-0.0.1-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for spherical_wrist-0.0.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 12bf2df8e7c1950e83aa085b03558c3ab8e5fc97b540a15eb75bb5a9be28d99d
MD5 5c026910ae922d4a3e6c39beb53bafe5
BLAKE2b-256 c261ff09b57f4dc6875abed453401b6c0f63f7dec57ed3d37c544759026331d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for spherical_wrist-0.0.1-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: release.yml on bourumir-wyngs/spherical-wrist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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