本文整理汇总了Python中quaternion.Quaternion.from_roll_pitch_yaw方法的典型用法代码示例。如果您正苦于以下问题:Python Quaternion.from_roll_pitch_yaw方法的具体用法?Python Quaternion.from_roll_pitch_yaw怎么用?Python Quaternion.from_roll_pitch_yaw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quaternion.Quaternion
的用法示例。
在下文中一共展示了Quaternion.from_roll_pitch_yaw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: from_roll_pitch_yaw_x_y_z
# 需要导入模块: from quaternion import Quaternion [as 别名]
# 或者: from quaternion.Quaternion import from_roll_pitch_yaw [as 别名]
def from_roll_pitch_yaw_x_y_z(r, p, yaw, x, y, z):
q = Quaternion.from_roll_pitch_yaw(r, p, yaw)
return RigidTransform(q, (x, y, z))
示例2: translation
# 需要导入模块: from quaternion import Quaternion [as 别名]
# 或者: from quaternion.Quaternion import from_roll_pitch_yaw [as 别名]
def translation(self):
return self.tvec
@staticmethod
def identity():
return RigidTransform((1, 0, 0, 0), (0, 0, 0))
if __name__ == "__main__":
import random
q = Quaternion([1, 0, 0, 0])
t = [ 1, 2, 3 ]
m = RigidTransform(q, t)
print "m"
print m.to_homogeneous_matrix()
q2 = Quaternion.from_roll_pitch_yaw(numpy.pi / 4, 0, 0)
t2 = [ 0, 0, 0 ]
m2 = RigidTransform(q2, t2)
print "m2"
print m2.to_homogeneous_matrix()
m3 = m * m2
print "m * m2"
print m3.to_homogeneous_matrix()
m4 = m2 * m
print "m * m2"
print m4
def make_random_transform():
q_wxyz = [ random.random(), random.random(), random.random(), random.random() ]