Radians vs degrees in quaternion logic
- Dominant language
- Jupyter Notebook
- Stars
- 3.2k
- Forks
- 349
- PR merge metrics
- No merged PRs in 30d
Description
Hi Brax,
When converting between quaternions and Euler angles, the function [euler_to_quat](https://github.com/google/brax/blob/673a41f780fe0f137507d1c35286577c48bde4d1/brax/math.py#L69) takes the Euler angles in degrees, but the inverse function, [quat_to_euler](https://github.com/google/brax/blob/673a41f780fe0f137507d1c35286577c48bde4d1/brax/math.py#L81), returns the Euler angles in radians.
It is documented, and it is a relatively small fix to make in your own code to wrap one of these functions to work either exclusively in degrees or radians; but the code is not really self-consistent (and cost me a day's head-scratching, although I suppose I should have read the docstring...!).
Changing this interface would be a _wildly_ breaking change, so I don't know if there is a quick-fix -- maybe explicitly adding wrapped pairs functions that work in exclusively radians _or_ degrees? Maybe this is something for a later release?
Thanks,
Andy
Contributor guide
Assessment
This issue has not been assessed yet.