From 75cc934b072310f22c5fe349168e5e4cdc231c4c Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 28 Mar 2013 23:28:13 +0100 Subject: host/simu/robots/apbirthday: add cake arm simulation Still need color sensors simulation. --- digital/ai/tools/test_simu_control_apbirthday.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'digital/ai/tools') diff --git a/digital/ai/tools/test_simu_control_apbirthday.py b/digital/ai/tools/test_simu_control_apbirthday.py index e60951ef..d88d5f7b 100644 --- a/digital/ai/tools/test_simu_control_apbirthday.py +++ b/digital/ai/tools/test_simu_control_apbirthday.py @@ -25,6 +25,8 @@ from test_simu import TestSimu, run from Tkinter import * import math +import io_hub.apbirthday + class TestSimuControl (TestSimu): """Interface with extra control.""" @@ -34,6 +36,9 @@ class TestSimuControl (TestSimu): self.io = self.robots[0].io self.asserv = self.robots[0].asserv self.robot_model = self.robots[0].model + self.io.output (io_hub.apbirthday.output_mask ( + 'cake_arm_in', 'cake_push_far_in', 'cake_push_near_in'), + 'toggle') def create_widgets (self): TestSimu.create_widgets (self) @@ -44,6 +49,16 @@ class TestSimuControl (TestSimu): command = self.fsm_debug).pack () Button (self.control_frame, text = 'Asserv block', padx = 0, pady = 0, command = self.asserv_block).pack () + def out_button (name, *toggle): + def command (): + self.io.output (io_hub.apbirthday.output_mask (*toggle), + 'toggle') + button = Button (self.control_frame, text = name, + padx = 0, pady = 0, command = command) + button.pack () + out_button ('Arm in/out', 'cake_arm_in', 'cake_arm_out') + out_button ('Push far in/out', 'cake_push_far_in', 'cake_push_far_out') + out_button ('Push near in/out', 'cake_push_near_in', 'cake_push_near_out') self.backward_var = IntVar () self.backward_button = Checkbutton (self.control_frame, text = 'Backward', variable = self.backward_var) -- cgit v1.2.3