summaryrefslogtreecommitdiff
path: root/digital/asserv/tools
diff options
context:
space:
mode:
authorNicolas Schodet2008-04-23 21:02:33 +0200
committerNicolas Schodet2008-04-23 21:02:33 +0200
commitb0e46d53dacdcc37dd4379c32fe886e5776f76c7 (patch)
treeb579095b3173c1fd925973f1335cacdb06a90dc0 /digital/asserv/tools
parentbe1feaa0f9d7049efbeceb970ad6d7cc39988a68 (diff)
* digital/asserv/src/asserv:
- added backward goto commands.
Diffstat (limited to 'digital/asserv/tools')
-rw-r--r--digital/asserv/tools/asserv.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/digital/asserv/tools/asserv.py b/digital/asserv/tools/asserv.py
index 6260f0ef..e1bfa5e9 100644
--- a/digital/asserv/tools/asserv.py
+++ b/digital/asserv/tools/asserv.py
@@ -135,10 +135,11 @@ class Asserv:
self.proto.send ('s', 'LB', offset, self.seq)
self.wait (self.finished)
- def goto (self, x, y):
+ def goto (self, x, y, backward_ok = False):
"""Go to position."""
self.seq += 1
- self.proto.send ('x', 'LLB', 256 * x / self.param['scale'],
+ self.proto.send (backward_ok and 'r' or 'x', 'LLB',
+ 256 * x / self.param['scale'],
256 * y / self.param['scale'], self.seq)
self.wait (self.finished)
@@ -148,10 +149,11 @@ class Asserv:
self.proto.send ('x', 'HB', a * (1 << 16) / 360, self.seq)
self.wait (self.finished)
- def goto_xya (self, x, y, a):
+ def goto_xya (self, x, y, a, backward_ok = False):
"""Go to position, then angle."""
self.seq += 1
- self.proto.send ('x', 'LLHB', 256 * x / self.param['scale'],
+ self.proto.send (backward_ok and 'r' or 'x', 'LLHB',
+ 256 * x / self.param['scale'],
256 * y / self.param['scale'],
a * (1 << 16) / 360, self.seq)
self.wait (self.finished)