[AUTONAVx][lec3]3D Geometry and Sensors

3D Geometry




Rotation matrices and quaternions can simply be concatenated by multiplication.

Euler angles use three variables to describe three degrees of freedom and thus are minimal.

Angle-Axis can be minimal if the rotation about the angle is encoded in the length of the axis vector.

Rotation matrices can simply be transposed to invert them.Angle Axis can be inverted by negating angle or axis.

Quaternions can be inverted by flipping the sign of v or w.

Only rotation matrices are unique. The other representations allow to express the same rotation in multiple ways.

implement the position inverse and multiply operations.

import numpy as np

class Pose3D:
    def __init__(self, rotation, translation):
        self.rotation = rotation
        self.translation = translation

    def inv(self):
        ''' Inversion of this Pose3D object :return inverse of self '''
        # TODO: implement inversion
        inv_rotation = self.rotation.T
        inv_translation = -np.dot(inv_rotation, self.translation)

        return Pose3D(inv_rotation, inv_translation)

    def __mul__(self, other):
        ''' Multiplication of two Pose3D objects, e.g.: a = Pose3D(...) # = self b = Pose3D(...) # = other c = a * b # = return value :param other: Pose3D right hand side :return product of self and other '''
        return Pose3D(np.dot(self.rotation, other.rotation), np.dot(self.rotation, other.translation) + self.translation)

    def __str__(self):
        return "rotation:\n" + str(self.rotation) + "\ntranslation:\n" + str(self.translation.transpose())

def compute_quadrotor_pose(global_marker_pose, observed_marker_pose):
    ''' :param global_marker_pose: Pose3D :param observed_marker_pose: Pose3D :return global quadrotor pose computed from global_marker_pose and observed_marker_pose '''
    # TODO: implement global quadrotor pose computation
    global_quadrotor_pose = global_marker_pose * observed_marker_pose.inv()

    return global_quadrotor_pose
全部评论

相关推荐

合适才能收到offe...:项目岗是什么岗?我看你有段好像跟策划运营相关,如果找运营的话第三段经历写详细点儿。 个人建议是把自我评价删了换成专业技能放在工作经验上或者下面。学生会那个也可以删,把第一个包装成店铺运营,写4-6给点。第三个也是写4-6个点。注意工作内容➕部分数据。 投递的时候BOS招呼用语改一下,换成我有xx工作经验,熟练掌握xx技能样式,也可以简历截图然后直接发送。
点赞 评论 收藏
分享
迷茫的大四🐶:28?别太离谱,研究生出来也得25至少了
牛客吐槽大会
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务