lanius / tinyik

A tiny inverse kinematics solver
MIT License
120 stars 21 forks source link

How to create a 3-DoF rotation joint? #22

Open Omri-CG opened 2 years ago

Omri-CG commented 2 years ago

Hi @lanius, thanks for this cool repo!

I would like to add a joint that can rotate about all axes (i.e., a 3-DoF joint). How can this be done?

Thanks!

lanius commented 2 years ago

Thank you!

I think you can create a joint with multiple DoF by specifying the rotation axes in succession (without any links in between). The joints look a little weird when visualized...

import tinyik
arm = tinyik.Actuator(['z', [1., 0., 0.], 'x', 'y', 'z', [1., 0., 0.]])
tinyik.visualize(arm, target=[1.2, 1.2, 0.5])

3DoFjoint

Please give it a try.