tf_ext.py
Go to the documentation of this file.
1 # tf_ext.py
2 # several extention function for tf
3 import tf
4 from tf.transformations import *
5 
6 def transformToMatrix(transform):
7  # transform = (pos, quaternion)
8  mat = quaternion_matrix(transform[1])
9  mat[:3, 3] = transform[0]
10  return mat
11 
12 def xyzxyzwToMatrix(xyzxyzw):
13  # convert [x, y, z, xx, yy, zz, ww] to matrix
14  # where xx, yy, zz and ww mean orientation parameter.
15  return transformToMatrix((xyzxyzw[:3], xyzxyzw[3:]))
16 
17 def decomposeMatrix(mat):
18  # convert matrix into (pos, quaternion) tuple
19  pos = mat[:3, 3]
20  q = quaternion_from_matrix(mat)
21  return (pos, q)
def decomposeMatrix(mat)
Definition: tf_ext.py:17
def xyzxyzwToMatrix(xyzxyzw)
Definition: tf_ext.py:12
def transformToMatrix(transform)
Definition: tf_ext.py:6


jsk_teleop_joy
Author(s): Ryohei Ueda
autogenerated on Fri May 14 2021 02:52:11