summaryrefslogtreecommitdiff
path: root/digital/mimot/tools
diff options
context:
space:
mode:
authorNicolas Schodet2011-05-08 16:15:06 +0200
committerNicolas Schodet2011-05-08 16:15:06 +0200
commit0feb542a8cf7630a5d442387727414f5251aad83 (patch)
tree02092fbede27ef619ee63466f671513a889fb2ea /digital/mimot/tools
parent4cd9c4458eaa49c269171145f4bc2a184948eae1 (diff)
parentd385a9eacb2e8580239f101f96356f7ed216dd97 (diff)
Merge branch 'master' into efrei-robotique
Conflicts: digital/mimot/src/dirty/counter_ext.avr.c digital/mimot/tools/mimot/init.py
Diffstat (limited to 'digital/mimot/tools')
-rw-r--r--digital/mimot/tools/inter_mimot.py16
-rw-r--r--digital/mimot/tools/mimot/init.py14
-rw-r--r--digital/mimot/tools/write_eeprom.py17
3 files changed, 20 insertions, 27 deletions
diff --git a/digital/mimot/tools/inter_mimot.py b/digital/mimot/tools/inter_mimot.py
index 219c432b..414b61df 100644
--- a/digital/mimot/tools/inter_mimot.py
+++ b/digital/mimot/tools/inter_mimot.py
@@ -26,8 +26,7 @@ import math
import mimot
import mimot.init
-import proto.popen_io
-import serial
+from utils.init_proto import init_proto
from inter.inter import Inter
from Tkinter import *
@@ -35,15 +34,9 @@ from Tkinter import *
class InterMimot (Inter):
"""Inter, communicating with the mimot board."""
- def __init__ (self, argv):
+ def __init__ (self):
# Asserv.
- if argv[0] == '!':
- io = proto.popen_io.PopenIO (argv[1:])
- i = mimot.init.host
- else:
- io = serial.Serial (argv[0])
- i = mimot.init.target
- self.a = mimot.Proto (io, **i)
+ self.a = init_proto ('giboulee', mimot.Proto, mimot.init)
self.a.async = True
# Inter.
Inter.__init__ (self)
@@ -128,8 +121,7 @@ class InterMimot (Inter):
self.a.ftw (self.backwardVar.get ())
if __name__ == '__main__':
- import sys
- app = InterMimot (sys.argv[1:])
+ app = InterMimot ()
try:
app.mainloop ()
finally:
diff --git a/digital/mimot/tools/mimot/init.py b/digital/mimot/tools/mimot/init.py
index 471a27bb..1900de67 100644
--- a/digital/mimot/tools/mimot/init.py
+++ b/digital/mimot/tools/mimot/init.py
@@ -1,5 +1,5 @@
"""Default parameters for asserv."""
-host = dict (
+host_marcel = dict (
scale = 0.0395840674352314, f = 0xdd1,
tkp = 1, tkd = 16,
ta = 0.75, tsm = 0x20, tss = 0x10,
@@ -8,7 +8,12 @@ host = dict (
E = 0x3ff, D = 0x1ff,
l = 0x1000,
)
-target = dict (
+host = {
+ 'tazg': host_marcel,
+ 'giboulee': host_marcel,
+ 'marcel': host_marcel,
+ }
+target_marcel = dict (
scale = 0.0415178942124, f = 0xcef,
c = float (0x00ffbabf) / (1 << 24),
tkp = 1, tkd = 16,
@@ -19,3 +24,8 @@ target = dict (
l = 0x1000,
w = 0x00,
)
+target = {
+ 'tazg': target_marcel,
+ 'giboulee': target_marcel,
+ 'marcel': target_marcel,
+ }
diff --git a/digital/mimot/tools/write_eeprom.py b/digital/mimot/tools/write_eeprom.py
index ab2ae315..7fe54342 100644
--- a/digital/mimot/tools/write_eeprom.py
+++ b/digital/mimot/tools/write_eeprom.py
@@ -1,16 +1,7 @@
-import sys
-
import mimot
import mimot.init
-import proto.popen_io
-import serial
+from utils.init_proto import init_proto
-if sys.argv[1] == '!':
- io = proto.popen_io.PopenIO (sys.argv[2:])
- init = mimot.init.host
-else:
- io = serial.Serial (sys.argv[1])
- init = mimot.init.target
-a = mimot.Proto (io, **init)
-a.write_eeprom ()
-a.close ()
+m = init_proto (None, mimot.Proto, mimot.init)
+m.write_eeprom ()
+m.close ()