From 7f80e689922a481fc7aba35b6ec5765c112eacb3 Mon Sep 17 00:00:00 2001
From: Jan Weber <jan.weber@hs-bochum.de>
Date: Mon, 1 Feb 2021 13:37:09 +0100
Subject: [PATCH] Compatibility with Python 2.7 provided

---
 README.md                                  | 4 ++++
 abb_egm_driver/scripts/driver_test_node.py | 7 ++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index e22e541..5d0e60c 100644
--- a/README.md
+++ b/README.md
@@ -71,6 +71,10 @@ Clone the EGM driver:
 
     git clone --recursive https://gitlab.cvh-server.de/jweber/abb_egm_driver.git
 
+ROS Melodic uses Python 2.7, so in the script **abb_egm_driver/scripts/driver_test_node.py** the first line has to be changed to
+
+    #!/usr/bin/env python
+
 Build the project:
 
     catkin build
diff --git a/abb_egm_driver/scripts/driver_test_node.py b/abb_egm_driver/scripts/driver_test_node.py
index 4f18dd7..9c8649d 100755
--- a/abb_egm_driver/scripts/driver_test_node.py
+++ b/abb_egm_driver/scripts/driver_test_node.py
@@ -146,10 +146,11 @@ def circle(move_group, robot):
     mx = current_pose.position.x - r # so that the start point of the circle is on the current robot position
     mz = current_pose.position.z
     steps = 40
-    t = 3
+    t = 3.0
     for a in range(steps):
-        dx = r * math.cos(a/steps*2.0*pi)
-        dz = r * math.sin(a/steps*2.0*pi)
+        phi = float(a)/steps*2.0*pi
+        dx = r * math.cos(phi)
+        dz = r * math.sin(phi)
         goal.pose.position.x = mx + dx
         goal.pose.position.z = mz + dz
         robot_state = inverseKinematics.getJointAngles(goal, current_robot_state)
-- 
GitLab