ikpy icon indicating copy to clipboard operation
ikpy copied to clipboard

How to create chain of links from DH table, I got an error while trying to do that.

Open Abhi001vj opened this issue 7 years ago • 5 comments

l0 = ikpy.link.OriginLink() l1 = ikpy.link.DHLink('l1', d=3, a=0, bounds=None, use_symbolic_matrix=True) l2 = ikpy.link.DHLink('l2', d=0, a=5.75, bounds=None, use_symbolic_matrix=True) l3 = ikpy.link.DHLink('l3', d=0, a=7.375, bounds=None, use_symbolic_matrix=True) l4 = ikpy.link.DHLink('l4', d=0, a=0, bounds=None, use_symbolic_matrix=True) l5 = ikpy.link.DHLink('l5', d=4.125, a=0, bounds=None, use_symbolic_matrix=True) my_chain = ikpy.chain.Chain([l0,l1,l2,l3,l4,l5]) I got this error `--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () ----> 1 my_chain = ikpy.chain.Chain([l0,l1,l2,l3,l4,l5])

~/.local/lib/python3.5/site-packages/ikpy/chain.py in init(self, links, active_links_mask, name, profile, **kwargs) 21 self.name = name 22 self.links = links ---> 23 self._length = sum([link._length for link in links]) 24 # Avoid length of zero in a link 25 for (index, link) in enumerate(self.links):

~/.local/lib/python3.5/site-packages/ikpy/chain.py in (.0) 21 self.name = name 22 self.links = links ---> 23 self._length = sum([link._length for link in links]) 24 # Avoid length of zero in a link 25 for (index, link) in enumerate(self.links):

AttributeError: 'DHLink' object has no attribute '_length'`

Also I got this error when trying to import from ikpy import plot_utils

from ikpy import plot_utils

error

`--------------------------------------------------------------------------- ImportError Traceback (most recent call last) in () 1 import ikpy 2 import numpy as np ----> 3 from ikpy import plot_utils

~/.local/lib/python3.5/site-packages/ikpy/plot_utils.py in () 4 from . import geometry_utils 5 import matplotlib.animation ----> 6 from mpl_toolkits.mplot3d import Axes3D 7 8

/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/init.py in () 2 unicode_literals) 3 ----> 4 from matplotlib.externals import six 5 6 from .axes3d import Axes3D

ImportError: No module named 'matplotlib.externals'`

Thank you.

Abhi001vj avatar Aug 11 '17 12:08 Abhi001vj

Hello, may I know have you solved the problem?

ChunJyeBehBeh avatar Sep 14 '19 15:09 ChunJyeBehBeh

Hey,

This seems to be a bug in the DH links.

Actually the DH implementation is preliminary and lacks uses-cases: is the code you presented coming from a real robot? In this case, could you provide the complete set of DH parameters and the robot metadata so I can use it as a base for the test cases to develop further the DH parameters?

Phylliade avatar Oct 11 '19 10:10 Phylliade

Additionally, the second issue you got (with matplotlib) is an ubuntu issue.

Take a look at this, this may help you: https://stackoverflow.com/questions/45103248/importerror-no-module-named-matplotlib-externals

Phylliade avatar Oct 11 '19 10:10 Phylliade

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 03 '20 04:05 stale[bot]

I've written some code to resolve the problem of creating a chain link from DH parameters table, see https://github.com/Phylliade/ikpy/pull/143

Tanneguydv avatar Jul 04 '23 12:07 Tanneguydv