62587f78baec2bf5d5e862909c845cfba75d2730,liegroups/so2.py,SO2,from_matrix,#,22
Before Change
if not SO2.is_valid_matrix(mat):
raise ValueError("Invalid rotation matrix")
return cls(mat)
@classmethod
def is_valid_matrix(cls, mat):
Check if a matrix is a valid rotation matrix.
After Change
@classmethod
def from_matrix(cls, mat, normalize=False):
Create a SO2 object from a 2x2 rotation matrix (safe, but slower).
mat_is_valid = cls.is_valid_matrix(mat)
if mat_is_valid:
result = cls(mat)
elif not mat_is_valid and normalize:
result = cls(mat)
result.normalize()
else:
raise ValueError(
"Invalid rotation matrix. Use normalize=True to handle rounding errors.")
return result
@classmethod
def is_valid_matrix(cls, mat):
Check if a matrix is a valid rotation matrix.
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 15
Instances 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/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/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/se2.py
Class Name: SE2
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