quadplotter.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:evolvingcopter 作者: antocuni 项目源码 文件源码
def update(self, quad):
        """
        Set the new position and rotation of the quadcopter: ``pos`` is a tuple
        (x, y, z), and rpy is a tuple (roll, pitch, yaw) expressed in
        *radians*
        """
        x, y, z = quad.position
        roll, pitch, yaw = np.rad2deg(quad.rpy)
        self.quadplot.resetTransform()
        self.quadplot.translate(x, y, z)
        self.quadplot.rotate(roll, 1, 0, 0, local=True)
        self.quadplot.rotate(pitch, 0, 1, 0, local=True)
        self.quadplot.rotate(yaw, 0, 0, 1, local=True)
        #
        self.label_t.setText('t = %5.2f' % quad.t)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号