{"id":23430859,"url":"https://github.com/ivy-llc/robot","last_synced_at":"2026-04-02T11:21:33.820Z","repository":{"id":40245227,"uuid":"331019165","full_name":"ivy-llc/robot","owner":"ivy-llc","description":"Functions and classes for gradient-based robot motion planning, written in Ivy.","archived":false,"fork":false,"pushed_at":"2023-08-28T06:54:19.000Z","size":21023,"stargazers_count":51,"open_issues_count":0,"forks_count":11,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-04-12T23:28:48.340Z","etag":null,"topics":["deep-learning","ivy","machine-learning","motion-planning","mxnet","numpy","path-planning","python","pytorch","robot","tensorflow","trajectory-optimization"],"latest_commit_sha":null,"homepage":"https://unify.ai","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivy-llc.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-19T15:10:08.000Z","updated_at":"2024-05-17T16:51:33.000Z","dependencies_parsed_at":"2024-06-02T16:56:41.510Z","dependency_job_id":null,"html_url":"https://github.com/ivy-llc/robot","commit_stats":null,"previous_names":["ivy-dl/robot","unifyai/robot","ivy-llc/robot","transpile-ai/robot"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/ivy-llc/robot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivy-llc%2Frobot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivy-llc%2Frobot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivy-llc%2Frobot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivy-llc%2Frobot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivy-llc","download_url":"https://codeload.github.com/ivy-llc/robot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivy-llc%2Frobot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31305275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","ivy","machine-learning","motion-planning","mxnet","numpy","path-planning","python","pytorch","robot","tensorflow","trajectory-optimization"],"created_at":"2024-12-23T09:47:35.907Z","updated_at":"2026-04-02T11:21:33.804Z","avatar_url":"https://github.com/ivy-llc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://github.com/unifyai/unifyai.github.io/blob/main/img/externally_linked/logo.png?raw=true#gh-light-mode-only\n   :width: 100%\n   :class: only-light\n\n.. image:: https://github.com/unifyai/unifyai.github.io/blob/main/img/externally_linked/logo_dark.png?raw=true#gh-dark-mode-only\n   :width: 100%\n   :class: only-dark\n\n.. raw:: html\n\n    \u003cbr/\u003e\n    \u003ca href=\"https://pypi.org/project/ivy-robot/0.0.1.post0/\"\u003e\n        \u003cimg class=\"dark-light\" style=\"float: left; padding-right: 4px; padding-bottom: 4px;\" src=\"https://badge.fury.io/py/ivy-robot.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/unifyai/robot/actions?query=workflow%3Adocs\"\u003e\n        \u003cimg class=\"dark-light\" style=\"float: left; padding-right: 4px; padding-bottom: 4px;\" src=\"https://github.com/unifyai/robot/actions/workflows/docs.yml/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/unifyai/robot/actions?query=workflow%3Anightly-tests\"\u003e\n        \u003cimg class=\"dark-light\" style=\"float: left; padding-right: 4px; padding-bottom: 4px;\" src=\"https://github.com/unifyai/robot/actions/workflows/nightly-tests.yml/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://discord.gg/G4aR9Q7DTN\"\u003e\n        \u003cimg class=\"dark-light\" style=\"float: left; padding-right: 4px; padding-bottom: 4px;\" src=\"https://img.shields.io/discord/799879767196958751?color=blue\u0026label=%20\u0026logo=discord\u0026logoColor=white\"\u003e\n    \u003c/a\u003e\n    \u003cbr clear=\"all\" /\u003e\n\n**Functions and classes for gradient-based robot motion planning, written in Ivy.**\n\n.. raw:: html\n\n    \u003cdiv style=\"display: block;\" align=\"center\"\u003e\n        \u003cimg class=\"dark-light\" width=\"6%\" style=\"float: left;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/supported/empty.png\"\u003e\n        \u003ca href=\"https://jax.readthedocs.io\"\u003e\n            \u003cimg class=\"dark-light\" width=\"13%\" style=\"float: left;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/supported/jax_logo.png\"\u003e\n        \u003c/a\u003e\n        \u003cimg class=\"dark-light\" width=\"12%\" style=\"float: left;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/supported/empty.png\"\u003e\n        \u003ca href=\"https://www.tensorflow.org\"\u003e\n            \u003cimg class=\"dark-light\" width=\"13%\" style=\"float: left;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/supported/tensorflow_logo.png\"\u003e\n        \u003c/a\u003e\n        \u003cimg class=\"dark-light\" width=\"12%\" style=\"float: left;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/supported/empty.png\"\u003e\n        \u003ca href=\"https://pytorch.org\"\u003e\n            \u003cimg class=\"dark-light\" width=\"13%\" style=\"float: left;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/supported/pytorch_logo.png\"\u003e\n        \u003c/a\u003e\n        \u003cimg class=\"dark-light\" width=\"12%\" style=\"float: left;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/supported/empty.png\"\u003e\n        \u003ca href=\"https://numpy.org\"\u003e\n            \u003cimg class=\"dark-light\" width=\"13%\" style=\"float: left;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/supported/numpy_logo.png\"\u003e\n        \u003c/a\u003e\n        \u003cimg class=\"dark-light\" width=\"6%\" style=\"float: left;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/supported/empty.png\"\u003e\n    \u003c/div\u003e\n\nContents\n--------\n\n* `Overview`_\n* `Run Through`_\n* `Interactive Demos`_\n* `Get Involved`_\n\nOverview\n--------\n\n.. _docs: https://unify.ai/docs/robot/\n\n**What is Ivy Robot?**\n\nIvy robot provides functions and classes for gradient-based motion planning and trajectory optimization.\nClasses are provided both for mobile robots and robot manipulators.  Check out the docs_ for more info!\n\nThe library is built on top of the Ivy machine learning framework.\nThis means all functions and classes simultaneously support:\nJax, Tensorflow, PyTorch, MXNet, and Numpy.\n\n**Ivy Libraries**\n\nThere are a host of derived libraries written in Ivy, in the areas of mechanics, 3D vision, robotics, gym environments,\nneural memory, pre-trained models + implementations, and builder tools with trainers, data loaders and more. Click on the icons below to learn more!\n\n.. raw:: html\n\n    \u003cdiv style=\"display: block;\"\u003e\n        \u003ca href=\"https://github.com/unifyai/mech\"\u003e\n            \u003cpicture\u003e\n                \u003csource class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_mech_dark.png\"\u003e\n                \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_mech.png\"\u003e\n            \u003c/picture\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/vision\"\u003e\n            \u003cpicture\u003e\n                \u003csource class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_vision_dark.png\"\u003e\n                \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_vision.png\"\u003e\n            \u003c/picture\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/robot\"\u003e\n            \u003cpicture\u003e\n                \u003csource class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_robot_dark.png\"\u003e\n                \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_robot.png\"\u003e\n            \u003c/picture\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/gym\"\u003e\n            \u003cpicture\u003e\n                \u003csource class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_gym_dark.png\"\u003e\n                \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_gym.png\"\u003e\n            \u003c/picture\u003e\n        \u003c/a\u003e\n\n        \u003cbr clear=\"all\" /\u003e\n\n        \u003ca href=\"https://pypi.org/project/ivy-mech/0.0.1.post0/\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://badge.fury.io/py/ivy-mech.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://pypi.org/project/ivy-vision/0.0.1.post0/\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://badge.fury.io/py/ivy-vision.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://pypi.org/project/ivy-robot/0.0.1.post0/\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://badge.fury.io/py/ivy-robot.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://pypi.org/project/ivy-gym\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\"width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://badge.fury.io/py/ivy-gym.svg\"\u003e\n        \u003c/a\u003e\n\n        \u003cbr clear=\"all\" /\u003e\n\n        \u003ca href=\"https://github.com/unifyai/mech/actions?query=workflow%3Anightly-tests\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\"src=\"https://github.com/unifyai/mech/actions/workflows/nightly-tests.yml/badge.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/vision/actions?query=workflow%3Anightly-tests\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://github.com/unifyai/vision/actions/workflows/nightly-tests.yml/badge.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/robot/actions?query=workflow%3Anightly-tests\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://github.com/unifyai/robot/actions/workflows/nightly-tests.yml/badge.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/gym/actions?query=workflow%3Anightly-tests\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://github.com/unifyai/gym/actions/workflows/nightly-tests.yml/badge.svg\"\u003e\n        \u003c/a\u003e\n\n        \u003cbr clear=\"all\" /\u003e\n\n        \u003ca href=\"https://github.com/unifyai/memory\"\u003e\n            \u003cpicture\u003e\n                \u003csource class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_memory_dark.png\"\u003e\n                \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_memory.png\"\u003e\n            \u003c/picture\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/builder\"\u003e\n            \u003cpicture\u003e\n                \u003csource class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_builder_dark.png\"\u003e\n                \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_builder.png\"\u003e\n            \u003c/picture\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/models\"\u003e\n            \u003cpicture\u003e\n                \u003csource class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_models_dark.png\"\u003e\n                \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_models.png\"\u003e\n            \u003c/picture\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/ecosystem\"\u003e\n            \u003cpicture\u003e\n                \u003csource class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_ecosystem_dark.png\"\u003e\n                \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://raw.githubusercontent.com/unifyai/unifyai.github.io/main/img/externally_linked/logos/ivy_ecosystem.png\"\u003e\n            \u003c/picture\u003e\n        \u003c/a\u003e\n\n        \u003cbr clear=\"all\" /\u003e\n\n        \u003ca href=\"https://pypi.org/project/ivy-memory/0.0.1.post0/\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://badge.fury.io/py/ivy-memory.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://pypi.org/project/ivy-builder/0.0.1.post0/\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://badge.fury.io/py/ivy-builder.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://pypi.org/project/ivy-models\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://badge.fury.io/py/ivy-models.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/ecosystem/actions?query=workflow%3Adocs\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://github.com/unifyai/ecosystem/actions/workflows/docs.yml/badge.svg\"\u003e\n        \u003c/a\u003e\n\n        \u003cbr clear=\"all\" /\u003e\n\n        \u003ca href=\"https://github.com/unifyai/memory/actions?query=workflow%3Anightly-tests\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://github.com/unifyai/memory/actions/workflows/nightly-tests.yml/badge.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/builder/actions?query=workflow%3Anightly-tests\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://github.com/unifyai/builder/actions/workflows/nightly-tests.yml/badge.svg\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://github.com/unifyai/models/actions?query=workflow%3Anightly-tests\"\u003e\n            \u003cimg class=\"dark-light\" width=\"15%\" style=\"float: left; margin: 0% 5%;\" src=\"https://github.com/unifyai/models/actions/workflows/nightly-tests.yml/badge.svg\"\u003e\n        \u003c/a\u003e\n\n        \u003cbr clear=\"all\" /\u003e\n\n    \u003c/div\u003e\n    \u003cbr clear=\"all\" /\u003e\n\n**Quick Start**\n\nIvy robot can be installed like so: ``pip install ivy-robot==0.0.1.post0``\n\n.. _demos: https://github.com/unifyai/robot/tree/main/ivy_robot_demos\n.. _interactive: https://github.com/unifyai/robot/tree/main/ivy_robot_demos/interactive\n\nTo quickly see the different aspects of the library, we suggest you check out the demos_!\nWe suggest you start by running the script ``run_through.py``,\nand read the \"Run Through\" section below which explains this script.\n\nFor more interactive demos, we suggest you run either\n``drone_spline_planning.py`` or ``manipulator_spline_planning.py`` in the interactive_ demos folder.\n\nRun Through\n-----------\n\nWe run through some of the different parts of the library via a simple ongoing example script.\nThe full script is available in the demos_ folder, as file ``run_through.py``.\nFirst, we select a random backend framework to use for the examples, from the options\n``ivy.jax``, ``ivy.tensorflow``, ``ivy.torch``, ``ivy.mxnet`` or ``ivy.numpy``,\nand use this to set the ivy backend framework.\n\n.. code-block:: python\n\n    import ivy\n    ivy.set_backend(ivy.choose_random_backend())\n\n**Spline Planning**\n\nWe now show how a spline path can be generated from a set of spline anchor points,\nusing the method ``ivy_robot.sample_spline_path``.\nIn this example, we generate a spline path representing full 6DOF motion from a starting pose to a target pose.\nHowever, for simplicitly we fix the z translation and 3DOF rotation to zeros in this case.\n\n.. code-block:: python\n\n    # config\n    num_free_anchors = 3\n    num_samples = 100\n    constant_rot_vec = ivy.array([[0., 0., 0.]])\n    constant_z = ivy.array([[0.]])\n\n    # xy positions\n\n    # 1 x 2\n    start_xy = ivy.array([[0., 0.]])\n    target_xy = ivy.array([[1., 1.]])\n\n    # 1 x 2\n    anchor1_xy = ivy.array([[0.6, 0.2]])\n    anchor2_xy = ivy.array([[0.5, 0.5]])\n    anchor3_xy = ivy.array([[0.4, 0.8]])\n\n    # as 6DOF poses\n\n    # 1 x 6\n    start_pose = ivy.concat((start_xy, constant_z, constant_rot_vec), axis=-1)\n    anchor1_pose = ivy.concat((anchor1_xy, constant_z, constant_rot_vec), axis=-1)\n    anchor2_pose = ivy.concat((anchor2_xy, constant_z, constant_rot_vec), axis=-1)\n    anchor3_pose = ivy.concat((anchor3_xy, constant_z, constant_rot_vec), axis=-1)\n    target_pose = ivy.concat((target_xy, constant_z, constant_rot_vec), axis=-1)\n\n    num_anchors = num_free_anchors + 2\n\n    # num_anchors x 6\n    anchor_poses = ivy.concat((start_pose, anchor1_pose, anchor2_pose, anchor3_pose, target_pose), axis=0)\n\n    # uniform sampling for spline\n\n    # num_anchors x 1\n    anchor_points = ivy.expand_dims(ivy.linspace(0., 1., num_anchors), axis=-1)\n\n    # num_samples x 1\n    query_points = ivy.expand_dims(ivy.linspace(0., 1., num_samples), axis=-1)\n\n    # interpolated spline poses\n\n    # num_samples x 6\n    interpolated_poses = ivy_robot.sample_spline_path(anchor_points, anchor_poses, query_points)\n\n    # xy motion\n\n    # num_samples x 2\n    anchor_xy_positions = anchor_poses[..., 0:2]\n\n    # num_samples x 2\n    interpolated_xy_positions = interpolated_poses[..., 0:2]\n\nThe interpolated xy positions and anchor positions from the path are shown below in the x-y plane.\n\n.. image:: https://github.com/unifyai/robot/blob/main/docs/images/interpolated_drone_poses.png?raw=true\n   :width: 100%\n\n**Rigid Mobile Class**\n\nWe now introduce the ``RigidMobile`` robot class,\nwhich can be used to represent rigid jointless robots which are able to move freely.\nIn this case, we consider the case of a drone executing 6DOF motion in a scene.\n\nThe body of the drone is specified by a number of relative body points.\nIn this case, we represent the drone with 5 points: one in the centre, and one in each of the four corners.\n\nWe assume the same target position in the x-y plane as before,\nbut this time with a self-rotation of 180 degrees about the z-axis.\n\n.. code-block:: python\n\n    # drone relative body points\n    rel_body_points = ivy.array([[0., 0., 0.],\n                               [-0.1, -0.1, 0.],\n                               [-0.1, 0.1, 0.],\n                               [0.1, -0.1, 0.],\n                               [0.1, 0.1, 0.]])\n\n    # create drone as ivy rigid mobile robot\n    drone = RigidMobile(rel_body_points)\n\n    # rotatin vectors\n\n    # 1 x 3\n    start_rot_vec = ivy.array([[0., 0., 0.]])\n    target_rot_vec = ivy.array([[0., 0., np.pi]])\n\n    # 1 x 3\n    anchor1_rot_vec = ivy.array([[0., 0., np.pi/4]])\n    anchor2_rot_vec = ivy.array([[0., 0., 2*np.pi/4]])\n    anchor3_rot_vec = ivy.array([[0., 0., 3*np.pi/4]])\n\n    # as 6DOF poses\n\n    # 1 x 6\n    start_pose = ivy.concat((start_xy, constant_z, start_rot_vec), axis=-1)\n    anchor1_pose = ivy.concat((anchor1_xy, constant_z, anchor1_rot_vec), axis=-1)\n    anchor2_pose = ivy.concat((anchor2_xy, constant_z, anchor2_rot_vec), axis=-1)\n    anchor3_pose = ivy.concat((anchor3_xy, constant_z, anchor3_rot_vec), axis=-1)\n    target_pose = ivy.concat((target_xy, constant_z, target_rot_vec), axis=-1)\n\n    # num_anchors x 6\n    anchor_poses = ivy.concat((start_pose, anchor1_pose, anchor2_pose, anchor3_pose, target_pose), axis=0)\n\n    # interpolated spline poses\n\n    # num_samples x 6\n    interpolated_poses = ivy_robot.sample_spline_path(anchor_points, anchor_poses, query_points)\n\n    # as matrices\n\n    # num_anchors x 3 x 4\n    anchor_matrices = ivy_mech.rot_vec_pose_to_mat_pose(anchor_poses)\n\n    # num_samples x 3 x 4\n    interpolated_matrices = ivy_mech.rot_vec_pose_to_mat_pose(interpolated_poses)\n\n    # sample drone body\n\n    # num_anchors x num_body_points x 3\n    anchor_body_points = drone.sample_body(anchor_matrices)\n\n    # num_samples x num_body_points x 3\n    interpolated_body_points = drone.sample_body(interpolated_matrices)\n\nThe sampled drone body xy positions during motion are shown below in the x-y plane.\nBy tracing the body points for each of the four corners of the drone,\nwe can see how the drone performs the 180 degree self-rotation about the z-axis during the motion.\n\n.. image:: https://github.com/unifyai/robot/blob/main/docs/images/sampled_drone_body_positions.png?raw=true\n   :width: 100%\n\n**Manipulator Class**\n\nWe now introduce the robot Manipulator class,\nwhich can be used to represent arbitrary robot manipulators.\nIn this case, we consider the case of very simple 2-link manipulator,\nwhich is constrained to move in the x-y plane.\n\nThe manipulator is specified by the Denavit–Hartenberg parameters,\nas outlined in the newly derived class below.\nWe assume a manipulator with two 0.5m links,\nwhere a configuration with both joints angles at 0 degrees represents a upright link configuration.\nWe specify a new set of target joint angles which corresponds with\na forward reaching motion in the positive x direction.\n\n.. code-block:: python\n\n    class SimpleManipulator(Manipulator):\n\n        def __init__(self, base_inv_ext_mat=None):\n            a_s = ivy.array([0.5, 0.5])\n            d_s = ivy.array([0., 0.])\n            alpha_s = ivy.array([0., 0.])\n            dh_joint_scales = ivy.ones((2,))\n            dh_joint_offsets = ivy.array([-np.pi/2, 0.])\n            super().__init__(a_s, d_s, alpha_s, dh_joint_scales, dh_joint_offsets, base_inv_ext_mat)\n\n    # create manipulator as ivy manipulator\n    manipulator = SimpleManipulator()\n\n    # joint angles\n\n    # 1 x 2\n    start_joint_angles = ivy.array([[0., 0.]])\n    target_joint_angles = ivy.array([[-np.pi/4, -np.pi/4]])\n\n    # 1 x 2\n    anchor1_joint_angles = -ivy.array([[0.2, 0.6]])*np.pi/4\n    anchor2_joint_angles = -ivy.array([[0.5, 0.5]])*np.pi/4\n    anchor3_joint_angles = -ivy.array([[0.8, 0.4]])*np.pi/4\n\n    # num_anchors x 2\n    anchor_joint_angles = ivy.concat(\n        (start_joint_angles, anchor1_joint_angles, anchor2_joint_angles, anchor3_joint_angles,\n         target_joint_angles), axis=0)\n\n    # interpolated joint angles\n\n    # num_anchors x 2\n    interpolated_joint_angles = ivy_robot.sample_spline_path(anchor_points, anchor_joint_angles, query_points)\n\nThe interpolated joint angles are presented below.\n\n.. image:: https://github.com/unifyai/robot/blob/main/docs/images/interpolated_manipulator_joint_angles.png?raw=true\n   :width: 100%\n\nIn a similar fashion to how the drone body was sampled in the previous example,\nwe next use these interpolated joint angles to sample the link positions for the manipulator.\n\n.. code-block:: python\n\n    # sample links\n\n    # num_anchors x num_link_points x 3\n    anchor_link_points = manipulator.sample_links(anchor_joint_angles, samples_per_metre=5)\n\n    # num_anchors x num_link_points x 3\n    interpolated_link_points = manipulator.sample_links(interpolated_joint_angles, samples_per_metre=5)\n\nwe show the sampled link positions during the course of the forward reaching motion in the x-y plane below.\n\n.. image:: https://github.com/unifyai/robot/blob/main/docs/images/sampled_manipulator_links.png?raw=true\n   :width: 100%\n\nInteractive Demos\n-----------------\n\nThe main benefit of the library is not simply the ability to sample paths, but to optimize these paths using gradients.\nFor exmaple, the body or link sample positions can be used to query the signed distance function (SDF) of a 3D scene in batch.\nThen, assuming the spline anchor points to be free variables,\nthe gradients of the mean sampled SDF and a path length metric can be computed with respect to the anchor points.\nThe anhcor points can then be incrementally updated using gradient descent on this loss function.\n\nWe provide two further demo scripts which outline this gradient-based path optimization in a 3D scene.\nRather than presenting the code here, we show visualizations of the demos.\nThe scripts for these demos can be found in the interactive_ demos folder.\n\n**RigidMobile Planning**\n\nThe first demo uses the ``RigidMobile`` class to optimzie the motion of a drone to a target pose,\nmaking use of functions ``ivy_robot.sample_spline_path`` and ``ivy_robot.RigidMobile.sample_body``.\n\n.. raw:: html\n\n    \u003cp align=\"center\"\u003e\n        \u003cimg width=\"75%\" style=\"display: block;\" src='https://github.com/unifyai/unifyai.github.io/blob/main/img/externally_linked/ivy_robot/demo_a.gif?raw=true'\u003e\n    \u003c/p\u003e\n\n**Manipulator Planning**\n\nThe second demo uses the ``MicoManipulator`` class, derived from ``Manipulator``,\nto optimzie the motion of a mico robot manipulator to a set of target joint angles,\nmaking use of functions ``ivy_robot.sample_spline_path`` and ``ivy_robot.Manipulator.sample_links``.\n\n.. raw:: html\n\n    \u003cp align=\"center\"\u003e\n        \u003cimg width=\"75%\" style=\"display: block;\" src='https://github.com/unifyai/unifyai.github.io/blob/main/img/externally_linked/ivy_robot/demo_b.gif?raw=true'\u003e\n    \u003c/p\u003e\n\nGet Involved\n------------\n\nWe hope the functions in this library are useful to a wide range of machine learning developers.\nHowever, there are many more areas of gradient-based motion planning and broader robotics\nwhich could be covered by this library.\n\nIf there are any particular robotics functions you feel are missing,\nand your needs are not met by the functions currently on offer,\nthen we are very happy to accept pull requests!\n\nWe look forward to working with the community on expanding and improving the Ivy robot library.\n\nCitation\n--------\n\n::\n\n    @article{lenton2021ivy,\n      title={Ivy: Templated deep learning for inter-framework portability},\n      author={Lenton, Daniel and Pardo, Fabio and Falck, Fabian and James, Stephen and Clark, Ronald},\n      journal={arXiv preprint arXiv:2102.02886},\n      year={2021}\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivy-llc%2Frobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivy-llc%2Frobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivy-llc%2Frobot/lists"}