thomas-haslwanter / scikit-kinematics

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

Don't repeat youself review for DH convention #21

Closed tommy3001 closed 6 years ago

tommy3001 commented 6 years ago

Ok. Please check the way how I implemented it for now....

After that I have to add the test routines to this commit.

The change

if type(angle) == type('alpha'):
    alpha = sympy.Symbol(angle)
else:
    alpha = angle

In R_s() is necessary to use this function for the DH symbols and to be able to preset values to the DH chain.

thomas-haslwanter commented 6 years ago

I have updated skinematics, and in my opinion most of your functions are now included. For example, for a 4D-rotation matrix for z-rotations you can use R_z = rotmat.stm(axis=2, alpha=30) and for a 4D-translation matrix for translation along y T_y = rotmat.stm(translation=[0, 10, 0])

And it also works for symbolic matrices

 Rz_s = STM_s(axis=2, angle='theta', transl='0,0,0')
Tz_s = STM_s(axis=0, angle='0', transl='0,0,z')

In my opinion, all that is still required are the combined files (your "T_DH", which I have left in). I think your approach to introduce a special function for each rotation/translation direction messes the module up too much. What do you think?

tommy3001 commented 6 years ago

That is ok!