62587f78baec2bf5d5e862909c845cfba75d2730,liegroups/se3.py,SE3,from_matrix,#,31

Before Change


    @classmethod
    def from_matrix(cls, mat):
        Create a SE3 object from a 4x4 transformation matrix.
        if not SE3.is_valid_matrix(mat):
            raise ValueError("Invalid transformation matrix")

        return cls(SO3(mat[0:3, 0:3]), mat[0:3, 3])

    @classmethod
    def is_valid_matrix(cls, mat):

After Change


    @classmethod
    def from_matrix(cls, mat, normalize=False):
        Create a SE3 object from a 4x4 transformation matrix.
        mat_is_valid = cls.is_valid_matrix(mat)
        if mat_is_valid:
            result = cls(SO3(mat[0:3, 0:3]), mat[0:3, 3])
        elif not mat_is_valid and normalize:
            result = cls(SO3(mat[0:3, 0:3]), mat[0:3, 3])
            result.normalize()
        else:
            raise ValueError(
                "Invalid transformation matrix. Use normalize=True to handle rounding errors.")

        return result

    @classmethod
    def is_valid_matrix(cls, mat):
        Check if a matrix is a valid transformation matrix.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 16

Instances


Project Name: utiasSTARS/liegroups
Commit Name: 62587f78baec2bf5d5e862909c845cfba75d2730
Time: 2017-08-28
Author: clement.leopold@gmail.com
File Name: liegroups/se3.py
Class Name: SE3
Method Name: from_matrix


Project Name: utiasSTARS/liegroups
Commit Name: 62587f78baec2bf5d5e862909c845cfba75d2730
Time: 2017-08-28
Author: clement.leopold@gmail.com
File Name: liegroups/so3.py
Class Name: SO3
Method Name: from_matrix


Project Name: utiasSTARS/liegroups
Commit Name: 62587f78baec2bf5d5e862909c845cfba75d2730
Time: 2017-08-28
Author: clement.leopold@gmail.com
File Name: liegroups/so2.py
Class Name: SO2
Method Name: from_matrix


Project Name: utiasSTARS/liegroups
Commit Name: 62587f78baec2bf5d5e862909c845cfba75d2730
Time: 2017-08-28
Author: clement.leopold@gmail.com
File Name: liegroups/se2.py
Class Name: SE2
Method Name: from_matrix