コード例 #1
0
ファイル: inter_asserv.py プロジェクト: TLoebner/apbteam
 def __init__ (self):
     # Asserv.
     self.a = init_proto ('giboulee', asserv.Proto, asserv.init)
     self.a.async = True
     # Inter.
     Inter.__init__ (self)
     self.tk.createfilehandler (self.a, READABLE, self.read)
     self.timeout ()
     # Query position.
     self.a.register_pos (interval = 225 / 20)
     self.a.position.register (self.pos)
コード例 #2
0
ファイル: step.py プロジェクト: TLoebner/apbteam
def step (name, offset, kp, ki, kd, plots, **param):
    p = { name + '_kp': kp, name + '_ki': ki, name + '_kd': kd}
    p.update (param)
    a = init_proto (None, asserv.Proto, init = p)
    a.stats (*plots)
    a.consign (name, offset)
    #a.speed (name, 16)
    array = a.get_stats (225)
    a.close ()

    g = Gnuplot.Gnuplot (persist = True)
    g ('set data style lines')
    g.plot (*[array[:, i] for i in xrange (len (plots))])
コード例 #3
0
ファイル: ui_apbirthday.py プロジェクト: oliv5/apbteam
 def __init__ (self, master = None):
     Frame.__init__ (self, master)
     self.pack (expand = True, fill = 'both')
     self.create_widgets ()
     self.update ()
     self.io = init_proto ('apbirthday', io_hub.Proto)
     self.io.async = True
     self.io.register_stats (self.handle_stats)
     def io_read (*args):
         self.io.proto.read ()
         self.io.proto.sync ()
     def io_timeout ():
         self.io.proto.sync ()
         self.after (100, io_timeout)
     self.tk.createfilehandler (self.io, READABLE, io_read)
     io_timeout ()
コード例 #4
0
ファイル: ui_guybrush.py プロジェクト: TLoebner/apbteam
 def __init__ (self, master = None):
     Frame.__init__ (self, master)
     self.pack (expand = True, fill = 'both')
     self.create_widgets ()
     self.current_value = 0
     self.update ()
     self.io = init_proto ('guybrush', io_hub.Proto)
     self.io.async = True
     def io_read (*args):
         self.io.proto.read ()
         self.io.proto.sync ()
     def io_timeout ():
         self.io.proto.sync ()
         self.after (100, io_timeout)
     self.tk.createfilehandler (self.io, READABLE, io_read)
     io_timeout ()
コード例 #5
0
ファイル: write_eeprom.py プロジェクト: TLoebner/apbteam
import mimot
import mimot.init
from utils.init_proto import init_proto

m = init_proto (None, mimot.Proto, mimot.init)
m.write_eeprom ()
m.close ()
コード例 #6
0
ファイル: dump_usdist.py プロジェクト: TLoebner/apbteam
import io
import io.init
from utils.init_proto import init_proto

p = init_proto ('marcel', io.Proto, io.init)
def cb (*val):
    l = [ ]
    for v in val:
        if v is None:
            l.append ('___')
        else:
            l.append (v)
    print l
try:
    p.stats_usdist (cb)
except KeyboardInterrupt:
    pass
p.close ()