ur-analytic-ik


Nameur-analytic-ik JSON
Version 0.0.5 PyPI version JSON
download
home_page
SummaryC++ implementation with Python bindings of analytic forward and inverse kinematics for the Universal Robots.
upload_time2024-03-16 22:28:57
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords robotics kinematics universal-robots
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            UR Analytic IK
================
C++ implementation with Python bindings of analytic forward and inverse kinematics for the Universal Robots based on [Alternative Inverse Kinematic Solution of the UR5 Robotic Arm](https://link.springer.com/chapter/10.1007/978-3-030-90033-5_22).

> This project is still very experimental, the API will likely still change.

Installation
------------

> Don't forget to activate your venv or conda environment.

Clone this repository, then
```bash
cd ur-analytic-ik
pip install .
```


Usage
-----
Afterwards, you should be able to issue the FK and IK functions like this:

```python
import numpy as np
from ur_analytic_ik import ur5e

eef_pose = np.identity(4)
X = np.array([-1.0, 0.0, 0.0])
Y = np.array([0.0, 1.0, 0.0])
Z = np.array([0.0, 0.0, -1.0])
top_down_orientation = np.column_stack([X, Y, Z])
translation = np.array([-0.2, -0.2, 0.2])

eef_pose[:3, :3] = top_down_orientation
eef_pose[:3, 3] = translation

solutions = ur5e.inverse_kinematics(eef_pose)
```

More examples:
```python
import numpy as np
from ur_analytic_ik import ur3e

joints = np.zeros(6)
eef_pose = np.identity(4)
eef_pose[2, 3] = 0.4
tcp_transform = np.identity(4)
tcp_transform[2, 3] = 0.1

ur3e.forward_kinematics(0, 0, 0, 0, 0, 0)
ur3e.forward_kinematics(*joints)
tcp_pose = ur3e.forward_kinematics_with_tcp(*joints, tcp_transform)

joint_solutions = ur3e.inverse_kinematics(eef_pose)
joint_solutions = ur3e.inverse_kinematics_closest(eef_pose, *joints)
joint_solutions = ur3e.inverse_kinematics_with_tcp(eef_pose, tcp_transform)
```


Testing
-------
In the root directory of this repo, to run the tests:
```
pytest -v
```

Development
--------------------
Some linux users have eigen installed at /usr/include/eigen3 instead of /usr/include/Eigen. Symlink it:
```
sudo ln -sf /usr/include/eigen3/Eigen /usr/include/Eigen
sudo ln -sf /usr/include/eigen3/unsupported /usr/include/unsupported
```

**Releasing:**
Similar to how I release my pure Python projects e.g. [`airo-models`](https://github.com/airo-ugent/airo-models).
One additional step is needed: manually create a release on Github.

Welcome Improvements
--------------------

### Python API
Adding an IK function that returns the closest solution and accepts a TCP transform.

Reducing the amount of separate IK functions, e.g. replacing:
```python
ur3e.inverse_kinematics_with_tcp(eef_pose)
# with
ur3e.inverse_kinematics(eef_pose, tcp=tcp_transform)
```
The same holds for functions ending with `_closest()`.

### Performance
Currently IK runs at about 10 μs / EEF pose on my laptop.
However, before I implemented the filtering of the solutions, it was closer to 3 μs.
Part of this is because I adapted the bindings in `ur_analytic_ik_ext.cpp` to return vectors with the solutions.

### Code Quality
* Adding more technical documentation.
* `ur_analytic_ik_ext.cpp` should be made much more readable.
* Reducing some duplication e.g. when defining the IK/FK functions and bindings for the different robots.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ur-analytic-ik",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "robotics kinematics universal-robots",
    "author": "",
    "author_email": "Victor-Louis De Gusseme <victorlouisdg@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/92/5e/02d7c84eca384ffe95a3522509f936070ecb62fe9880843ae24daffc0b15/ur-analytic-ik-0.0.5.tar.gz",
    "platform": null,
    "description": "UR Analytic IK\n================\nC++ implementation with Python bindings of analytic forward and inverse kinematics for the Universal Robots based on [Alternative Inverse Kinematic Solution of the UR5 Robotic Arm](https://link.springer.com/chapter/10.1007/978-3-030-90033-5_22).\n\n> This project is still very experimental, the API will likely still change.\n\nInstallation\n------------\n\n> Don't forget to activate your venv or conda environment.\n\nClone this repository, then\n```bash\ncd ur-analytic-ik\npip install .\n```\n\n\nUsage\n-----\nAfterwards, you should be able to issue the FK and IK functions like this:\n\n```python\nimport numpy as np\nfrom ur_analytic_ik import ur5e\n\neef_pose = np.identity(4)\nX = np.array([-1.0, 0.0, 0.0])\nY = np.array([0.0, 1.0, 0.0])\nZ = np.array([0.0, 0.0, -1.0])\ntop_down_orientation = np.column_stack([X, Y, Z])\ntranslation = np.array([-0.2, -0.2, 0.2])\n\neef_pose[:3, :3] = top_down_orientation\neef_pose[:3, 3] = translation\n\nsolutions = ur5e.inverse_kinematics(eef_pose)\n```\n\nMore examples:\n```python\nimport numpy as np\nfrom ur_analytic_ik import ur3e\n\njoints = np.zeros(6)\neef_pose = np.identity(4)\neef_pose[2, 3] = 0.4\ntcp_transform = np.identity(4)\ntcp_transform[2, 3] = 0.1\n\nur3e.forward_kinematics(0, 0, 0, 0, 0, 0)\nur3e.forward_kinematics(*joints)\ntcp_pose = ur3e.forward_kinematics_with_tcp(*joints, tcp_transform)\n\njoint_solutions = ur3e.inverse_kinematics(eef_pose)\njoint_solutions = ur3e.inverse_kinematics_closest(eef_pose, *joints)\njoint_solutions = ur3e.inverse_kinematics_with_tcp(eef_pose, tcp_transform)\n```\n\n\nTesting\n-------\nIn the root directory of this repo, to run the tests:\n```\npytest -v\n```\n\nDevelopment\n--------------------\nSome linux users have eigen installed at /usr/include/eigen3 instead of /usr/include/Eigen. Symlink it:\n```\nsudo ln -sf /usr/include/eigen3/Eigen /usr/include/Eigen\nsudo ln -sf /usr/include/eigen3/unsupported /usr/include/unsupported\n```\n\n**Releasing:**\nSimilar to how I release my pure Python projects e.g. [`airo-models`](https://github.com/airo-ugent/airo-models).\nOne additional step is needed: manually create a release on Github.\n\nWelcome Improvements\n--------------------\n\n### Python API\nAdding an IK function that returns the closest solution and accepts a TCP transform.\n\nReducing the amount of separate IK functions, e.g. replacing:\n```python\nur3e.inverse_kinematics_with_tcp(eef_pose)\n# with\nur3e.inverse_kinematics(eef_pose, tcp=tcp_transform)\n```\nThe same holds for functions ending with `_closest()`.\n\n### Performance\nCurrently IK runs at about 10 \u03bcs / EEF pose on my laptop.\nHowever, before I implemented the filtering of the solutions, it was closer to 3 \u03bcs.\nPart of this is because I adapted the bindings in `ur_analytic_ik_ext.cpp` to return vectors with the solutions.\n\n### Code Quality\n* Adding more technical documentation.\n* `ur_analytic_ik_ext.cpp` should be made much more readable.\n* Reducing some duplication e.g. when defining the IK/FK functions and bindings for the different robots.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "C++ implementation with Python bindings of analytic forward and inverse kinematics for the Universal Robots.",
    "version": "0.0.5",
    "project_urls": {
        "Homepage": "https://github.com/Victorlouisdg/ur-analytic-ik",
        "Issues": "https://github.com/Victorlouisdg/ur-analytic-ik/issues"
    },
    "split_keywords": [
        "robotics",
        "kinematics",
        "universal-robots"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "140cd9031b2ee3335b105d8d77439e9e51bfbad6fe3640bff8a1686f70955d32",
                "md5": "5fcfd4cfc603efbdebdcd128841f8e77",
                "sha256": "4e0bc218a5dcdba24fe68fb4303c4d570d65fac7d8e5b1cedaac22a6ae59a34f"
            },
            "downloads": -1,
            "filename": "ur_analytic_ik-0.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "5fcfd4cfc603efbdebdcd128841f8e77",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.8",
            "size": 25826826,
            "upload_time": "2024-03-16T22:28:24",
            "upload_time_iso_8601": "2024-03-16T22:28:24.516483Z",
            "url": "https://files.pythonhosted.org/packages/14/0c/d9031b2ee3335b105d8d77439e9e51bfbad6fe3640bff8a1686f70955d32/ur_analytic_ik-0.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5463c23f3a27b8d26d23ba0429ce55c4bcc0829cffb882d003de4e569d2bb6fe",
                "md5": "3fc189658411c21d13b8536c61039596",
                "sha256": "0a42cb5196684d7df0065481917ffd06dded613b5dace85ccca196bc3b98e850"
            },
            "downloads": -1,
            "filename": "ur_analytic_ik-0.0.5-cp310-cp310-musllinux_1_1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "3fc189658411c21d13b8536c61039596",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.8",
            "size": 26152535,
            "upload_time": "2024-03-16T22:28:28",
            "upload_time_iso_8601": "2024-03-16T22:28:28.117991Z",
            "url": "https://files.pythonhosted.org/packages/54/63/c23f3a27b8d26d23ba0429ce55c4bcc0829cffb882d003de4e569d2bb6fe/ur_analytic_ik-0.0.5-cp310-cp310-musllinux_1_1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2ff063a65695bdf9d5ff99b1cac18c804360407aaa88a5ea1ed56603b7c1accc",
                "md5": "47c74c95c8dc1eb9a21cd80e8838e017",
                "sha256": "c302b20125c81762710b2c062db0ab9faef1255aeba4f9e7f54607cbc29913d2"
            },
            "downloads": -1,
            "filename": "ur_analytic_ik-0.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "47c74c95c8dc1eb9a21cd80e8838e017",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8",
            "size": 25826716,
            "upload_time": "2024-03-16T22:28:32",
            "upload_time_iso_8601": "2024-03-16T22:28:32.138918Z",
            "url": "https://files.pythonhosted.org/packages/2f/f0/63a65695bdf9d5ff99b1cac18c804360407aaa88a5ea1ed56603b7c1accc/ur_analytic_ik-0.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b97bea12f1206c6854aed81bbac43088241ce43be161d41b1d458743e116b53a",
                "md5": "e8950cbabe991efcc877f6a4be8b2357",
                "sha256": "4455e4766d281b0f06c578a6cf71086a3f0190b96a689db9105da37db58835f1"
            },
            "downloads": -1,
            "filename": "ur_analytic_ik-0.0.5-cp311-cp311-musllinux_1_1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "e8950cbabe991efcc877f6a4be8b2357",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.8",
            "size": 26152428,
            "upload_time": "2024-03-16T22:28:35",
            "upload_time_iso_8601": "2024-03-16T22:28:35.980859Z",
            "url": "https://files.pythonhosted.org/packages/b9/7b/ea12f1206c6854aed81bbac43088241ce43be161d41b1d458743e116b53a/ur_analytic_ik-0.0.5-cp311-cp311-musllinux_1_1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "69c1639f70c5f3ed84094c5135bce4f06cf97babef84de1ee6de99e01de283d8",
                "md5": "ccb8aea7dad5e281e494ba059d117cfc",
                "sha256": "e0dd745fc8db451c61c660ab05ecc1bac21986275e09fcb0407c4277caf7f8ba"
            },
            "downloads": -1,
            "filename": "ur_analytic_ik-0.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "ccb8aea7dad5e281e494ba059d117cfc",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 25826806,
            "upload_time": "2024-03-16T22:28:40",
            "upload_time_iso_8601": "2024-03-16T22:28:40.025378Z",
            "url": "https://files.pythonhosted.org/packages/69/c1/639f70c5f3ed84094c5135bce4f06cf97babef84de1ee6de99e01de283d8/ur_analytic_ik-0.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "20a1f1f170d1b366fcac51e705cf097eea4689e06688777d7be6649ac239c310",
                "md5": "618e5518b5de0caaf2d247333451ae87",
                "sha256": "876ddc443652b043fadf9e4a3bcd91411f5d4a276c99d23b3b5117972156c5c6"
            },
            "downloads": -1,
            "filename": "ur_analytic_ik-0.0.5-cp38-cp38-musllinux_1_1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "618e5518b5de0caaf2d247333451ae87",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.8",
            "size": 26150715,
            "upload_time": "2024-03-16T22:28:44",
            "upload_time_iso_8601": "2024-03-16T22:28:44.141813Z",
            "url": "https://files.pythonhosted.org/packages/20/a1/f1f170d1b366fcac51e705cf097eea4689e06688777d7be6649ac239c310/ur_analytic_ik-0.0.5-cp38-cp38-musllinux_1_1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ed13dc7a596bc863556895b93e2b9146dde7fa3660b22d52c4a9a459a705393",
                "md5": "d5d4c26aad5c681e99f8b43d21727db9",
                "sha256": "78be42b7f8d538b0c74f1e46c5bd56e2428c80462c8646a2515aa534035c6e31"
            },
            "downloads": -1,
            "filename": "ur_analytic_ik-0.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "d5d4c26aad5c681e99f8b43d21727db9",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.8",
            "size": 25826799,
            "upload_time": "2024-03-16T22:28:47",
            "upload_time_iso_8601": "2024-03-16T22:28:47.345229Z",
            "url": "https://files.pythonhosted.org/packages/4e/d1/3dc7a596bc863556895b93e2b9146dde7fa3660b22d52c4a9a459a705393/ur_analytic_ik-0.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "57b89da870b82d2829fd4e7a91af24e32e8b02a01ec830de86dc54c8887cb900",
                "md5": "06309c1989ab54aeefb1e3c6bda7d44d",
                "sha256": "7c9cf4d82e41ab39245288197af4dcf0bea16a9ca44243e66197f63036fe3a19"
            },
            "downloads": -1,
            "filename": "ur_analytic_ik-0.0.5-cp39-cp39-musllinux_1_1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "06309c1989ab54aeefb1e3c6bda7d44d",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.8",
            "size": 26152524,
            "upload_time": "2024-03-16T22:28:51",
            "upload_time_iso_8601": "2024-03-16T22:28:51.196557Z",
            "url": "https://files.pythonhosted.org/packages/57/b8/9da870b82d2829fd4e7a91af24e32e8b02a01ec830de86dc54c8887cb900/ur_analytic_ik-0.0.5-cp39-cp39-musllinux_1_1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da91a77ed490bdb05788183ea52a05e7872daa4404a5b438d102e71814be44e0",
                "md5": "993fbb79bd64b7d87b65ee498e03a66b",
                "sha256": "989b2ec578c122c8fc8f278ad8e31d12e3708ec88999378e79cf4b1ff538afab"
            },
            "downloads": -1,
            "filename": "ur_analytic_ik-0.0.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "993fbb79bd64b7d87b65ee498e03a66b",
            "packagetype": "bdist_wheel",
            "python_version": "pp39",
            "requires_python": ">=3.8",
            "size": 25823698,
            "upload_time": "2024-03-16T22:28:54",
            "upload_time_iso_8601": "2024-03-16T22:28:54.754773Z",
            "url": "https://files.pythonhosted.org/packages/da/91/a77ed490bdb05788183ea52a05e7872daa4404a5b438d102e71814be44e0/ur_analytic_ik-0.0.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "925e02d7c84eca384ffe95a3522509f936070ecb62fe9880843ae24daffc0b15",
                "md5": "04f6d052cd9b5f098abefecad381f1e6",
                "sha256": "ffac82a4e08614cea54b4ac4a4cc30088b09ece772f82832f24a769ece2e69af"
            },
            "downloads": -1,
            "filename": "ur-analytic-ik-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "04f6d052cd9b5f098abefecad381f1e6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 419550,
            "upload_time": "2024-03-16T22:28:57",
            "upload_time_iso_8601": "2024-03-16T22:28:57.035463Z",
            "url": "https://files.pythonhosted.org/packages/92/5e/02d7c84eca384ffe95a3522509f936070ecb62fe9880843ae24daffc0b15/ur-analytic-ik-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-16 22:28:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Victorlouisdg",
    "github_project": "ur-analytic-ik",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ur-analytic-ik"
}
        
Elapsed time: 0.20010s