Skip to main content

modified dh

Project description

Modified Denavit–Hartenberg (mdh)

Actions Status GitHub PyPI - Python Version PyPI

Modified Denavit-Hartenberg parameters

Work in progress, use one the other libraries below (Inspiration)

Build kinematic chains using the modified Denavit-Hartenberg paramters

  • d: offset along previous z to the common normal
  • theta: angle about previous z, from old x to new x
  • a: length of the common normal, assuming a revolute joint, this is the radius about previous z.
  • alpha: angle about common normal, from old z axis to new z axis

Inspiration

You should probably use one of these, they inspired me to write a simpler module for my needs:

  • pybotics
  • pytransform3d, some matplotlib 3d examples
  • robopy, has some good matplotlib 3d examples, but seems rather brittle and difficult to work with
  • tinyik, uses open3d to visualize the mechanism

Example

import numpy as np
from mdh.kinematic_chain import KinematicChain
from mdh import UnReachable # exception

# make it print better
np.set_printoptions(suppress=True)

# modified DH parameters: alpha a theta d
# types: revolute=1, prismatic=2 (not implemented yet)
dh = [
    {'alpha': 0,  'a': 0, 'theta': 0, 'd': 0, 'type': 1},
    {'alpha': pi/2, 'a': 52, 'theta': 0, 'd': 0, 'type': 1},
    {'alpha': 0, 'a': 89, 'theta': 0, 'd': 0, 'type': 1},
    {'alpha': 0, 'a': 90, 'theta': 0, 'd': 0, 'type': 1},
    {'alpha': 0, 'a': 95, 'theta': 0, 'd': 0, 'type': 1}
]

kc = KinematicChain.from_parameters(dh)

# forward kinematics
angles = np.deg2rad([-45.00, 77.41, -98.15, -69.27, 0])
t = kc.forward(angles)
print(f">> {t}")

# inverse kinematics
pt = [110,0,-70]
deg = kc.inverse(pt)
rad = np.rad2deg(deg)
print(f">> {rad}")

MIT License

Copyright (c) 2019 Kevin J. Walchko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

mdh-0.1.3.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

mdh-0.1.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file mdh-0.1.3.tar.gz.

File metadata

  • Download URL: mdh-0.1.3.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.2 CPython/3.8.2 Linux/5.4.0-47-generic

File hashes

Hashes for mdh-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6836e54ac36f7a675e308c04db53035a6bd4c6afd3c16c6c56880cfa16c76d0f
MD5 f5f71e08531908d1ebbb2918b549729b
BLAKE2b-256 66b33d0395e2658529a6f1cbd6c653b455cde03006cec962f4a95cfd33a0eb51

See more details on using hashes here.

File details

Details for the file mdh-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: mdh-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.2 CPython/3.8.2 Linux/5.4.0-47-generic

File hashes

Hashes for mdh-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c8262d86245d1ca36fb645efb5532acfd33b124bf687d6fc50eb9ba41c773362
MD5 43364092c2285eecb00ac23b685affc7
BLAKE2b-256 bf2b799ae080d5147a0fdcdda9fa76599992ddd2b28ce2010b1235e47613bd1c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page