当前位置: 首页>>代码示例>>Python>>正文


Python Quaternion.from_roll_pitch_yaw方法代码示例

本文整理汇总了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))
开发者ID:bittnt,项目名称:fovis,代码行数:5,代码来源:rigid_transform.py

示例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() ]
开发者ID:bittnt,项目名称:fovis,代码行数:33,代码来源:rigid_transform.py


注:本文中的quaternion.Quaternion.from_roll_pitch_yaw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。