summaryrefslogtreecommitdiff
path: root/digital/ai/tools
diff options
context:
space:
mode:
authorNicolas Schodet2011-05-14 16:49:48 +0200
committerNicolas Schodet2011-05-14 16:49:48 +0200
commit5ba03e9744a8916730d9b8462cbfa6512d380ac6 (patch)
tree2bf4abd82f0881f7de77c250421f583e508ecbcc /digital/ai/tools
parent3d91eb26478dd0801294ce0ead01605687687d5e (diff)
digital/io-hub: add drop
Diffstat (limited to 'digital/ai/tools')
-rw-r--r--digital/ai/tools/test_simu_control_robospierre.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/digital/ai/tools/test_simu_control_robospierre.py b/digital/ai/tools/test_simu_control_robospierre.py
index 88fbc5f3..acd3ca7c 100644
--- a/digital/ai/tools/test_simu_control_robospierre.py
+++ b/digital/ai/tools/test_simu_control_robospierre.py
@@ -82,12 +82,21 @@ class TestSimuControl (TestSimu):
text = 'Move element', padx = 0, pady = 0,
command = self.clamp_move_element_command)
self.clamp_element_move_button.pack ()
+ self.drop_var = IntVar ()
+ self.drop_button = Checkbutton (self.control_frame, text = 'Drop',
+ indicatoron = False,
+ variable = self.drop_var, command = self.drop_command)
+ self.drop_button.pack ()
+ self.backward_var = IntVar ()
+ self.backward_button = Checkbutton (self.control_frame,
+ text = 'Backward', variable = self.backward_var)
+ self.backward_button.pack ()
self.table_view.bind ('<1>', self.move)
self.table_view.bind ('<3>', self.orient)
def move (self, ev):
pos = self.table_view.screen_coord ((ev.x, ev.y))
- self.asserv.goto (pos[0], pos[1])
+ self.asserv.goto (pos[0], pos[1], self.backward_var.get ())
def orient (self, ev):
x, y = self.table_view.screen_coord ((ev.x, ev.y))
@@ -129,6 +138,16 @@ class TestSimuControl (TestSimu):
for i in (0, 1, 3, 4):
self.io.pwm_set_timed (i, pwm, 255, 0)
+ def drop_command (self):
+ if self.drop_var.get ():
+ if self.backward_var.get ():
+ order = 'drop_backward'
+ else:
+ order = 'drop_forward'
+ else:
+ order = 'drop_clear'
+ self.io.drop (order)
+
def change_color (self, *dummy):
pass