From b600adb0fa2528c60decc8aeae4f4de677437cfe Mon Sep 17 00:00:00 2001 From: Olivier R-D Date: Fri, 14 Jun 2013 09:35:05 +0200 Subject: [PATCH] add first sample file --- examples/test_movep.py | 23 +++++++++++++++++++++++ urx/urx.py | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 examples/test_movep.py diff --git a/examples/test_movep.py b/examples/test_movep.py new file mode 100644 index 0000000..bf3f15b --- /dev/null +++ b/examples/test_movep.py @@ -0,0 +1,23 @@ +import urx +import logging + +if __name__ == "__main__": + rob = urx.Robot("192.168.128.120", logLevel=logging.INFO) + try: + l = 0.05 + v = 0.05 + a = 0.3 + r = 0.005 + pose = rob.getl() + pose[2] += l + rob.movep(pose, acc=a, vel=v, radius=r, wait=False) + pose[1] += l + rob.movep(pose, acc=a, vel=v, radius=r, wait=False) + pose[2] -= l + rob.movep(pose, acc=a, vel=v, radius=r, wait=False) + pose[1] -= l + rob.movep(pose, acc=a, vel=v, radius=0, wait=False) + + finally: + rob.cleanup() + diff --git a/urx/urx.py b/urx/urx.py index b7281a9..86fa03f 100644 --- a/urx/urx.py +++ b/urx/urx.py @@ -6,7 +6,7 @@ http://support.universal-robots.com/URRobot/RemoteAccess from __future__ import absolute_import # necessary for import tricks to work with python2 __author__ = "Olivier Roulet-Dubonnet" -__copyright__ = "Copyright 2011-2012, Sintef Raufoss Manufacturing Roulet-Dubonnet" +__copyright__ = "Copyright 2011-2013, Sintef Raufoss Manufacturing Roulet-Dubonnet" __credits__ = ["Olivier Roulet-Dubonnet"] __license__ = "GPLv3" @@ -228,7 +228,7 @@ class URRobot(object): return self.getj() def wait_for_move(self): - time.sleep(0.2)# it is important to sleep since robot may takes a while to get into running state + time.sleep(0.5)# it is important to sleep since robot may takes a while to get into running state, for a physical move 0.5s is very low while True: if not self.is_running(): raise RobotException("Robot stopped")