Hi team,
First of all, thank you for your awesome work on this project!
While reviewing the codebase, I noticed a potential inconsistency regarding quaternion ordering and rotation conventions between different modules.
-
Inconsistency in rotations.py:
In rotations.py, the euler_2_quat function uses a custom implementation that appears to return quaternions in WXYZ format. However, quat_2_euler uses R.from_euler("xyz", xyz).as_quat(), which typically follows the Scipy standard XYZW format. Furthermore, the axis convention in the custom method seems to differ from the standard "XYZ" Euler order.
-
Inconsistency in franka_env.py:
In franka_env.py, there are two different approaches used for pose commands:
-
self._send_pos_command uses Scipy’s R.from_euler("xyz", xyz).as_quat(), resulting in XYZW.
-
interpolate_move calls the custom euler_2_quat mentioned above, which results in WXYZ.
I initially suspected this might be due to the requirements of serl_franka_controllers, but a quick check suggests that the controller also expects XYZW ordering.
Given that many users have successfully reproduced this work, I assume there is a functional reason for this implementation. Could you help clarify why these different conventions are used?
Looking forward to your insights. Thanks a lot!
Update:
- I changed the custom
euler_2_quat with R.from_euler('xyz', xyz).as_quat() and then tested the code on franka, and everything works well -- while the original euler_2_quat turned to a wrong reset pose.
- So I think it may be a bug?
Hi team,
First of all, thank you for your awesome work on this project!
While reviewing the codebase, I noticed a potential inconsistency regarding quaternion ordering and rotation conventions between different modules.
Inconsistency in rotations.py:
In rotations.py, the
euler_2_quatfunction uses a custom implementation that appears to return quaternions in WXYZ format. However,quat_2_eulerusesR.from_euler("xyz", xyz).as_quat(), which typically follows the Scipy standard XYZW format. Furthermore, the axis convention in the custom method seems to differ from the standard "XYZ" Euler order.Inconsistency in franka_env.py:
In franka_env.py, there are two different approaches used for pose commands:
self._send_pos_commanduses Scipy’sR.from_euler("xyz", xyz).as_quat(), resulting in XYZW.interpolate_movecalls the customeuler_2_quatmentioned above, which results in WXYZ.I initially suspected this might be due to the requirements of serl_franka_controllers, but a quick check suggests that the controller also expects XYZW ordering.
Given that many users have successfully reproduced this work, I assume there is a functional reason for this implementation. Could you help clarify why these different conventions are used?
Looking forward to your insights. Thanks a lot!
Update:
euler_2_quatwithR.from_euler('xyz', xyz).as_quat()and then tested the code on franka, and everything works well -- while the originaleuler_2_quatturned to a wrong reset pose.