@@ -84,13 +84,13 @@ def rotate_around_joint_axis(self, angle_of_rotation, axis_of_rotation):
84
84
# Then add the rotation amount to the axis counter
85
85
if axis_of_rotation .equals (x_axis_vector ):
86
86
rotation_axis = self .__x_vector
87
- self .__x_rotation = wrap_to_pi (self .__x_rotation + angle_of_rotation )
87
+ self .__x_rotation = wrap_to_pi ("rad" , self .__x_rotation + angle_of_rotation )
88
88
elif axis_of_rotation .equals (y_axis_vector ):
89
89
rotation_axis = self .__y_vector
90
- self .__y_rotation = wrap_to_pi (self .__y_rotation + angle_of_rotation )
90
+ self .__y_rotation = wrap_to_pi ("rad" , self .__y_rotation + angle_of_rotation )
91
91
elif axis_of_rotation .equals (z_axis_vector ):
92
92
rotation_axis = self .__z_vector
93
- self .__z_rotation = wrap_to_pi (self .__z_rotation + angle_of_rotation )
93
+ self .__z_rotation = wrap_to_pi ("rad" , self .__z_rotation + angle_of_rotation )
94
94
else :
95
95
error_str = "Bad input vector given ({0}). Must be either x_axis_vector ({1}), y_axis_vector ({2})," \
96
96
"or z_axis_vector ({3}). Use rotate_around_vector for rotation about an arbitrary vector."
@@ -140,11 +140,11 @@ def rotate_around_vector(self, angle_of_rotation, axis_of_rotation):
140
140
# axis of rotation will have the smallest (it's less affected by the rotation)
141
141
min_angle_diff = min (angle_diff_x , angle_diff_y , angle_diff_z )
142
142
if min_angle_diff == angle_diff_x :
143
- self .__x_rotation = wrap_to_pi (self .__x_rotation + angle_of_rotation )
143
+ self .__x_rotation = wrap_to_pi ("rad" , self .__x_rotation + angle_of_rotation )
144
144
elif min_angle_diff == angle_diff_y :
145
- self .__y_rotation = wrap_to_pi (self .__y_rotation + angle_of_rotation )
145
+ self .__y_rotation = wrap_to_pi ("rad" , self .__y_rotation + angle_of_rotation )
146
146
else :
147
- self .__z_rotation = wrap_to_pi (self .__z_rotation + angle_of_rotation )
147
+ self .__z_rotation = wrap_to_pi ("rad" , self .__z_rotation + angle_of_rotation )
148
148
149
149
# Calculate the updated toolpoint location
150
150
self .__connect_dir .rotate (angle = angle_of_rotation , axis = axis_of_rotation )
@@ -353,10 +353,10 @@ def rotate_joint(self, new_angle):
353
353
:type new_angle: float (radians)
354
354
"""
355
355
# Wrap given angle to -pi to pi
356
- new_angle = wrap_to_pi (new_angle )
356
+ new_angle = wrap_to_pi ("rad" , new_angle )
357
357
current_angle = self .rotation_angle
358
358
# Calculate amount to rotate the link
359
- angle_diff = wrap_to_pi (new_angle - current_angle )
359
+ angle_diff = wrap_to_pi ("rad" , new_angle - current_angle )
360
360
# Update the link
361
361
self .rotate_around_joint_axis (angle_diff , self .rotation_axis )
362
362
self .rotation_angle = new_angle
0 commit comments