Is it possible to use the API to convert between Quaternions and Euler angles in batches?

It seems like if I have a tensor of shape [n_envs, 4], representing the orientation of each actor’s base link in quaternions, I would have to create “n_envs” number of gymapi.Quat objects and then run quat.to_euler_zyx() on each one in a loop. Is there a better way to do this using the API? I ended up just writing my own function.

Have a look at the python/isaacgym/ script. It has different functions such as get_euler_xyz(q) which you can use to convert a tensor (matrix) of quaternions to Euler angles. There are also other interesting functions that you might find useful!

And I would also refer to the pytorch3d library which has documentation for similar functions. From this library, I have used the 6D representation to achieve better results than when I used quaternions based on this paper.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.