Browse Source

Adding final comments

master
Georgios Gerontakis 5 years ago
parent
commit
b0bc69d50f
  1. BIN
      camera module/drone_test.mp4
  2. BIN
      tracking and telemetry/Client/.vs/Client/DesignTimeBuild/.dtbcache
  3. BIN
      tracking and telemetry/Client/.vs/Client/v16/.suo
  4. BIN
      tracking and telemetry/Client/.vs/Client/v16/Server/sqlite3/storage.ide
  5. 20
      tracking and telemetry/Client/Client.cs
  6. BIN
      tracking and telemetry/Client/bin/Debug/Client.exe
  7. BIN
      tracking and telemetry/Client/bin/Debug/Client.pdb
  8. BIN
      tracking and telemetry/Client/bin/Debug/MAVLink.dll
  9. BIN
      tracking and telemetry/Client/bin/Debug/MAVLink.pdb
  10. 3
      tracking and telemetry/Client/obj/Debug/Client.csproj.FileListAbsolute.txt
  11. BIN
      tracking and telemetry/Client/obj/Debug/Client.csproj.GenerateResource.cache
  12. BIN
      tracking and telemetry/Client/obj/Debug/Client.csprojAssemblyReference.cache
  13. BIN
      tracking and telemetry/Client/obj/Debug/Client.exe
  14. BIN
      tracking and telemetry/Client/obj/Debug/Client.pdb
  15. BIN
      tracking and telemetry/Mavlink/bin/Debug/MAVLink.1.0.5.nupkg
  16. BIN
      tracking and telemetry/Mavlink/bin/Debug/net35/MAVLink.dll
  17. BIN
      tracking and telemetry/Mavlink/bin/Debug/net35/MAVLink.pdb
  18. BIN
      tracking and telemetry/Mavlink/bin/Debug/net461/MAVLink.dll
  19. BIN
      tracking and telemetry/Mavlink/bin/Debug/net461/MAVLink.pdb
  20. BIN
      tracking and telemetry/Mavlink/bin/Debug/netstandard2.0/MAVLink.dll
  21. BIN
      tracking and telemetry/Mavlink/bin/Debug/netstandard2.0/MAVLink.pdb
  22. 6
      tracking and telemetry/Mavlink/obj/Debug/MAVLink.1.0.5.nuspec
  23. BIN
      tracking and telemetry/Mavlink/obj/Debug/net35/MAVLink.assets.cache
  24. BIN
      tracking and telemetry/Mavlink/obj/Debug/net35/MAVLink.csprojAssemblyReference.cache
  25. BIN
      tracking and telemetry/Mavlink/obj/Debug/net35/MAVLink.dll
  26. BIN
      tracking and telemetry/Mavlink/obj/Debug/net35/MAVLink.pdb
  27. BIN
      tracking and telemetry/Mavlink/obj/Debug/net461/MAVLink.assets.cache
  28. BIN
      tracking and telemetry/Mavlink/obj/Debug/net461/MAVLink.csprojAssemblyReference.cache
  29. BIN
      tracking and telemetry/Mavlink/obj/Debug/net461/MAVLink.dll
  30. BIN
      tracking and telemetry/Mavlink/obj/Debug/net461/MAVLink.pdb
  31. BIN
      tracking and telemetry/Mavlink/obj/Debug/netstandard2.0/MAVLink.assets.cache
  32. BIN
      tracking and telemetry/Mavlink/obj/Debug/netstandard2.0/MAVLink.csprojAssemblyReference.cache
  33. BIN
      tracking and telemetry/Mavlink/obj/Debug/netstandard2.0/MAVLink.dll
  34. BIN
      tracking and telemetry/Mavlink/obj/Debug/netstandard2.0/MAVLink.pdb
  35. 2
      tracking and telemetry/Mavlink/obj/MAVLink.csproj.nuget.cache
  36. 23
      tracking and telemetry/Mavlink/obj/MAVLink.csproj.nuget.dgspec.json
  37. 2
      tracking and telemetry/Mavlink/obj/MAVLink.csproj.nuget.g.props
  38. 2
      tracking and telemetry/Mavlink/obj/MAVLink.csproj.nuget.g.targets
  39. 22
      tracking and telemetry/Mavlink/obj/project.assets.json
  40. 21
      tracking and telemetry/viewer/src/viewer.py

BIN
camera module/drone_test.mp4

Binary file not shown.

BIN
tracking and telemetry/Client/.vs/Client/DesignTimeBuild/.dtbcache

Binary file not shown.

BIN
tracking and telemetry/Client/.vs/Client/v16/.suo

Binary file not shown.

BIN
tracking and telemetry/Client/.vs/Client/v16/Server/sqlite3/storage.ide

Binary file not shown.

20
tracking and telemetry/Client/Client.cs

@ -61,7 +61,7 @@ namespace Client
// set the comport options
serialPort1.PortName = CMB_comport.Text;
serialPort1.BaudRate = 115200;
serialPort1.BaudRate = int.Parse(comboBox1.Text);
// open the comport
serialPort1.Open();
@ -156,15 +156,17 @@ namespace Client
}));
//detect gps packet
if (packet.msgid == (byte)MAVLink.MAVLINK_MSG_ID.GLOBAL_POSITION_INT)
{
marker.IsVisible = true;
var global_position_int = (MAVLink.mavlink_global_position_int_t)packet.data;
//get longitude and latitude info from packet
var lon = global_position_int.lon / 10000000.0;
var lat = global_position_int.lat / 10000000.0;
gmap.Invoke(new Action(() =>
gmap.Invoke(new Action(() => //access gui thread
{
//draw on map
gmap.Position = new PointLatLng(lat, lon);
GMapMarker line = new GMarkerGoogle(new PointLatLng(lat, lon), new Bitmap(dot));
marker.Position = new PointLatLng(lat, lon);
@ -174,11 +176,13 @@ namespace Client
}
//detect system status packet
if (packet.msgid == (byte)MAVLink.MAVLINK_MSG_ID.SYS_STATUS)
{
progressBar1.Invoke(new Action(() =>
{
var sys_status = (MAVLink.mavlink_sys_status_t)packet.data;
//get battery remaining
if (sys_status.battery_remaining < 15)
{
SetState(progressBar1, 2);
@ -200,11 +204,14 @@ namespace Client
progressBar1.Value = sys_status.battery_remaining;
}));
}
//get heartbeat packet
if (packet.msgid == (byte)MAVLink.MAVLINK_MSG_ID.HEARTBEAT)
{
var heartbeat = (MAVLink.mavlink_heartbeat_t)packet.data;
txt_vehicleType.Invoke(new Action(() =>
txt_vehicleType.Invoke(new Action(() => //access gui thread
{
//print information
txt_vehicleType.Text = ((MAVLink.MAV_TYPE)heartbeat.autopilot).ToString();
txt_autopilot.Text = ((MAVLink.MAV_AUTOPILOT)heartbeat.autopilot).ToString();
txt_baseMode.Text = ((MAVLink.MAV_MODE_FLAG)heartbeat.base_mode).ToString();
@ -261,10 +268,15 @@ namespace Client
private void client_Load(object sender, EventArgs e)
{
//init
//init gmap element
gmap.MapProvider = GMap.NET.MapProviders.GMapProviders.GoogleHybridMap;
GMaps.Instance.Mode = AccessMode.ServerOnly;
gmap.ShowCenter = true;
marker.IsVisible = false;
//init draw markers
markers.Markers.Add(marker);
gmap.Overlays.Add(markers);
}

BIN
tracking and telemetry/Client/bin/Debug/Client.exe

Binary file not shown.

BIN
tracking and telemetry/Client/bin/Debug/Client.pdb

Binary file not shown.

BIN
tracking and telemetry/Client/bin/Debug/MAVLink.dll

Binary file not shown.

BIN
tracking and telemetry/Client/bin/Debug/MAVLink.pdb

Binary file not shown.

3
tracking and telemetry/Client/obj/Debug/Client.csproj.FileListAbsolute.txt

@ -38,6 +38,5 @@ C:\Users\Giorgos Ger\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and te
C:\Users\Giorgos Ger\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Client\obj\Debug\Client.csproj.CopyComplete
C:\Users\Giorgos Ger\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Client\obj\Debug\Client.exe
C:\Users\Giorgos Ger\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Client\obj\Debug\Client.pdb
C:\Users\GeorgiosGerontakis\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Client\bin\Debug\GMap.NET.Core.dll
C:\Users\GeorgiosGerontakis\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Client\bin\Debug\GMap.NET.WindowsForms.dll
C:\Users\Giorgos Ger\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Client\obj\Debug\Client.add_module.resources
C:\Users\GeorgiosGerontakis\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Client\obj\Debug\Client.add_module.resources

BIN
tracking and telemetry/Client/obj/Debug/Client.csproj.GenerateResource.cache

Binary file not shown.

BIN
tracking and telemetry/Client/obj/Debug/Client.csprojAssemblyReference.cache

Binary file not shown.

BIN
tracking and telemetry/Client/obj/Debug/Client.exe

Binary file not shown.

BIN
tracking and telemetry/Client/obj/Debug/Client.pdb

Binary file not shown.

BIN
tracking and telemetry/Mavlink/bin/Debug/MAVLink.1.0.5.nupkg

Binary file not shown.

BIN
tracking and telemetry/Mavlink/bin/Debug/net35/MAVLink.dll

Binary file not shown.

BIN
tracking and telemetry/Mavlink/bin/Debug/net35/MAVLink.pdb

Binary file not shown.

BIN
tracking and telemetry/Mavlink/bin/Debug/net461/MAVLink.dll

Binary file not shown.

BIN
tracking and telemetry/Mavlink/bin/Debug/net461/MAVLink.pdb

Binary file not shown.

BIN
tracking and telemetry/Mavlink/bin/Debug/netstandard2.0/MAVLink.dll

Binary file not shown.

BIN
tracking and telemetry/Mavlink/bin/Debug/netstandard2.0/MAVLink.pdb

Binary file not shown.

6
tracking and telemetry/Mavlink/obj/Debug/MAVLink.1.0.5.nuspec

@ -16,8 +16,8 @@
</dependencies>
</metadata>
<files>
<file src="C:\Users\Giorgos Ger\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Mavlink\bin\Debug\net35\MAVLink.dll" target="lib\net35\MAVLink.dll" />
<file src="C:\Users\Giorgos Ger\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Mavlink\bin\Debug\net461\MAVLink.dll" target="lib\net461\MAVLink.dll" />
<file src="C:\Users\Giorgos Ger\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Mavlink\bin\Debug\netstandard2.0\MAVLink.dll" target="lib\netstandard2.0\MAVLink.dll" />
<file src="C:\Users\GeorgiosGerontakis\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Mavlink\bin\Debug\net35\MAVLink.dll" target="lib\net35\MAVLink.dll" />
<file src="C:\Users\GeorgiosGerontakis\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Mavlink\bin\Debug\net461\MAVLink.dll" target="lib\net461\MAVLink.dll" />
<file src="C:\Users\GeorgiosGerontakis\Desktop\Talos_Drones_Tracking_and_Telemetry\tracking and telemetry\Mavlink\bin\Debug\netstandard2.0\MAVLink.dll" target="lib\netstandard2.0\MAVLink.dll" />
</files>
</package>

BIN
tracking and telemetry/Mavlink/obj/Debug/net35/MAVLink.assets.cache

Binary file not shown.

BIN
tracking and telemetry/Mavlink/obj/Debug/net35/MAVLink.csprojAssemblyReference.cache

Binary file not shown.

BIN
tracking and telemetry/Mavlink/obj/Debug/net35/MAVLink.dll

Binary file not shown.

BIN
tracking and telemetry/Mavlink/obj/Debug/net35/MAVLink.pdb

Binary file not shown.

BIN
tracking and telemetry/Mavlink/obj/Debug/net461/MAVLink.assets.cache

Binary file not shown.

BIN
tracking and telemetry/Mavlink/obj/Debug/net461/MAVLink.csprojAssemblyReference.cache

Binary file not shown.

BIN
tracking and telemetry/Mavlink/obj/Debug/net461/MAVLink.dll

Binary file not shown.

BIN
tracking and telemetry/Mavlink/obj/Debug/net461/MAVLink.pdb

Binary file not shown.

BIN
tracking and telemetry/Mavlink/obj/Debug/netstandard2.0/MAVLink.assets.cache

Binary file not shown.

BIN
tracking and telemetry/Mavlink/obj/Debug/netstandard2.0/MAVLink.csprojAssemblyReference.cache

Binary file not shown.

BIN
tracking and telemetry/Mavlink/obj/Debug/netstandard2.0/MAVLink.dll

Binary file not shown.

BIN
tracking and telemetry/Mavlink/obj/Debug/netstandard2.0/MAVLink.pdb

Binary file not shown.

2
tracking and telemetry/Mavlink/obj/MAVLink.csproj.nuget.cache

@ -1,5 +1,5 @@
{
"version": 1,
"dgSpecHash": "Ag7lXZtqstH3xklYuTDl+YMeB0rg7JeJHg+s0sz+OCF4AU2HDCYiTkOcOpzkQQOf7ny4zGjQXB0BwUALr06mnQ==",
"dgSpecHash": "BMGtCCk4FceRPZQ8UoY4BK0IG5v3lF+DQNRO7D8QeSza51b62rEvJioVn3CMuEhqg306+1i2Bgfp7PzRxm1UJg==",
"success": true
}

23
tracking and telemetry/Mavlink/obj/MAVLink.csproj.nuget.dgspec.json

@ -1,24 +1,21 @@
{
"format": 1,
"restore": {
"C:\\Users\\Giorgos Ger\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj": {}
"C:\\Users\\GeorgiosGerontakis\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj": {}
},
"projects": {
"C:\\Users\\Giorgos Ger\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj": {
"C:\\Users\\GeorgiosGerontakis\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj": {
"version": "1.0.5",
"restore": {
"projectUniqueName": "C:\\Users\\Giorgos Ger\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj",
"projectUniqueName": "C:\\Users\\GeorgiosGerontakis\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj",
"projectName": "MAVLink",
"projectPath": "C:\\Users\\Giorgos Ger\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj",
"packagesPath": "C:\\Users\\Giorgos Ger\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Giorgos Ger\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\obj\\",
"projectPath": "C:\\Users\\GeorgiosGerontakis\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj",
"packagesPath": "C:\\Users\\GeorgiosGerontakis\\.nuget\\packages\\",
"outputPath": "C:\\Users\\GeorgiosGerontakis\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\obj\\",
"projectStyle": "PackageReference",
"crossTargeting": true,
"fallbackFolders": [
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\Giorgos Ger\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\GeorgiosGerontakis\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
@ -49,10 +46,10 @@
},
"frameworks": {
"net35": {
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.101\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.100\\RuntimeIdentifierGraph.json"
},
"net461": {
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.101\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.100\\RuntimeIdentifierGraph.json"
},
"netstandard2.0": {
"dependencies": {
@ -73,7 +70,7 @@
],
"assetTargetFallback": true,
"warn": true,
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.101\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.100\\RuntimeIdentifierGraph.json"
}
}
}

2
tracking and telemetry/Mavlink/obj/MAVLink.csproj.nuget.g.props

@ -5,7 +5,7 @@
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Giorgos Ger\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\GeorgiosGerontakis\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.4.0</NuGetToolVersion>
</PropertyGroup>

2
tracking and telemetry/Mavlink/obj/MAVLink.csproj.nuget.g.targets

@ -4,6 +4,6 @@
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ImportGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' AND '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
<Import Project="$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('$(NuGetPackageRoot)netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
</ImportGroup>
</Project>

22
tracking and telemetry/Mavlink/obj/project.assets.json

@ -183,24 +183,20 @@
]
},
"packageFolders": {
"C:\\Users\\Giorgos Ger\\.nuget\\packages\\": {},
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
"C:\\Users\\GeorgiosGerontakis\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.5",
"restore": {
"projectUniqueName": "C:\\Users\\Giorgos Ger\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj",
"projectUniqueName": "C:\\Users\\GeorgiosGerontakis\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj",
"projectName": "MAVLink",
"projectPath": "C:\\Users\\Giorgos Ger\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj",
"packagesPath": "C:\\Users\\Giorgos Ger\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Giorgos Ger\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\obj\\",
"projectPath": "C:\\Users\\GeorgiosGerontakis\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\MAVLink.csproj",
"packagesPath": "C:\\Users\\GeorgiosGerontakis\\.nuget\\packages\\",
"outputPath": "C:\\Users\\GeorgiosGerontakis\\Desktop\\Talos_Drones_Tracking_and_Telemetry\\tracking and telemetry\\Mavlink\\obj\\",
"projectStyle": "PackageReference",
"crossTargeting": true,
"fallbackFolders": [
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\Giorgos Ger\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\GeorgiosGerontakis\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
@ -231,10 +227,10 @@
},
"frameworks": {
"net35": {
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.101\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.100\\RuntimeIdentifierGraph.json"
},
"net461": {
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.101\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.100\\RuntimeIdentifierGraph.json"
},
"netstandard2.0": {
"dependencies": {
@ -255,7 +251,7 @@
],
"assetTargetFallback": true,
"warn": true,
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.101\\RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.100\\RuntimeIdentifierGraph.json"
}
}
}

21
tracking and telemetry/viewer/src/viewer.py

@ -5,29 +5,34 @@ import numpy as np
import sys
from sys import argv
#use: viewer.py module_ip client_ip
context = zmq.Context()
module_ip = str(sys.argv[1])
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(client_ip))
socket.connect("tcp://"+ module_ip +":4444") #listen for connections on port 4444
socket.send(str.encode(client_ip)) #send current ip to module
print("Waiting for module to connect back…")
footage_socket = context.socket(zmq.SUB)
footage_socket.bind("tcp://0.0.0.0:5555")
footage_socket.bind("tcp://0.0.0.0:5555") #listen for connections on port 5555
footage_socket.setsockopt_string(zmq.SUBSCRIBE, np.unicode(''))
print("Module connected!")
while True:
try:
frame = footage_socket.recv_string()
img = base64.b64decode(frame)
npimg = np.fromstring(img, dtype=np.uint8)
frame = footage_socket.recv_string() # recieve frame from module
img = base64.b64decode(frame) # base64 to string
#convert string to image
npimg = np.fromstring(img, dtype=np.uint8) #
source = cv2.imdecode(npimg, 1)
cv2.imshow("Stream", source)
cv2.waitKey(1)

Loading…
Cancel
Save