1 | initial version |

There is a Python version of the KDL library (PyKDL), which allows you to do all sorts of conversions between rotation representations. An example would look like this:

{{{ import PyKDL a = PyKDL.Rotation.Quaternion(x, y, z, w) b = PyKDL.Rotation.Quaternion(x, y, z, w)

c = a * b.Inverse() c.GetQuaternion() # get quaternion result c.GetRPY() # get roll pitch yaw result c.GetEulerZYX() # get euler angle result in zyx format }}}

There is a small tutorial here that will give you some more background.

2 | code block |

There is a Python version of the KDL library (PyKDL), which allows you to do all sorts of conversions between rotation representations. An example would look like this:

{{{

```
import PyKDL
a = PyKDL.Rotation.Quaternion(x, y, z, w)
b = PyKDL.Rotation.Quaternion(x, y, z,
```~~w)~~w)
~~ ~~c = a * b.Inverse()
c.GetQuaternion() # get quaternion result
c.GetRPY() # get roll pitch yaw result
c.GetEulerZYX() # get euler angle result in zyx format
~~}}}~~

There is a small tutorial here that will give you some more background.

ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.