summaryrefslogtreecommitdiffhomepage
path: root/digital/asserv/tools/asserv
diff options
context:
space:
mode:
authorNicolas Schodet2009-05-19 20:04:17 +0200
committerNicolas Schodet2009-05-19 20:04:17 +0200
commitdbb94e5c0018371838914f62bfa14a62a1ad922a (patch)
treebd7f0f1974d4aa9718590c167762b4c1c66f6ce8 /digital/asserv/tools/asserv
parent1e8fee2bf4e410a64401e30e6cbca526fba20209 (diff)
* digital/asserv, digital/io:
- added backward movements.
Diffstat (limited to 'digital/asserv/tools/asserv')
-rw-r--r--digital/asserv/tools/asserv/asserv.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/digital/asserv/tools/asserv/asserv.py b/digital/asserv/tools/asserv/asserv.py
index a8b5c753..8e1f9171 100644
--- a/digital/asserv/tools/asserv/asserv.py
+++ b/digital/asserv/tools/asserv/asserv.py
@@ -225,11 +225,16 @@ class Proto:
if a is not None:
self.proto.send ('p', 'cl', 'A', self._angle_f824 (a))
- def goto (self, x, y, backward_ok = False):
+ def goto (self, x, y, backward = False, revert_ok = False):
"""Go to position."""
self.mseq += 1
- self.proto.send (backward_ok and 'r' or 'x', 'llB',
- self._dist_f248 (x), self._dist_f248 (y), self.mseq)
+ b = 0
+ if backward:
+ b |= 1
+ if revert_ok:
+ b |= 2
+ self.proto.send ('x', 'llBB',
+ self._dist_f248 (x), self._dist_f248 (y), b, self.mseq)
self.wait (self.finished, auto = True)
def goto_angle (self, a):
@@ -238,12 +243,17 @@ class Proto:
self.proto.send ('x', 'HB', self._angle_f16 (a), self.mseq)
self.wait (self.finished, auto = True)
- def goto_xya (self, x, y, a, backward_ok = False):
+ def goto_xya (self, x, y, a, backward = False, revert_ok = False):
"""Go to position, then angle."""
self.mseq += 1
- self.proto.send (backward_ok and 'r' or 'x', 'llHB',
+ b = 0
+ if backward:
+ b |= 1
+ if revert_ok:
+ b |= 2
+ self.proto.send ('x', 'llHBB',
self._dist_f248 (x), self._dist_f248 (y),
- self._angle_f16 (a), self.mseq)
+ self._angle_f16 (a), b, self.mseq)
self.wait (self.finished, auto = True)
def ftw (self, backward = True):