| New file |
| | |
| | | import signal |
| | | import os, sys |
| | | |
| | | # add python path of src to sys.path |
| | | src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | src_path = os.path.abspath(src_path) |
| | | sys.path.insert(1, src_path) |
| | | |
| | | |
| | | from src.engine.AcquisitionMain import AcquisitionMain |
| | | from src.engine.AcquisitionMain import Config |
| | | |
| | | def quit(signum, frame): |
| | | print('You choose to stop me.') |
| | | sys.exit() |
| | | |
| | | if __name__ == '__main__': |
| | | def help(): |
| | | print("Usage: Client.py [MQhost] [MQuser] [MQpassword] [QUEUEname] [DEVICEname] [SERVERhost] [MICROWAVEhost]") |
| | | print("EXAMPLE: Client.py 172.17.17.206 chai password123 aerial_rpc pod1 http://172.17.17.206/api 192.168.2.65") |
| | | exit(1) |
| | | |
| | | if len(sys.argv) != 8: |
| | | help() |
| | | try: |
| | | MQhost = str(sys.argv[1]) |
| | | MQuser = str(sys.argv[2]) |
| | | MQpassword = str(sys.argv[3]) |
| | | QUEUEname = str(sys.argv[4]) |
| | | DEVICEname = str(sys.argv[5]) |
| | | SERVERhost = str(sys.argv[6]) |
| | | MICROWAVEhost = str(sys.argv[7]) |
| | | |
| | | except Exception as e: |
| | | print(e) |
| | | help() |
| | | |
| | | print("Start AcquisitionMain") |
| | | signal.signal(signal.SIGINT, quit) |
| | | signal.signal(signal.SIGTERM, quit) |
| | | # client = AcquisitionMain('192.168.3.54', 'chai', |
| | | # 'password123', 'aerial_rpc', 'pod1', 'http://192.168.3.54:5000/api', 10) |
| | | config_dir = os.path.join(__file__, "..", "../src/config.json" ) |
| | | config_path = os.path.abspath(config_dir) |
| | | config = Config(config_path) |
| | | client = AcquisitionMain(MQhost, |
| | | MQuser, |
| | | MQpassword, |
| | | QUEUEname, |
| | | DEVICEname, |
| | | SERVERhost, |
| | | MICROWAVEhost, # udp server host, 192.168.2.65 for production |
| | | config) |
| | | client.start() |
| New file |
| | |
| | | import sys |
| | | import os |
| | | |
| | | # add python path of src to sys.path |
| | | src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | src_path = os.path.abspath(src_path) |
| | | sys.path.insert(1, src_path) |
| | | |
| | | from src.Server import MyServer |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | def help(): |
| | | print("Usage: Server.py [MQhost] [MQuser] [MQpassword] [QUEUEname] [WEBport] [SAVEfolder]") |
| | | print("EXAMPLE: Server.py localhost chai password123 aerial_rpc 5000 ./Images") |
| | | exit(1) |
| | | |
| | | if len(sys.argv) != 7: |
| | | help() |
| | | try: |
| | | MQhost = str(sys.argv[1]) |
| | | MQuser = str(sys.argv[2]) |
| | | MQpassword = str(sys.argv[3]) |
| | | QUEUEname = str(sys.argv[4]) |
| | | WEBport = int(sys.argv[5]) |
| | | SAVEfolder = str(sys.argv[6]) |
| | | save_folder = SAVEfolder |
| | | |
| | | except Exception as e: |
| | | print(e) |
| | | help() |
| | | server = MyServer(host=MQhost, user=MQuser, password=MQpassword, queue=QUEUEname, port=WEBport, SAVEfolder=save_folder) |
| | | server.run_all() |
| | |
| | | |
| | | echo change to path: %cd% |
| | | |
| | | set MQhost=192.168.1.224 |
| | | set MQhost=localhost |
| | | set MQuser=chai |
| | | set MQpassword=password123 |
| | | set QUEUEname=aerial_rpc |
| | |
| | | echo Client.py is running ... |
| | | @REM -------- Usage: Client.py [MQhost] [MQuser] [MQpassword] [QUEUEname] [DEVICEname] [SERVERhost] [MICROWAVEhost] |
| | | @REM %aerialpython% ./src/Client.py %MQhost% %MQuser% %MQpassword% %QUEUEname% %DEVICEname% %SERVERhost% %MICROWAVEhost% >> %LOGfile% |
| | | %aerialpython% ./src/Client.py %MQhost% %MQuser% %MQpassword% %QUEUEname% %DEVICEname% %SERVERhost% %MICROWAVEhost% |
| | | %aerialpython% ./scripts/mqClient.py %MQhost% %MQuser% %MQpassword% %QUEUEname% %DEVICEname% %SERVERhost% %MICROWAVEhost% |
| | | echo Client.py has been terminited. |
| | | pause |
| | |
| | | |
| | | echo change to path: %cd% |
| | | |
| | | set MQhost=localhost |
| | | @REM set MQhost=localhost |
| | | set MQhost=47.92.33.19 |
| | | set MQuser=chai |
| | | set MQpassword=password123 |
| | | set QUEUEname=aerial_rpc |
| | |
| | | echo the log file will be saved in the [%LOGfile%] file |
| | | echo Server.py is running ... |
| | | @REM -------- Usage: Server.py [MQhost] [MQuser] [MQpassword] [QUEUEname] [WEBport] [SAVEfolder]") |
| | | %aerialpython% ./src/Server.py %MQhost% %MQuser% %MQpassword% %QUEUEname% %WEBport% %SAVEfolder% >> %LOGfile% |
| | | %aerialpython% ./scripts/mqServer.py %MQhost% %MQuser% %MQpassword% %QUEUEname% %WEBport% %SAVEfolder% |
| | | echo Server.py has been terminited. |
| | | pause |
| | | |
| | |
| | | import signal |
| | | import os, sys |
| | | # import signal |
| | | # import os, sys |
| | | |
| | | |
| | | from .engine.AcquisitionMain import AcquisitionMain |
| | | from .engine.AcquisitionMain import Config |
| | | # from .engine.AcquisitionMain import AcquisitionMain |
| | | # from .engine.AcquisitionMain import Config |
| | | |
| | | def quit(signum, frame): |
| | | print('You choose to stop me.') |
| | | sys.exit() |
| | | # def quit(signum, frame): |
| | | # print('You choose to stop me.') |
| | | # sys.exit() |
| | | |
| | | if __name__ == '__main__': |
| | | def help(): |
| | | print("Usage: Client.py [MQhost] [MQuser] [MQpassword] [QUEUEname] [DEVICEname] [SERVERhost] [MICROWAVEhost]") |
| | | print("EXAMPLE: Client.py 172.17.17.206 chai password123 aerial_rpc pod1 http://172.17.17.206/api 192.168.2.65") |
| | | exit(1) |
| | | # if __name__ == '__main__': |
| | | # def help(): |
| | | # print("Usage: Client.py [MQhost] [MQuser] [MQpassword] [QUEUEname] [DEVICEname] [SERVERhost] [MICROWAVEhost]") |
| | | # print("EXAMPLE: Client.py 172.17.17.206 chai password123 aerial_rpc pod1 http://172.17.17.206/api 192.168.2.65") |
| | | # exit(1) |
| | | |
| | | if len(sys.argv) != 8: |
| | | help() |
| | | try: |
| | | MQhost = str(sys.argv[1]) |
| | | MQuser = str(sys.argv[2]) |
| | | MQpassword = str(sys.argv[3]) |
| | | QUEUEname = str(sys.argv[4]) |
| | | DEVICEname = str(sys.argv[5]) |
| | | SERVERhost = str(sys.argv[6]) |
| | | MICROWAVEhost = str(sys.argv[7]) |
| | | # if len(sys.argv) != 8: |
| | | # help() |
| | | # try: |
| | | # MQhost = str(sys.argv[1]) |
| | | # MQuser = str(sys.argv[2]) |
| | | # MQpassword = str(sys.argv[3]) |
| | | # QUEUEname = str(sys.argv[4]) |
| | | # DEVICEname = str(sys.argv[5]) |
| | | # SERVERhost = str(sys.argv[6]) |
| | | # MICROWAVEhost = str(sys.argv[7]) |
| | | |
| | | except Exception as e: |
| | | print(e) |
| | | help() |
| | | # except Exception as e: |
| | | # print(e) |
| | | # help() |
| | | |
| | | print("Start AcquisitionMain") |
| | | signal.signal(signal.SIGINT, quit) |
| | | signal.signal(signal.SIGTERM, quit) |
| | | # client = AcquisitionMain('192.168.3.54', 'chai', |
| | | # 'password123', 'aerial_rpc', 'pod1', 'http://192.168.3.54:5000/api', 10) |
| | | config_dir = os.path.join(__file__, "..", "config.json" ) |
| | | config_path = os.path.abspath(config_dir) |
| | | config = Config(config_path) |
| | | client = AcquisitionMain(MQhost, |
| | | MQuser, |
| | | MQpassword, |
| | | QUEUEname, |
| | | DEVICEname, |
| | | SERVERhost, |
| | | MICROWAVEhost, # udp server host, 192.168.2.65 for production |
| | | config) |
| | | client.start() |
| | | # print("Start AcquisitionMain") |
| | | # signal.signal(signal.SIGINT, quit) |
| | | # signal.signal(signal.SIGTERM, quit) |
| | | # # client = AcquisitionMain('192.168.3.54', 'chai', |
| | | # # 'password123', 'aerial_rpc', 'pod1', 'http://192.168.3.54:5000/api', 10) |
| | | # config_dir = os.path.join(__file__, "..", "config.json" ) |
| | | # config_path = os.path.abspath(config_dir) |
| | | # config = Config(config_path) |
| | | # client = AcquisitionMain(MQhost, |
| | | # MQuser, |
| | | # MQpassword, |
| | | # QUEUEname, |
| | | # DEVICEname, |
| | | # SERVERhost, |
| | | # MICROWAVEhost, # udp server host, 192.168.2.65 for production |
| | | # config) |
| | | # client.start() |
| | |
| | | |
| | | |
| | | class MyServer(Flask): |
| | | def __init__(self, host, user, password, queue, port): |
| | | def __init__(self, host, user, password, queue, port, SAVEfolder): |
| | | Flask.__init__(self, __name__) |
| | | self.host = host |
| | | self.user = user |
| | | self.password = password |
| | | self.queue = queue |
| | | self.port = port |
| | | global save_folder |
| | | save_folder = SAVEfolder |
| | | |
| | | |
| | | self.route('/api', methods=['POST'])(self.api) |
| | | self.route('/', methods=['GET'])(self.hello) |
| | |
| | | msg.data1.length = len(data1_str) |
| | | msg.data1.data = data1_str |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | def help(): |
| | | print("Usage: Server.py [MQhost] [MQuser] [MQpassword] [QUEUEname] [WEBport] [SAVEfolder]") |
| | | print("EXAMPLE: Server.py localhost chai password123 aerial_rpc 5000 ./Images") |
| | | exit(1) |
| | | |
| | | if len(sys.argv) != 7: |
| | | help() |
| | | try: |
| | | MQhost = str(sys.argv[1]) |
| | | MQuser = str(sys.argv[2]) |
| | | MQpassword = str(sys.argv[3]) |
| | | QUEUEname = str(sys.argv[4]) |
| | | WEBport = int(sys.argv[5]) |
| | | SAVEfolder = str(sys.argv[6]) |
| | | global save_folder |
| | | save_folder = SAVEfolder |
| | | |
| | | except Exception as e: |
| | | print(e) |
| | | help() |
| | | server = MyServer(host="localhost", user='chai', password='password123', queue='aerial_rpc', port=5000) |
| | | server.run_all() |
| | |
| | | from .engine import * |
| | | from .microwave import * |
| | | from .protos import * |
| | | from .slam import * |
| | | from .utils import * |
| | |
| | | from .ControllThread import ControllThread |
| | | from .MicroWaveUDPThread import MicroWaveUDPThread |
| | | |
| | | # add python path of src to sys.path |
| | | src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | src_path = os.path.abspath(src_path) |
| | | sys.path.insert(0, src_path) |
| | | # # add python path of src to sys.path |
| | | # src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | # src_path = os.path.abspath(src_path) |
| | | # sys.path.insert(0, src_path) |
| | | |
| | | from protos import aerial_pb2 as pb |
| | | from ..protos import aerial_pb2 as pb |
| | | |
| | | |
| | | IMAGE_WIDTH = 3840 |
| | |
| | | import time |
| | | |
| | | |
| | | # add python path of src to sys.path |
| | | src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | src_path = os.path.abspath(src_path) |
| | | sys.path.insert(0, src_path) |
| | | # # add python path of src to sys.path |
| | | # src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | # src_path = os.path.abspath(src_path) |
| | | # sys.path.insert(0, src_path) |
| | | |
| | | from protos import aerial_pb2 as pb |
| | | from ..protos import aerial_pb2 as pb |
| | | |
| | | |
| | | class CaptureThread(threading.Thread): |
| | |
| | | import threading |
| | | from .DustCleanerThread import DustCleanerThread |
| | | |
| | | # add python path of src to sys.path |
| | | src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | src_path = os.path.abspath(src_path) |
| | | sys.path.insert(0, src_path) |
| | | # # add python path of src to sys.path |
| | | # src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | # src_path = os.path.abspath(src_path) |
| | | # sys.path.insert(0, src_path) |
| | | |
| | | from protos import aerial_pb2 as pb |
| | | from ..protos import aerial_pb2 as pb |
| | | |
| | | class ControllThread(threading.Thread): |
| | | """ |
| | |
| | | |
| | | from .DustCleaner import DustCleaner |
| | | |
| | | # add python path of src to sys.path |
| | | src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | src_path = os.path.abspath(src_path) |
| | | sys.path.insert(0, src_path) |
| | | # # add python path of src to sys.path |
| | | # src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | # src_path = os.path.abspath(src_path) |
| | | # sys.path.insert(0, src_path) |
| | | |
| | | from protos import aerial_pb2 as pb |
| | | from ..protos import aerial_pb2 as pb |
| | | |
| | | |
| | | |
| | |
| | | from ctypes import sizeof |
| | | from .DeviceManager import DeviceManager |
| | | |
| | | # add python path of src to sys.path |
| | | src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | src_path = os.path.abspath(src_path) |
| | | sys.path.insert(0, src_path) |
| | | # # add python path of src to sys.path |
| | | # src_path = os.path.join(__file__, *(['..'] * 2)) |
| | | # src_path = os.path.abspath(src_path) |
| | | # sys.path.insert(0, src_path) |
| | | |
| | | from microwave.components import HeaderBlock |
| | | from protos import aerial_pb2 as pb |
| | | from ..microwave.components import HeaderBlock |
| | | from ..protos import aerial_pb2 as pb |
| | | |
| | | class MessageQueueThread(threading.Thread): |
| | | def __init__(self, |
| | |
| | | src_path = os.path.abspath(src_path) |
| | | sys.path.insert(0, src_path) |
| | | |
| | | from microwave.servers import MicroWaveUDPServer |
| | | from ..microwave.servers import MicroWaveUDPServer |
| | | |
| | | |
| | | class MicroWaveUDPThread (threading.Thread): |