summaryrefslogtreecommitdiffhomepage
path: root/host/simu/robots/aquajim/model/bag.py
diff options
context:
space:
mode:
authorNicolas Schodet2009-05-03 00:19:46 +0200
committerNicolas Schodet2009-05-03 00:19:46 +0200
commit346abb99346ae7b94d0b2a49cc32f0363aed6018 (patch)
treedf2bffec6c1dce856f800550eabf46c1fa3db8b3 /host/simu/robots/aquajim/model/bag.py
parentc00406af97d8009f89b4b542132cf2620d3f93f1 (diff)
* host/simu:
- added AquaJim.
Diffstat (limited to 'host/simu/robots/aquajim/model/bag.py')
-rw-r--r--host/simu/robots/aquajim/model/bag.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/host/simu/robots/aquajim/model/bag.py b/host/simu/robots/aquajim/model/bag.py
new file mode 100644
index 00000000..d8231e6b
--- /dev/null
+++ b/host/simu/robots/aquajim/model/bag.py
@@ -0,0 +1,52 @@
+# simu - Robot simulation. {{{
+#
+# Copyright (C) 2009 Nicolas Schodet
+#
+# APBTeam:
+# Web: http://apbteam.org/
+# Email: team AT apbteam DOT org
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# }}}
+"""AquaJim bag of models."""
+from simu.model.switch import Switch
+from simu.model.position import Position
+from simu.model.distance_sensor_sharps import DistanceSensorSharps
+from simu.robots.aquajim.model.sorter import Sorter
+from math import pi
+
+class Bag:
+
+ def __init__ (self, scheduler, table, link_bag):
+ self.jack = Switch (link_bag.io.jack)
+ self.color_switch = Switch (link_bag.io.color_switch)
+ self.position = Position (link_bag.asserv.position)
+ self.sorter = Sorter (table, link_bag.asserv.aux[0],
+ link_bag.asserv.aux[1], link_bag.io.servo[0:2])
+ self.distance_sensor = [
+ DistanceSensorSharps (link_bag.io.adc[0], scheduler, table,
+ (150, 150), 0, (self.position, )),
+ DistanceSensorSharps (link_bag.io.adc[1], scheduler, table,
+ (150, 0), 0, (self.position, )),
+ DistanceSensorSharps (link_bag.io.adc[2], scheduler, table,
+ (150, -150), 0, (self.position, )),
+ DistanceSensorSharps (link_bag.io.adc[3], scheduler, table,
+ (-150, 100), pi, (self.position, )),
+ DistanceSensorSharps (link_bag.io.adc[4], scheduler, table,
+ (-150, -100), pi, (self.position, )),
+ ]
+ self.path = link_bag.io.path
+