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

Bug in probably some gimbal lock prevention code #5

Open
ja99 opened this issue Jan 31, 2023 · 0 comments
Open

Bug in probably some gimbal lock prevention code #5

ja99 opened this issue Jan 31, 2023 · 0 comments

Comments

@ja99
Copy link

ja99 commented Jan 31, 2023

Hi everyone,

It seems like there is code for preventing gimbal lock, which interferes with valid Euler rotations as well.

Replication

Experiment was performed with Python 3.9 and
ivy-core=1.1.10=pypi_0
ivy-mech=1.1.9=pypi_0

image

For easier copy/paste, here the code itself:

import numpy as np
import ivy
import ivy_mech
import math
#%%
ivy.set_framework(ivy.numpy)
#%%
rot_order = "zyx"
#%%
in_degree_euler = ivy.array([0, 0, 90])
in_degree_euler
#%%
in_rad_euler = ivy.array([math.radians(x) for x in in_degree_euler])
in_rad_euler
#%%
rot_mat = ivy_mech.euler_to_rot_mat(in_rad_euler, convention=rot_order)
rot_mat
#%%
out_rad_euler = ivy_mech.rot_mat_to_euler(rot_mat, convention=rot_order)
out_rad_euler
#%%
out_degree_euler = ivy.array([math.degrees(x) for x in out_rad_euler])
out_degree_euler

Expected behavior

image

Thanks,
Janis

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

1 participant