From 155e962088c0e321ae9e7aa8d8904166b3b701f8 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 3 May 2012 00:24:08 +0200 Subject: host/simu, digital/io-hub/src/guybrush: handle new US sensors positions --- host/simu/model/table_eurobot2012.py | 5 +++++ host/simu/robots/guybrush/model/bag.py | 14 ++++---------- host/simu/robots/guybrush/model/clamps.py | 2 ++ 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'host') diff --git a/host/simu/model/table_eurobot2012.py b/host/simu/model/table_eurobot2012.py index 38960513..36dbf12f 100644 --- a/host/simu/model/table_eurobot2012.py +++ b/host/simu/model/table_eurobot2012.py @@ -90,4 +90,9 @@ class Table (simu.model.table.Table): # Add everything to obstacles. self.obstacles += self.coins self.obstacles += self.gold_bars + # Add totem as obstacles. + for i in (-1, 1): + o = RectangularObstacle ((250, 250), 3) + o.pos = (1500 + i * 400, 1000) + self.obstacles.append (o) diff --git a/host/simu/robots/guybrush/model/bag.py b/host/simu/robots/guybrush/model/bag.py index f9c98814..a6302f44 100644 --- a/host/simu/robots/guybrush/model/bag.py +++ b/host/simu/robots/guybrush/model/bag.py @@ -72,21 +72,15 @@ class Bag: output[self.OUTPUT_DOOR_OPEN], scheduler, 0., 1., 1., 1., 1., contact[7], contact[6]) ) - def distance_sensor_exclude (o): - return o is self.beacon self.distance_sensor = [ DistanceSensorSensopart (link_bag.io_hub.adc[0], scheduler, table, - (20, 20), pi * 10 / 180, (self.position, ), 5, - distance_sensor_exclude), + (120, 0), 0, (self.position, ), 4), DistanceSensorSensopart (link_bag.io_hub.adc[1], scheduler, table, - (20, -20), -pi * 10 / 180, (self.position, ), 5, - distance_sensor_exclude), + (120, 160), 0, (self.position, ), set ([3, 4])), DistanceSensorSensopart (link_bag.io_hub.adc[2], scheduler, table, - (-20, -20), pi + pi * 10 / 180, (self.position, ), 5, - distance_sensor_exclude), + (120, -160), 0, (self.position, ), set ([3, 4])), DistanceSensorSensopart (link_bag.io_hub.adc[3], scheduler, table, - (-20, 20), pi - pi * 10 / 180, (self.position, ), 5, - distance_sensor_exclude), + (-130, 0), pi, (self.position, ), 4), ] self.path = link_bag.io_hub.path self.pos_report = link_bag.io_hub.pos_report diff --git a/host/simu/robots/guybrush/model/clamps.py b/host/simu/robots/guybrush/model/clamps.py index 5d75ecb4..664f0bdd 100644 --- a/host/simu/robots/guybrush/model/clamps.py +++ b/host/simu/robots/guybrush/model/clamps.py @@ -155,6 +155,8 @@ class Clamps (Observable): def __add_load (self, elements): """Add element list to load.""" + for e in elements: + e.level = 1 self.load.extend (elements) def __get_floor_elements (self): -- cgit v1.2.3