{"id":18981946,"url":"https://github.com/multipedrobotics/dh","last_synced_at":"2025-04-19T20:03:23.983Z","repository":{"id":62577495,"uuid":"195100984","full_name":"MultipedRobotics/dh","owner":"MultipedRobotics","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-05T16:19:12.000Z","size":219,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-26T00:13:23.416Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MultipedRobotics.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-03T17:38:44.000Z","updated_at":"2024-04-23T12:49:47.000Z","dependencies_parsed_at":"2022-11-03T19:13:51.733Z","dependency_job_id":null,"html_url":"https://github.com/MultipedRobotics/dh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MultipedRobotics%2Fdh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MultipedRobotics%2Fdh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MultipedRobotics%2Fdh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MultipedRobotics%2Fdh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MultipedRobotics","download_url":"https://codeload.github.com/MultipedRobotics/dh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223713577,"owners_count":17190498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-08T16:11:52.796Z","updated_at":"2024-11-08T16:11:53.421Z","avatar_url":"https://github.com/MultipedRobotics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Modified Denavit–Hartenberg (mdh)\n\n[![Actions Status](https://github.com/MultipedRobotics/dh/workflows/CheckPackage/badge.svg)](https://github.com/MultipedRobotics/dh/actions)\n![GitHub](https://img.shields.io/github/license/multipedrobotics/dh)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mdh)\n![PyPI](https://img.shields.io/pypi/v/mdh)\n\n\n\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/d/d8/DHParameter.png\" width=\"600px\"\u003e\n\n[Modified Denavit-Hartenberg parameters](https://en.wikipedia.org/wiki/Denavit%E2%80%93Hartenberg_parameters#Modified_DH_parameters)\n\n**Work in progress, use one the other libraries below (Inspiration)**\n\nBuild kinematic chains using the modified Denavit-Hartenberg paramters\n\n- d: offset along previous z to the common normal\n- theta: angle about previous z, from old x to new x\n- a: length of the common normal, assuming a revolute joint, this is the radius about previous z.\n- alpha: angle about common normal, from old z axis to new z axis\n\n## Inspiration\n\nYou should probably use one of these, they inspired me to write a simpler\nmodule for my needs:\n\n- [pybotics](https://github.com/nnadeau/pybotics)\n- [pytransform3d](https://github.com/rock-learning/pytransform3d), some matplotlib 3d examples\n- [robopy](https://github.com/adityadua24/robopy), has some good matplotlib 3d examples, but seems rather brittle and difficult to work with\n- [tinyik](https://github.com/lanius/tinyik), uses `open3d` to visualize the mechanism\n\n## Example\n\n```python\nimport numpy as np\nfrom mdh.kinematic_chain import KinematicChain\nfrom mdh import UnReachable # exception\n\n# make it print better\nnp.set_printoptions(suppress=True)\n\n# modified DH parameters: alpha a theta d\n# types: revolute=1, prismatic=2 (not implemented yet)\ndh = [\n    {'alpha': 0,  'a': 0, 'theta': 0, 'd': 0, 'type': 1},\n    {'alpha': pi/2, 'a': 52, 'theta': 0, 'd': 0, 'type': 1},\n    {'alpha': 0, 'a': 89, 'theta': 0, 'd': 0, 'type': 1},\n    {'alpha': 0, 'a': 90, 'theta': 0, 'd': 0, 'type': 1},\n    {'alpha': 0, 'a': 95, 'theta': 0, 'd': 0, 'type': 1}\n]\n\nkc = KinematicChain.from_parameters(dh)\n\n# forward kinematics\nangles = np.deg2rad([-45.00, 77.41, -98.15, -69.27, 0])\nt = kc.forward(angles)\nprint(f\"\u003e\u003e {t}\")\n\n# inverse kinematics\npt = [110,0,-70]\ndeg = kc.inverse(pt)\nrad = np.rad2deg(deg)\nprint(f\"\u003e\u003e {rad}\")\n```\n\n# MIT License\n\n**Copyright (c) 2019 Kevin J. Walchko**\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultipedrobotics%2Fdh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultipedrobotics%2Fdh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultipedrobotics%2Fdh/lists"}