summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schodet2012-05-16 22:26:06 +0200
committerNicolas Schodet2012-05-16 22:26:06 +0200
commit032cdc6525dad927c2f19d4b027588afe1bc0e27 (patch)
tree69ea5351e2fef0808c0561b45d57163d03e07794
parent80164e9198ab46811509f7e8c7a06982bd5c7541 (diff)
digital/io-hub/src/guybrush: add nb robots switch
-rw-r--r--digital/io-hub/src/guybrush/contact_defs.h4
-rw-r--r--eurobot/2012/io-hub-cabling.svg18
-rw-r--r--host/simu/robots/guybrush/link/bag.py2
-rw-r--r--host/simu/robots/guybrush/model/bag.py3
-rw-r--r--host/simu/robots/guybrush/view/bag.py2
5 files changed, 22 insertions, 7 deletions
diff --git a/digital/io-hub/src/guybrush/contact_defs.h b/digital/io-hub/src/guybrush/contact_defs.h
index e28e7b1a..cd922ea2 100644
--- a/digital/io-hub/src/guybrush/contact_defs.h
+++ b/digital/io-hub/src/guybrush/contact_defs.h
@@ -37,6 +37,7 @@
#define CONTACT_GOLD_BAR E, 6
#define CONTACT_TOTEM E, 7
#define CONTACT_LOWER_CLAMP_ZERO D, 7
+#define CONTACT_NB_ROBOTS A, 6
#define CONTACT_LIST \
CONTACT (CONTACT_STRAT, 1) \
@@ -48,6 +49,7 @@
CONTACT (CONTACT_DOOR_CLOSE, 1) \
CONTACT (CONTACT_GOLD_BAR, 1) \
CONTACT (CONTACT_TOTEM, 1) \
- CONTACT (CONTACT_LOWER_CLAMP_ZERO, 0)
+ CONTACT (CONTACT_LOWER_CLAMP_ZERO, 0) \
+ CONTACT (CONTACT_NB_ROBOTS, 1)
#endif /* contact_defs_h */
diff --git a/eurobot/2012/io-hub-cabling.svg b/eurobot/2012/io-hub-cabling.svg
index 20e90fbe..ad0f6e38 100644
--- a/eurobot/2012/io-hub-cabling.svg
+++ b/eurobot/2012/io-hub-cabling.svg
@@ -42,11 +42,11 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="0.67057292"
- inkscape:cx="512"
- inkscape:cy="384"
+ inkscape:zoom="1.8966666"
+ inkscape:cx="376.47864"
+ inkscape:cy="413.99372"
inkscape:document-units="px"
- inkscape:current-layer="layer1"
+ inkscape:current-layer="g3102"
showgrid="true"
inkscape:window-width="1366"
inkscape:window-height="756"
@@ -561,6 +561,16 @@
x="319.57224"
id="tspan3057"
sodipodi:role="line">strategy switch</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:FreeSans;-inkscape-font-specification:FreeSans"
+ x="319.57224"
+ y="632.36218"
+ id="text3059"><tspan
+ sodipodi:role="line"
+ id="tspan3061"
+ x="319.57224"
+ y="632.36218">1/2 robot switch</tspan></text>
</g>
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
diff --git a/host/simu/robots/guybrush/link/bag.py b/host/simu/robots/guybrush/link/bag.py
index f47317bd..0603e2d9 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 = 12, output_nb = 10)
+ contact_nb = 13, 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 c1e66290..91bfedfa 100644
--- a/host/simu/robots/guybrush/model/bag.py
+++ b/host/simu/robots/guybrush/model/bag.py
@@ -49,11 +49,12 @@ class Bag:
self.color_switch.notify ()
self.jack = Switch (link_bag.io_hub.contact[1], invert = True)
self.strat_switch = Switch (link_bag.io_hub.contact[2], invert = True)
+ self.nb_robots_switch = Switch (link_bag.io_hub.contact[12], invert = True)
self.beacon = RoundObstacle (40, 5)
table.obstacles.append (self.beacon)
self.position = Position (link_bag.asserv.position, [ self.beacon ])
output = link_bag.io_hub.output
- contact = [ Switch (c) for c in link_bag.io_hub.contact[3:] ]
+ contact = [ Switch (c) for c in link_bag.io_hub.contact[3:12] ]
self.clamps = Clamps (table, self.position, link_bag.mimot.aux[0],
(PneumaticCylinder (output[self.OUTPUT_LOWER_CLAMP_1_CLOSE],
None, scheduler, 0., 30., 150., 75., 30.),
diff --git a/host/simu/robots/guybrush/view/bag.py b/host/simu/robots/guybrush/view/bag.py
index a2eadf7f..8b89272b 100644
--- a/host/simu/robots/guybrush/view/bag.py
+++ b/host/simu/robots/guybrush/view/bag.py
@@ -38,6 +38,8 @@ class Bag:
'Color')
self.strat_switch = Switch (sensor_frame, model_bag.strat_switch,
'Strat')
+ self.nb_robots_switch = Switch (sensor_frame,
+ model_bag.nb_robots_switch, 'Nb robots')
self.robot = Robot (table, model_bag.position, model_bag.clamps)
self.clamps = ClampsSide (actuator_view.add_view (ClampsSide.width,
ClampsSide.height), model_bag.clamps)