add first sample file
This commit is contained in:
parent
c2112810eb
commit
b600adb0fa
23
examples/test_movep.py
Normal file
23
examples/test_movep.py
Normal 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()
|
||||||
|
|
@ -6,7 +6,7 @@ http://support.universal-robots.com/URRobot/RemoteAccess
|
|||||||
from __future__ import absolute_import # necessary for import tricks to work with python2
|
from __future__ import absolute_import # necessary for import tricks to work with python2
|
||||||
|
|
||||||
__author__ = "Olivier Roulet-Dubonnet"
|
__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"]
|
__credits__ = ["Olivier Roulet-Dubonnet"]
|
||||||
__license__ = "GPLv3"
|
__license__ = "GPLv3"
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ class URRobot(object):
|
|||||||
return self.getj()
|
return self.getj()
|
||||||
|
|
||||||
def wait_for_move(self):
|
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:
|
while True:
|
||||||
if not self.is_running():
|
if not self.is_running():
|
||||||
raise RobotException("Robot stopped")
|
raise RobotException("Robot stopped")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user