Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue to reach position AND orientation (3axes) target #138

Open
Benjamin797 opened this issue Apr 10, 2023 · 2 comments
Open

Issue to reach position AND orientation (3axes) target #138

Benjamin797 opened this issue Apr 10, 2023 · 2 comments

Comments

@Benjamin797
Copy link

Benjamin797 commented Apr 10, 2023

Hello,

I have been exploring your algorithm for more than a month and my goal is to solve the inverse kinematic for articulated arms that I create directly in python with your functions. My project requires me to solve the problem in position AND orientation on the 3 axes (orientation_mode = 'all'). However, despite several attempts, the optimization gives me results where the position is reached but not the orientation. Does IkPy work well for an orientation_mode = 'all' resolution? If yes, can you help me to solve this problem? I really need it.
Here is my piece of code allowing the resolution of the ik. It is done in two steps (as indicated in your example) but it does not manage to reach the position + orientation (3 axes) even though I know that it is possible to reach it (which I managed to prove previously in my project).

Thanks in advance.

`
res = chain.inverse_kinematics(target.coordToList())
res = chain.inverse_kinematics(target_position=target.coordToList(), target_orientation=targ_ori,
orientation_mode= 'all', initial_position = res)

position = chain.forward_kinematics(res)[:3, 3]
orientation = chain.forward_kinematics(res)[:3, :3]

np.testing.assert_almost_equal(orientation, targ_ori, decimal=5)
np.testing.assert_almost_equal(position, target.coordToList(), decimal=3)
`

@Benjamin797 Benjamin797 changed the title Problème pour atteintre la position ET l'orientation 3 axes souhaitée May 3, 2023
@Benjamin797
Copy link
Author

One solution I found is the randomly change the inital position for each joint and iterate the resolution until the position and orientation is reached (with a cost fonction that compare the real position/orientation computed with the exepected one). Althought this method takes a really long time (1 minute sometimes) to reach the target wanted. Normally, if Ikpy workd for orientation_mode = all, i shoudln't iterate like that, one execution of the inverse_kinematic function should be enough. Is this orientation_mode really works?
Thank you

@niklasconbotics
Copy link

Hi Benjamin,
I have the same problem! can you provide the code? Or did you found a more convinced solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants