From 41548bb00fb99c18bc86c6c264a691eb837f85a5 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 5 May 2013 16:17:22 +0200 Subject: digital/io-hub/src/apbirthday, eurobot/2013, host/simu/robots: update outputs --- digital/ai/tools/test_simu_control_apbirthday.py | 2 +- digital/io-hub/src/apbirthday/hardware.hh | 4 ++-- digital/io-hub/src/apbirthday/hardware.host.cc | 4 ++-- digital/io-hub/src/apbirthday/hardware.stm32.cc | 6 +++--- digital/io-hub/src/apbirthday/plate.cc | 17 ++++------------- digital/io-hub/src/apbirthday/robot.cc | 4 ++-- digital/io-hub/tools/io_hub/apbirthday.py | 4 ++-- eurobot/2013/io-hub-stm32-connectors.ods | Bin 22213 -> 22234 bytes host/simu/robots/apbirthday/model/bag.py | 5 +++-- 9 files changed, 19 insertions(+), 27 deletions(-) diff --git a/digital/ai/tools/test_simu_control_apbirthday.py b/digital/ai/tools/test_simu_control_apbirthday.py index 5ec67e0e..dfd49b76 100644 --- a/digital/ai/tools/test_simu_control_apbirthday.py +++ b/digital/ai/tools/test_simu_control_apbirthday.py @@ -60,7 +60,7 @@ class TestSimuControl (TestSimu): 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') out_button ('Plate arm up/down', 'cherry_plate_up', 'cherry_plate_down') - out_button ('Plate clamp', 'cherry_plate_clamp') + out_button ('Plate clamp', 'cherry_plate_clamp_close', 'cherry_plate_clamp_open') out_button ('Gift', 'gift_in', 'gift_out') cannon_var = IntVar () def cannon_cmd (): diff --git a/digital/io-hub/src/apbirthday/hardware.hh b/digital/io-hub/src/apbirthday/hardware.hh index 2d016587..33d10c0c 100644 --- a/digital/io-hub/src/apbirthday/hardware.hh +++ b/digital/io-hub/src/apbirthday/hardware.hh @@ -75,9 +75,9 @@ struct Hardware cherry_plate_left_contact, cherry_plate_right_contact, cake_arm_out_contact, cake_arm_in_contact; ucoo::Gpio - cherry_bad_out, cherry_bad_in, + cherry_bad_out, cherry_plate_up, cherry_plate_down, - cherry_plate_clamp, + cherry_plate_clamp_close, cherry_plate_clamp_open, cake_arm_out, cake_arm_in, cake_push_far_out, cake_push_far_in, cake_push_near_out, cake_push_near_in, diff --git a/digital/io-hub/src/apbirthday/hardware.host.cc b/digital/io-hub/src/apbirthday/hardware.host.cc index 80d55eae..bc9cff18 100644 --- a/digital/io-hub/src/apbirthday/hardware.host.cc +++ b/digital/io-hub/src/apbirthday/hardware.host.cc @@ -44,10 +44,10 @@ Hardware::Hardware () cake_arm_out_contact (host, "cake_arm_out_contact"), cake_arm_in_contact (host, "cake_arm_in_contact"), cherry_bad_out (host, "cherry_bad_out"), - cherry_bad_in (host, "cherry_bad_in"), cherry_plate_up (host, "cherry_plate_up"), cherry_plate_down (host, "cherry_plate_down"), - cherry_plate_clamp (host, "cherry_plate_clamp"), + cherry_plate_clamp_close (host, "cherry_plate_clamp_close"), + cherry_plate_clamp_open (host, "cherry_plate_clamp_open"), cake_arm_out (host, "cake_arm_out"), cake_arm_in (host, "cake_arm_in"), cake_push_far_out (host, "cake_push_far_out"), diff --git a/digital/io-hub/src/apbirthday/hardware.stm32.cc b/digital/io-hub/src/apbirthday/hardware.stm32.cc index 32ffcffd..b92940ed 100644 --- a/digital/io-hub/src/apbirthday/hardware.stm32.cc +++ b/digital/io-hub/src/apbirthday/hardware.stm32.cc @@ -46,13 +46,13 @@ Hardware::Hardware () cherry_plate_left_contact (GPIOE, 6), cherry_plate_right_contact (GPIOC, 13), cake_arm_out_contact (GPIOC, 5), cake_arm_in_contact (GPIOB, 1), - cherry_bad_out (GPIOE, 0), cherry_bad_in (GPIOE, 1), + cherry_bad_out (GPIOA, 15), cherry_plate_up (GPIOE, 2), cherry_plate_down (GPIOE, 3), - cherry_plate_clamp (GPIOE, 4), + cherry_plate_clamp_close (GPIOE, 0), cherry_plate_clamp_open (GPIOE, 1), cake_arm_out (GPIOB, 3), cake_arm_in (GPIOB, 4), cake_push_far_out (GPIOD, 7), cake_push_far_in (GPIOB, 5), cake_push_near_out (GPIOD, 6), cake_push_near_in (GPIOB, 6), - glass_lower_clamp_close (GPIOA, 15), glass_lower_clamp_open (GPIOA, 10), + glass_lower_clamp_close (GPIOE, 4), glass_lower_clamp_open (GPIOA, 10), glass_upper_clamp_close (GPIOD, 0), glass_upper_clamp_open (GPIOD, 1), glass_upper_clamp_up (GPIOD, 3), glass_upper_clamp_down (GPIOC, 10), gift_out (GPIOD, 4), gift_in (GPIOC, 11), diff --git a/digital/io-hub/src/apbirthday/plate.cc b/digital/io-hub/src/apbirthday/plate.cc index 3d3483c0..094fb50f 100644 --- a/digital/io-hub/src/apbirthday/plate.cc +++ b/digital/io-hub/src/apbirthday/plate.cc @@ -60,23 +60,14 @@ inline void Plate::arm_up () inline void Plate::clamp_open () { -#ifdef TARGET_host - robot->hardware.cherry_plate_clamp.set (false); -#else - robot->hardware.cherry_bad_out.set (false); - robot->hardware.cherry_bad_in.set (true); -#endif + robot->hardware.cherry_plate_clamp_close.set (false); + robot->hardware.cherry_plate_clamp_open.set (true); } inline void Plate::clamp_close () { -#ifdef TARGET_host - robot->hardware.cherry_plate_clamp.set (true); -#else - robot->hardware.cherry_bad_out.set (true); - robot->hardware.cherry_bad_in.set (false); -#endif - + robot->hardware.cherry_plate_clamp_close.set (true); + robot->hardware.cherry_plate_clamp_open.set (false); } FSM_STATES (PLATE_OFF, diff --git a/digital/io-hub/src/apbirthday/robot.cc b/digital/io-hub/src/apbirthday/robot.cc index bde89f6f..4b8a4c1f 100644 --- a/digital/io-hub/src/apbirthday/robot.cc +++ b/digital/io-hub/src/apbirthday/robot.cc @@ -90,10 +90,10 @@ Robot::Robot () ucoo::assert (i == lengthof (inputs_)); i = 0; outputs_[i++] = &hardware.cherry_bad_out; - outputs_[i++] = &hardware.cherry_bad_in; outputs_[i++] = &hardware.cherry_plate_up; outputs_[i++] = &hardware.cherry_plate_down; - outputs_[i++] = &hardware.cherry_plate_clamp; + outputs_[i++] = &hardware.cherry_plate_clamp_close; + outputs_[i++] = &hardware.cherry_plate_clamp_open; outputs_[i++] = &hardware.cake_arm_out; outputs_[i++] = &hardware.cake_arm_in; outputs_[i++] = &hardware.cake_push_far_out; diff --git a/digital/io-hub/tools/io_hub/apbirthday.py b/digital/io-hub/tools/io_hub/apbirthday.py index f23ba8bc..3979907a 100644 --- a/digital/io-hub/tools/io_hub/apbirthday.py +++ b/digital/io-hub/tools/io_hub/apbirthday.py @@ -30,8 +30,8 @@ inputs = [ 'cake_arm_out_contact', 'cake_arm_in_contact', ] outputs = [ - 'cherry_bad_out', 'cherry_bad_in', 'cherry_plate_up', - 'cherry_plate_down', 'cherry_plate_clamp', 'cake_arm_out', + 'cherry_bad_out', 'cherry_plate_up', 'cherry_plate_down', + 'cherry_plate_clamp_close', 'cherry_plate_clamp_open', 'cake_arm_out', 'cake_arm_in', 'cake_push_far_out', 'cake_push_far_in', 'cake_push_near_out', 'cake_push_near_in', 'glass_lower_clamp_close', 'glass_lower_clamp_open', diff --git a/eurobot/2013/io-hub-stm32-connectors.ods b/eurobot/2013/io-hub-stm32-connectors.ods index 4eb372b4..eb67a227 100644 Binary files a/eurobot/2013/io-hub-stm32-connectors.ods and b/eurobot/2013/io-hub-stm32-connectors.ods differ diff --git a/host/simu/robots/apbirthday/model/bag.py b/host/simu/robots/apbirthday/model/bag.py index b6bf6c60..0eb995f4 100644 --- a/host/simu/robots/apbirthday/model/bag.py +++ b/host/simu/robots/apbirthday/model/bag.py @@ -81,8 +81,9 @@ class Bag: link_bag.cherry_plate_up, link_bag.cherry_plate_down, scheduler, 0., 1., 2.5, 2.5, 1.), - PneumaticCylinder (None, - link_bag.cherry_plate_clamp, + PneumaticCylinder ( + link_bag.cherry_plate_clamp_open, + link_bag.cherry_plate_clamp_close, scheduler, 0., 1., 10., 10., 0.), (Switch (link_bag.cherry_plate_left_contact), Switch (link_bag.cherry_plate_right_contact)), -- cgit v1.2.3