skrobot.coordinates.math.rpy_matrix

skrobot.coordinates.math.rpy_matrix(az, ay, ax)[source]

Return rotation matrix from yaw-pitch-roll

This function creates a new rotation matrix which has been rotated ax radian around x-axis in WORLD, ay radian around y-axis in WORLD, and az radian around z axis in WORLD, in this order. These angles can be extracted by the rpy function.

Parameters:
  • az (float) – rotated around z-axis(yaw) in radian.

  • ay (float) – rotated around y-axis(pitch) in radian.

  • ax (float) – rotated around x-axis(roll) in radian.

Returns:

r – rotation matrix

Return type:

numpy.ndarray

Examples

>>> import numpy as np
>>> from skrobot.coordinates.math import rpy_matrix
>>> yaw = np.pi / 2.0
>>> pitch = np.pi / 3.0
>>> roll = np.pi / 6.0
>>> rpy_matrix(yaw, pitch, roll)
array([[ 1.11022302e-16, -8.66025404e-01,  5.00000000e-01],
       [ 5.00000000e-01,  4.33012702e-01,  7.50000000e-01],
       [-8.66025404e-01,  2.50000000e-01,  4.33012702e-01]])