Would some body please elaborate on the formula that the following function is based on? are the outputs roll, pitch and yaw? is this formula (so the function as well) always valid?

```
def orientation_error(desired, current):
cc = quat_conjugate(current)
q_r = quat_mul(desired, cc)
return q_r[:, 0:3] * torch.sign(q_r[:, 3]).unsqueeze(-1)
```

Edit: thanks for replays, but none of them answers me. To be more specific, this function takes in two quaternions and outputs a vector that is not quaternion (cause just returns the first three elements [0:3] and is not [0:4]). We know that the error of two quaternions is a quaternion as well. so why do the results have 3 elements instead of 4? Does it assume the inputs are normalized (I,j,k,w=1) and so the results are normalized (di, dj , dk, w=1) so just drop the w=1".

is this formula valid for small errors (when desired and current are close together) or always is valid?