| | |
| | | import os |
| | | import threading |
| | | import pika |
| | | import time |
| | | 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(0, src_path) |
| | | |
| | | from protos import aerial_pb2 as pb |
| | | |
| | | |
| | | |
| | |
| | | while True: |
| | | try: |
| | | if not self.queue.empty(): |
| | | msg = self.queue.get() |
| | | if isinstance(msg,str): |
| | | print(msg) |
| | | data= self.queue.get() |
| | | if isinstance(data, pb.CapturedData): |
| | | msg = pb.DataMessage() |
| | | msg. |
| | | else: |
| | | body = msg.body |
| | | routing_key = msg.routing_key |
| | |
| | | ch.basic_ack(delivery_tag = method.delivery_tag) |
| | | |
| | | |
| | | class image_data_senderThread(senderThread): |
| | | def __init__(self, |
| | | MQparameters, |
| | | input_msg_queue, |
| | | sender_id, |
| | | ): |
| | | super(command_response_senderThread,self).__init__( |
| | | MQparameters, \ |
| | | input_msg_queue, |
| | | sender_id, |
| | | "image_data", |
| | | "fanout" |
| | | ) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |