Zwischencommit

This commit is contained in:
Kevin Frantz 2017-04-16 20:27:42 +00:00
parent 7096c758a8
commit 473ec178a6
4 changed files with 32 additions and 20 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
__pycache__/autopilot.cpython-36.pyc
__pycache__/vero.cpython-36.pyc
sensoren/__pycache__/

View File

@ -62,8 +62,8 @@ class Autopilot(CORE,THREAD):
def testForward(self):
ultraschallMitte=self.ultraschallMitte.getValue();
if(ultraschallMitte<=self.ultraschalminimum
or self.ultraschallRechts.getValue()<=self.ultraschalminimum
or self.ultraschallLinks.getValue()<=self.ultraschalminimum
#or self.ultraschallRechts.getValue()<=self.ultraschalminimum
#or self.ultraschallLinks.getValue()<=self.ultraschalminimum
or self.infarotMitteLinks.getValue()
or self.infarotMitteRechts.getValue()):
self.stop();

View File

@ -20,24 +20,32 @@ def help():
print("Halbautomatisch: w")
print("Manuell: e")
def autopilot():
core=AUTOPILOT()
#core.start();
while True:
try:
core.forward();
except ForwardMoveException:
if randint(0,1):
core.backward();
else:
if randint(0,1):
core.turnLeft();
try:
core=AUTOPILOT()
#core.start();
while True:
try:
core.printValues();
if core.moveStatus!=1:
core.forward();
else:
core.turnRight();
except LeftMoveException:
core.turnLeft();
except RightMoveException:
core.turnRight();
sleep(0.5);
core.statusTest();
except ForwardMoveException:
if randint(0,1):
core.backward();
else:
if randint(0,1):
core.turnLeft();
else:
core.turnRight();
except LeftMoveException:
core.turnLeft();
except RightMoveException:
core.turnRight();
sleep(1);
except KeyboardInterrupt:
print("Verlasse Autopilot...")
#core=CORE();
def doIt(order):
switcher = {
'w': lambda: core.forward(),

View File

@ -1,6 +1,7 @@
#!/bin/bash
#Streamt ein Video auf Vaio
/opt/vc/bin/raspivid --hflip --vflip -t 0 -o - | nc 192.168.178.30 5001
#/opt/vc/bin/raspivid --hflip --vflip -t 0 -o - | nc 192.168.178.30 5001
#Auf Vaio muss
# nc -l -p 5001 | mplayer -fps 31 -cache 1024 -
# ausgefuehert werden
/opt/vc/bin/raspivid -w 640 -h 480 --hflip --vflip -t 0 -o - | nc 192.168.178.30 5001