Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/followme.py
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2012-07-02 04:39:37 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2012-07-02 04:39:37 (GMT)
commit658f7611a73cb341ef10f50dc76c405e6de042ca (patch)
treee692519b11c0997a6a321930a6ed2464347698d9 /followme.py
parentf23ba1cce1dc127028571acda6949f539638bbbd (diff)
make new sugar style bars > 0.86
Diffstat (limited to 'followme.py')
-rwxr-xr-xfollowme.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/followme.py b/followme.py
index c04f853..961254b 100755
--- a/followme.py
+++ b/followme.py
@@ -63,10 +63,11 @@ class Captura(object):
def get_camera(self, tamanio, modo):
# detengo la cámara
- try:
- self.cam.stop()
- except:
- pass
+ if self.cam:
+ try:
+ self.cam.stop()
+ except:
+ pass
# obtenemos la lista de camaras
self.lcamaras = pygame.camera.list_cameras()
@@ -398,7 +399,7 @@ class FollowMe:
def run(self):
# creamos el robot
- self.r = Robot()
+ #self.r = Robot()
# establecemos un valor de umbral de color
self.umbral = (25, 25, 25)
# establecemos un color a seguir
@@ -463,9 +464,15 @@ class FollowMe:
# seteo a 10 CPS (CuadrosPorSegundo)
self.clock.tick(10)
- if self.r.butia:
- self.r.butia.close()
- self.r.butia.closeService()
- if self.r.bobot:
- self.r.bobot.kill()
+ if self.r:
+ if self.r.butia:
+ self.r.butia.close()
+ self.r.butia.closeService()
+ if self.r.bobot:
+ self.r.bobot.kill()
+ if self.c.cam:
+ try:
+ self.cam.stop()
+ except:
+ pass