add first sample file

This commit is contained in:
Olivier R-D 2013-06-14 09:35:05 +02:00
parent c2112810eb
commit b600adb0fa
2 changed files with 25 additions and 2 deletions

23
examples/test_movep.py Normal file
View File

@ -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()

View File

@ -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")