We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58d4aba commit b77ae58Copy full SHA for b77ae58
graspnetAPI/utils/rotation.py
@@ -55,7 +55,7 @@ def matrix_to_dexnet_params(matrix):
55
R = np.c_[axis_x, np.c_[axis_y, axis_z]]
56
approach = R.T.dot(approach)
57
cos_t, sin_t = approach[0], -approach[2]
58
- angle = np.arccos(cos_t)
+ angle = np.arccos(max(min(cos_t,1),-1))
59
if sin_t < 0:
60
angle = pi * 2 - angle
61
return binormal, angle
@@ -139,4 +139,4 @@ def dexnet_params_to_matrix(binormal, angle):
139
[-np.sin(angle), 0, np.cos(angle)]])
140
R2 = np.c_[axis_x, np.c_[axis_y, axis_z]]
141
matrix = R2.dot(R1)
142
- return matrix
+ return matrix
0 commit comments