Closed hubernikus closed 1 year ago
You are correct that the impedance controller is using an 'orientation displacement' instead of the axis angle error. This has been described in several papers, for example here (equation 10) and it has proven to work quite well with the control libraries controllers in the past.
https://github.com/epfl-lasa/control-libraries/blob/main/source/controllers/src/impedance/Impedance.cpp
The CartesianState-Impedance controller method compute_command uses the method BaseQuaternon.vec() to calulcate the angular-error. However, this is just the vector part of the a quaternion Q but has does not represent a the rotation angle, see: https://eigen.tuxfamily.org/dox/classEigen_1_1QuaternionBase.html#a91f93bde88f52796cfcd92c3594f39e5
The actual rotation angle can be calculated as: rotvec = Q.vec() / sin(cos(Q.w)) (2 cos(Q.w))
Hence, it yields a different result as for example the scipy library, when using "Rotation.as_rotvec()" https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.transform.Rotation.html