-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various refactors, mainly new multiprocess script
- Loading branch information
MDP G14 RPI
committed
Nov 7, 2019
1 parent
a0626ae
commit d2f96e6
Showing
16 changed files
with
300 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
import os | ||
|
||
# Using Multiprocess instead of Multithread to employ all 4 cores of RPI | ||
# from src.communicator.MultiThread import MultiThread | ||
from src.communicator.MultiProcess import MultiProcess | ||
# from src.detector.SymbolDetector import SymbolDetector | ||
import argparse | ||
from src.communicator.MultiThread import MultiThread | ||
# from src.communicator.MultiProcess import MultiProcess | ||
from src.communicator.MultiProcess_v2 import MultiProcess | ||
from src.Logger import Logger | ||
|
||
log = Logger() | ||
|
||
parser = argparse.ArgumentParser(description='Main Program for MDP') | ||
parser.add_argument('-v', '--verbose', const=True, default=False, nargs='?') | ||
|
||
def init(): | ||
args = parser.parse_args() | ||
verbose = args.verbose | ||
os.system("sudo hciconfig hci0 piscan") | ||
try: | ||
multi_thread = MultiProcess() | ||
multi_thread = MultiProcess(verbose) | ||
multi_thread.start() | ||
|
||
# Currently SymbolDetector seems to be running really slow | ||
# on a thread. So if just testing SymbolDetector, comment and | ||
# uncomment respectively the code above and below | ||
|
||
# detector = SymbolDetector() | ||
# detector.detect() | ||
except KeyboardInterrupt: | ||
multi_thread.end() | ||
# detector.end() | ||
|
||
if __name__ == '__main__': | ||
init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
from picamera import PiCamera | ||
from picamera.array import PiRGBArray | ||
from time import sleep | ||
|
||
camera = PiCamera() | ||
camera.vflip = True | ||
camera.start_preview() | ||
sleep(10) | ||
camera.stop_preview() | ||
camera.resolution = (540, 480) | ||
camera.framerate = 30 | ||
camera.vflip = False | ||
camera.hflip = False | ||
|
||
# camera.start_preview() | ||
# sleep(10) | ||
# camera.stop_preview() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.