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

wrong visualization #23

Open
calx-git opened this issue Jul 26, 2022 · 2 comments
Open

wrong visualization #23

calx-git opened this issue Jul 26, 2022 · 2 comments

Comments

@calx-git
Copy link

calx-git commented Jul 26, 2022

Thanks for this great tool.

However, when I try to visualize my chain, it does not work well. Would you please help me find the reason? My code is shown below:

import tinyik
import numpy as np

left_arm_idx = [15, 16, 17]
left_arm_bone1 = source_joints[ left_arm_idx[1],: ] - source_joints[ left_arm_idx[0],: ]
left_arm_bone2 = source_joints[ left_arm_idx[2],: ] - source_joints[ left_arm_idx[1],: ]

leftarm = tinyik.Actuator(['x','y','z', left_arm_bone1, 'x','y','z', left_arm_bone2])
tinyik.visualize(leftarm)

The values of the two bones are:

left_arm_bone1 = [-0.77607921, 2.00528251, -3.82166443]
left_arm_bone2 = [-4.19961586, -0.31558648, 0.79598167]

The visualization is not as expected. The direction of the bone is wrong.

Visualization of two bones

@lanius
Copy link
Owner

lanius commented Jul 26, 2022

Thank you very much for trying it.

I was able to reproduce the problem you pointed out in my environment. Perhaps there is a bug in the visualization algorithm imported in PR #19. I tried it with version 2.2.0 and it rendered correctly.

pip install tinyik==2.2.0
import tinyik
import numpy as np

left_arm_bone1 = [-0.77607921, 2.00528251, -3.82166443]
left_arm_bone2 = [-4.19961586, -0.31558648, 0.79598167]

leftarm = tinyik.Actuator(['x','y','z', left_arm_bone1, 'x','y','z', left_arm_bone2])
tinyik.visualize(leftarm)

image

I will now try to figure out how to fix it. If you need it right away, try using the previous version.

@calx-git
Copy link
Author

calx-git commented Jul 27, 2022

Thanks for the quick reply. I have tried the previous version, and it works. Thanks!

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

No branches or pull requests

2 participants