summaryrefslogtreecommitdiff
path: root/digital
diff options
context:
space:
mode:
authorNicolas Schodet2008-06-09 23:10:13 +0200
committerNicolas Schodet2008-06-09 23:10:13 +0200
commitd981b201c53226c3c900dc486bf8d7360c93be26 (patch)
tree3b418e33f82956ab681f275b362139b21ad40e6f /digital
parente91ee6c02aae9329aa0c2d9264d864d59c4a8381 (diff)
* digital/asserv/tools:
- added simulated position set support.
Diffstat (limited to 'digital')
-rw-r--r--digital/asserv/tools/asserv/asserv.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/digital/asserv/tools/asserv/asserv.py b/digital/asserv/tools/asserv/asserv.py
index 31439d7b..05a07130 100644
--- a/digital/asserv/tools/asserv/asserv.py
+++ b/digital/asserv/tools/asserv/asserv.py
@@ -1,5 +1,6 @@
import proto, time
import numpy
+import math
class Asserv:
@@ -176,6 +177,11 @@ class Asserv:
a * (1 << 16) / 360, self.mseq)
self.wait (self.finished, auto = True)
+ def set_simu_pos (self, x, y, a):
+ """Set simulated position."""
+ self.proto.send ('h', 'BHHH', ord ('X'), x, y,
+ math.radians (a) * 1024)
+
def register_pos (self, func, interval = 225 / 4):
"""Will call func each time a position is received."""
self.pos_func = func