From b0e46d53dacdcc37dd4379c32fe886e5776f76c7 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Wed, 23 Apr 2008 21:02:33 +0200 Subject: * digital/asserv/src/asserv: - added backward goto commands. --- digital/asserv/tools/asserv.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'digital/asserv/tools') 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) -- cgit v1.2.3