How can I convert a quaternion into Euler angles?

Not working:

```
using Rotations
q = Float32[0.51791805, 0.48140272, -0.4814214, -0.5179244]
RotXYZ(q)
```

This fails with a dimension mismatch error.

How can I convert a quaternion into Euler angles?

Not working:

```
using Rotations
q = Float32[0.51791805, 0.48140272, -0.4814214, -0.5179244]
RotXYZ(q)
```

This fails with a dimension mismatch error.

That’s probably because `RotXYZ`

expects a rotation? This works for me:

```
using Rotations
q = QuatRotation(0.51791805, 0.48140272, -0.4814214, -0.5179244)
RotXYZ(q)
```

1 Like

Nice, one step further. But I want to get three angles, roll, pitch and yaw? How can I calculate them?

`Rotations.params`

Thanks, this works:

```
julia> Rotations.params(RotXYZ(q))
3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3):
-0.18252027034759521
-1.5686432299864785
-1.754975438117981
```

Now I only need to check if this is really roll, pitch and yaw.