summaryrefslogtreecommitdiff
path: root/host/simu/robots/robospierre/model/bag.py
diff options
context:
space:
mode:
authorNicolas Schodet2011-05-14 01:28:54 +0200
committerNicolas Schodet2011-05-14 01:38:19 +0200
commitc8d4bd0e0f79dc8e49ad0074a1e67317e903c41f (patch)
tree9a2b010211a2382f7dfe3812a907674a969fb75d /host/simu/robots/robospierre/model/bag.py
parenta3fdbecac564a600c65568cac0e02fc72604567e (diff)
digital/io-hub, host/simu: add contacts
Diffstat (limited to 'host/simu/robots/robospierre/model/bag.py')
-rw-r--r--host/simu/robots/robospierre/model/bag.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/host/simu/robots/robospierre/model/bag.py b/host/simu/robots/robospierre/model/bag.py
index 0a89d00c..5a6fa023 100644
--- a/host/simu/robots/robospierre/model/bag.py
+++ b/host/simu/robots/robospierre/model/bag.py
@@ -32,8 +32,8 @@ from math import pi
class Bag:
def __init__ (self, scheduler, table, link_bag):
- self.color_switch = Switch (link_bag.io_hub.contact[0])
- self.jack = Switch (link_bag.io_hub.contact[1])
+ self.color_switch = Switch (link_bag.io_hub.contact[0], invert = True)
+ self.jack = Switch (link_bag.io_hub.contact[1], invert = True)
self.contact = [ Switch (contact)
for contact in link_bag.io_hub.contact[2:] ]
self.position = Position (link_bag.asserv.position)
@@ -42,7 +42,8 @@ class Bag:
self.door_motors = [ MotorBasic (link_bag.io_hub.pwm[i], scheduler,
2 * pi, 0, 0.5 * pi) for i in (0, 1, 3, 4) ]
self.clamp = Clamp (table, self.position, link_bag.mimot.aux[0],
- link_bag.mimot.aux[1], self.clamping_motor, self.door_motors)
+ link_bag.mimot.aux[1], self.clamping_motor, self.door_motors,
+ self.contact[0:7])
self.distance_sensor = [
DistanceSensorSensopart (link_bag.io_hub.adc[0], scheduler, table,
(20, 20), pi * 10 / 180, (self.position, ), 2),