From 0a3d4dfead4ed4d2eaf02d40a61e335127b60a0d Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 13 May 2012 20:57:32 +0200 Subject: host/simu/robots/guybrush: change lower clamp sensors to match real robot --- digital/io-hub/src/guybrush/contact_defs.h | 4 ---- host/simu/robots/guybrush/link/bag.py | 2 +- host/simu/robots/guybrush/model/bag.py | 6 +++--- host/simu/robots/guybrush/model/clamps.py | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/digital/io-hub/src/guybrush/contact_defs.h b/digital/io-hub/src/guybrush/contact_defs.h index fa2b22d5..e28e7b1a 100644 --- a/digital/io-hub/src/guybrush/contact_defs.h +++ b/digital/io-hub/src/guybrush/contact_defs.h @@ -30,8 +30,6 @@ #define CONTACT_STRAT F, 6 #define CONTACT_LOWER_CLAMP_SENSOR_1 D, 5 #define CONTACT_LOWER_CLAMP_SENSOR_2 B, 6 -#define CONTACT_LOWER_CLAMP_SENSOR_3 D, 6 -#define CONTACT_LOWER_CLAMP_SENSOR_4 B, 7 #define CONTACT_UPPER_CLAMP_DOWN E, 4 #define CONTACT_UPPER_CLAMP_UP E, 5 #define CONTACT_DOOR_OPEN E, 0 @@ -44,8 +42,6 @@ CONTACT (CONTACT_STRAT, 1) \ CONTACT (CONTACT_LOWER_CLAMP_SENSOR_1, 0) \ CONTACT (CONTACT_LOWER_CLAMP_SENSOR_2, 0) \ - CONTACT (CONTACT_LOWER_CLAMP_SENSOR_3, 0) \ - CONTACT (CONTACT_LOWER_CLAMP_SENSOR_4, 0) \ CONTACT (CONTACT_UPPER_CLAMP_DOWN, 1) \ CONTACT (CONTACT_UPPER_CLAMP_UP, 1) \ CONTACT (CONTACT_DOOR_OPEN, 1) \ diff --git a/host/simu/robots/guybrush/link/bag.py b/host/simu/robots/guybrush/link/bag.py index 234450e4..f47317bd 100644 --- a/host/simu/robots/guybrush/link/bag.py +++ b/host/simu/robots/guybrush/link/bag.py @@ -33,7 +33,7 @@ class Bag: self.asserv = asserv.mex.Mex (node, '%s:asserv0' % instance, aux_nb = 0) self.io_hub = io_hub.mex.Mex (node, '%s:io0' % instance, - contact_nb = 14, output_nb = 10) + contact_nb = 12, output_nb = 10) self.mimot = mimot.mex.Mex (node, '%s:mimot0' % instance) self.beacon = beacon.mex.Mex (node, '%s:beacon0' % instance) diff --git a/host/simu/robots/guybrush/model/bag.py b/host/simu/robots/guybrush/model/bag.py index caeba351..c1e66290 100644 --- a/host/simu/robots/guybrush/model/bag.py +++ b/host/simu/robots/guybrush/model/bag.py @@ -59,10 +59,10 @@ class Bag: None, scheduler, 0., 30., 150., 75., 30.), PneumaticCylinder (output[self.OUTPUT_LOWER_CLAMP_2_CLOSE], None, scheduler, 0., 30., 150., 75., 30.)), - contact[0:4], contact[10], + contact[0:2], contact[8], PneumaticCylinder (output[self.OUTPUT_UPPER_CLAMP_DOWN], output[self.OUTPUT_UPPER_CLAMP_UP], scheduler, - 0., 1., 1., 1., 1., contact[4], contact[5]), + 0., 1., 1., 1., 1., contact[2], contact[3]), PneumaticCylinder (output[self.OUTPUT_UPPER_CLAMP_IN], output[self.OUTPUT_UPPER_CLAMP_OUT], scheduler, 0., 1., 1., 1., 0.), @@ -70,7 +70,7 @@ class Bag: scheduler, 0., 30., 150., 75., 30.), PneumaticCylinder (output[self.OUTPUT_DOOR_CLOSE], output[self.OUTPUT_DOOR_OPEN], scheduler, - 0., 1., 1., 1., 1., contact[7], contact[6]) + 0., 1., 1., 1., 1., contact[5], contact[4]) ) self.distance_sensor = [ DistanceSensorSensopart (link_bag.io_hub.adc[0], scheduler, table, diff --git a/host/simu/robots/guybrush/model/clamps.py b/host/simu/robots/guybrush/model/clamps.py index 22444f30..40ec41a7 100644 --- a/host/simu/robots/guybrush/model/clamps.py +++ b/host/simu/robots/guybrush/model/clamps.py @@ -128,7 +128,7 @@ class Clamps (Observable): if floor_clamp is None: new_state = True else: - new_state = not self.lower_clamp_content[floor_clamp] + new_state = bool (self.lower_clamp_content[floor_clamp]) if new_state != old_state: for s in self.lower_clamp_sensors: s.state = new_state -- cgit v1.2.3