thomas-haslwanter / scikit-kinematics

Python functions for working with 3D kinematics.
Other
126 stars 45 forks source link

Denavit-Hartenberg convention added #19

Closed tommy3001 closed 6 years ago

tommy3001 commented 6 years ago

Here is a concept of the Denavit-Hartenberg convention for chains. wikipedia

tommy3001 commented 6 years ago

Some documentation changes

thomas-haslwanter commented 6 years ago

Hi Tommy, Thanks for the contribution! Since I don't come from robotics, could you please send me a link about the Denavit-Hartenberg convention, so I can read up on it? Also, it would be brilliant, if you could also add a test, to make sure the file does what you want it to do. (Just add a test-function to test_rotmat.py

Thanks!

tommy3001 commented 6 years ago

Ok. I will add tests and some further examples / documentation

thomas-haslwanter commented 6 years ago

Tommy, I had a quick look at the code: if the DH-rotation matrix would be implemented like

R_dh = np.diag([0,0,0,1.])
R_dh[:-1,:-1] = skin.rotmat.R(axis,angle)

we could have the x- and the z-axis implemented with one function, and equivalently for the translation. What do you think? This would also be significantly clearer.

thomas-haslwanter commented 6 years ago

Or even better: A "spatial transformation matrix" could be implemented as

def stm(axis, angle, translation):
    """Spatial Transformation Matrix"""
    stm = np.diag([0,0,0,0.1])
    stm[:-1,:-1] = R(axis, angle)
    stm[:-1,:3] = translation

and the DH-rotation and translation matrices would only be special cases!