From dbb94e5c0018371838914f62bfa14a62a1ad922a Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Tue, 19 May 2009 20:04:17 +0200 Subject: * digital/asserv, digital/io: - added backward movements. --- digital/asserv/tools/asserv/asserv.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'digital/asserv/tools/asserv/asserv.py') 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): -- cgit v1.2.3