From 0c3608848d40e19d421172e5efcc40b512b697d4 Mon Sep 17 00:00:00 2001 From: Olivier R-D Date: Sun, 24 May 2015 09:04:02 +0200 Subject: [PATCH] port more examples to api changes --- examples/matrices.py | 7 ++++--- examples/simple.py | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/matrices.py b/examples/matrices.py index 1a86809..691fdb6 100644 --- a/examples/matrices.py +++ b/examples/matrices.py @@ -4,7 +4,8 @@ import urx import logging if __name__ == "__main__": - rob = urx.Robot("192.168.1.6") + #rob = urx.Robot("192.168.1.6") + rob = urx.Robot("localhost") rob.set_tcp((0,0,0,0,0,0)) rob.set_payload(0.5, (0,0,0)) try: @@ -13,7 +14,7 @@ if __name__ == "__main__": a = 0.3 j = rob.getj() print("Initial joint configuration is ", j) - t = rob.get_transform() + t = rob.get_pose() print("Transformation from base to tcp is: ", t) print("Translating in x") rob.translate((l, 0, 0), acc=a, vel=v) @@ -27,7 +28,7 @@ if __name__ == "__main__": print("Translate in -x and rotate") t.orient.rotate_zb(pi/4) t.pos[0] -= l - rob.apply_transform(t, vel=v, acc=a) + rob.set_pose(t, vel=v, acc=a) print("Sending robot back to original position") rob.movej(j, acc=0.8, vel=0.2) diff --git a/examples/simple.py b/examples/simple.py index 1b57a68..c8a9759 100644 --- a/examples/simple.py +++ b/examples/simple.py @@ -5,7 +5,8 @@ import logging if __name__ == "__main__": logging.basicConfig(level=logging.WARN) - rob = urx.Robot("192.168.1.6") + #rob = urx.Robot("192.168.1.6") + rob = urx.Robot("localhost") rob.set_tcp((0,0,0,0,0,0)) rob.set_payload(0.5, (0,0,0)) try: