Skip to content

Commit

Permalink
Add Python2 compatibility (moveit#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixvd authored and Abishalini committed Apr 29, 2021
1 parent 875c93e commit 3b33832
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
from math import pi, dist, fabs, cos
try:
from math import tau
from math import pi, tau, dist, fabs, cos
except: # For Python 2 compatibility
from math import pi
from math import pi, fabs, cos, sqrt
tau = 2.0*pi
def dist(p, q):
return sqrt(sum((p_i - q_i)**2.0 for p_i, q_i in zip(p,q)))
from std_msgs.msg import String
from moveit_commander.conversions import pose_to_list
## END_SUB_TUTORIAL
Expand Down

0 comments on commit 3b33832

Please sign in to comment.