diff --git a/camera module/__pycache__/servo.cpython-37.pyc b/camera module/__pycache__/servo.cpython-37.pyc deleted file mode 100644 index 32fda42..0000000 Binary files a/camera module/__pycache__/servo.cpython-37.pyc and /dev/null differ diff --git a/camera module/main.py b/camera module/main.py index 11c05c4..77cb744 100644 --- a/camera module/main.py +++ b/camera module/main.py @@ -4,7 +4,7 @@ import zmq import servo # Constant variables definition. -MAJOR_VERSION = cv2.getVersionMajor() +MAJOR_VERSION = 3 SERVO_INITIAL_X_ANGLE = 90 # The initial horizontal angle of the camera. SERVO_INITIAL_Y_ANGLE = 90 # The initial vertical angle of the camera. SERVO_STEP_ANGLE = 5 # The angle at which the servo motors move each frame. @@ -149,15 +149,13 @@ while True: footage_socket = context.socket(zmq.PUB) footage_socket.connect('tcp://' + client_ip.decode() + ':5555') -#camera = cv2.VideoCapture(0) # init the camera - servoX = SERVO_INITIAL_X_ANGLE servoY = SERVO_INITIAL_Y_ANGLE servo.SetAngleUp(servoY) servo.SetAngleDown(servoX) -cap = cv2.VideoCapture('drone_test.mp4') +cap = cv2.VideoCapture(0) if (cap.isOpened() == False): print('Error opening stream.') quit() @@ -196,7 +194,6 @@ while (cap.isOpened()): elif xDir == -1: servoX = servoX - SERVO_STEP_ANGLE servo.SetAngleDown(servoX) - else: break except KeyboardInterrupt: diff --git a/tracking and telemetry/Client/.vs/Client/v16/.suo b/tracking and telemetry/Client/.vs/Client/v16/.suo index 16a00fa..53c216e 100644 Binary files a/tracking and telemetry/Client/.vs/Client/v16/.suo and b/tracking and telemetry/Client/.vs/Client/v16/.suo differ diff --git a/tracking and telemetry/Client/.vs/Client/v16/Server/sqlite3/storage.ide-shm b/tracking and telemetry/Client/.vs/Client/v16/Server/sqlite3/storage.ide-shm new file mode 100644 index 0000000..06453ac Binary files /dev/null and b/tracking and telemetry/Client/.vs/Client/v16/Server/sqlite3/storage.ide-shm differ diff --git a/tracking and telemetry/Client/.vs/Client/v16/Server/sqlite3/storage.ide-wal b/tracking and telemetry/Client/.vs/Client/v16/Server/sqlite3/storage.ide-wal new file mode 100644 index 0000000..23e10f1 Binary files /dev/null and b/tracking and telemetry/Client/.vs/Client/v16/Server/sqlite3/storage.ide-wal differ diff --git a/tracking and telemetry/Client/add_module.Designer.cs b/tracking and telemetry/Client/add_module.Designer.cs index cc91366..ed12b24 100644 --- a/tracking and telemetry/Client/add_module.Designer.cs +++ b/tracking and telemetry/Client/add_module.Designer.cs @@ -34,12 +34,14 @@ this.txt_moduleIP = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.txt_hostIP = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // button1 // this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button1.Location = new System.Drawing.Point(12, 89); + this.button1.Location = new System.Drawing.Point(12, 117); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(353, 40); this.button1.TabIndex = 0; @@ -68,7 +70,7 @@ // txt_moduleIP // this.txt_moduleIP.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txt_moduleIP.Location = new System.Drawing.Point(168, 54); + this.txt_moduleIP.Location = new System.Drawing.Point(168, 82); this.txt_moduleIP.Name = "txt_moduleIP"; this.txt_moduleIP.Size = new System.Drawing.Size(197, 29); this.txt_moduleIP.TabIndex = 4; @@ -77,7 +79,7 @@ // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.Location = new System.Drawing.Point(8, 54); + this.label2.Location = new System.Drawing.Point(8, 82); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(154, 24); this.label2.TabIndex = 3; @@ -88,15 +90,35 @@ this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.richTextBox1.Location = new System.Drawing.Point(371, 9); this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.Size = new System.Drawing.Size(472, 119); + this.richTextBox1.Size = new System.Drawing.Size(472, 148); this.richTextBox1.TabIndex = 7; this.richTextBox1.Text = ""; // + // txt_hostIP + // + this.txt_hostIP.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txt_hostIP.Location = new System.Drawing.Point(168, 46); + this.txt_hostIP.Name = "txt_hostIP"; + this.txt_hostIP.Size = new System.Drawing.Size(197, 29); + this.txt_hostIP.TabIndex = 9; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(34, 49); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(128, 24); + this.label3.TabIndex = 8; + this.label3.Text = "Host Address:"; + // // add_module // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(855, 134); + this.ClientSize = new System.Drawing.Size(855, 169); + this.Controls.Add(this.txt_hostIP); + this.Controls.Add(this.label3); this.Controls.Add(this.richTextBox1); this.Controls.Add(this.txt_moduleIP); this.Controls.Add(this.label2); @@ -119,5 +141,7 @@ private System.Windows.Forms.TextBox txt_moduleIP; private System.Windows.Forms.Label label2; private System.Windows.Forms.RichTextBox richTextBox1; + private System.Windows.Forms.TextBox txt_hostIP; + private System.Windows.Forms.Label label3; } } \ No newline at end of file diff --git a/tracking and telemetry/Client/add_module.cs b/tracking and telemetry/Client/add_module.cs index 38a26c1..ab43af4 100644 --- a/tracking and telemetry/Client/add_module.cs +++ b/tracking and telemetry/Client/add_module.cs @@ -1,13 +1,6 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Diagnostics; -using System.Drawing; -using System.Linq; using System.Net.NetworkInformation; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace Client @@ -42,7 +35,8 @@ namespace Client try { string viewer_path = System.IO.Path.GetFullPath(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\..\..\..\tracking and telemetry\viewer\viewer_exe\viewer.exe")); - var proc = System.Diagnostics.Process.Start(viewer_path,txt_moduleIP.Text); + string args = txt_moduleIP.Text + " " + txt_hostIP; + var proc = Process.Start(viewer_path,args); } catch (Exception ex) { diff --git a/tracking and telemetry/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/tracking and telemetry/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 07d7862..0a22a22 100644 Binary files a/tracking and telemetry/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/tracking and telemetry/Client/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/tracking and telemetry/viewer/README.md b/tracking and telemetry/viewer/README.md deleted file mode 100644 index bf7044f..0000000 --- a/tracking and telemetry/viewer/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Talos_Drones_Tracking_and_Telemetry - -![enter image description here](https://scontent.fath7-1.fna.fbcdn.net/v/t1.0-9/74674993_115153423241475_4772277731842850816_n.jpg?_nc_cat=103&_nc_ohc=fl0TAVjHIzoAQn0zfYrt0L-uHNcVjRjos4qpfN2RWaFryHpJ41NLYKVnA&_nc_ht=scontent.fath7-1.fna&oh=0b9912eb666fd830d18fce5fb9205b5b&oe=5ED97648) \ No newline at end of file diff --git a/tracking and telemetry/viewer/src/__pycache__/viewer.cpython-37.pyc b/tracking and telemetry/viewer/src/__pycache__/viewer.cpython-37.pyc index e35c21f..45eed34 100644 Binary files a/tracking and telemetry/viewer/src/__pycache__/viewer.cpython-37.pyc and b/tracking and telemetry/viewer/src/__pycache__/viewer.cpython-37.pyc differ diff --git a/tracking and telemetry/viewer/src/viewer.py b/tracking and telemetry/viewer/src/viewer.py index 5850214..af02013 100644 --- a/tracking and telemetry/viewer/src/viewer.py +++ b/tracking and telemetry/viewer/src/viewer.py @@ -10,13 +10,15 @@ context = zmq.Context() module_ip = str(sys.argv[1]) +client_ip = str(sys.argv[2]) + print("Connecting to module…") socket = context.socket(zmq.REQ) -socket.connect("tcp://" + module_ip + ":4444") -socket.send(str.encode(module_ip)) +socket.connect("tcp://"+ module_ip +":4444") +socket.send(str.encode(client_ip)) footage_socket = context.socket(zmq.SUB) -footage_socket.bind('tcp://*:5555') +footage_socket.bind("tcp://0.0.0.0:5555") footage_socket.setsockopt_string(zmq.SUBSCRIBE, np.unicode('')) while True: @@ -24,6 +26,7 @@ while True: frame = footage_socket.recv_string() img = base64.b64decode(frame) npimg = np.fromstring(img, dtype=np.uint8) + source = cv2.imdecode(npimg, 1) cv2.imshow("Stream", source) cv2.waitKey(1) diff --git a/tracking and telemetry/viewer/viewer_exe/base_library.zip b/tracking and telemetry/viewer/viewer_exe/base_library.zip index 4bbf5f7..1f18389 100644 Binary files a/tracking and telemetry/viewer/viewer_exe/base_library.zip and b/tracking and telemetry/viewer/viewer_exe/base_library.zip differ diff --git a/tracking and telemetry/viewer/viewer_exe/viewer.exe b/tracking and telemetry/viewer/viewer_exe/viewer.exe index 9119eab..6c00bd6 100644 Binary files a/tracking and telemetry/viewer/viewer_exe/viewer.exe and b/tracking and telemetry/viewer/viewer_exe/viewer.exe differ