-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from robocin/add_protobuf
feat(Protobuf): creates protobuf packets, protobuf files generator and paths include in cmake, receiver code for tests,
- Loading branch information
Showing
20 changed files
with
154,035 additions
and
153,648 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
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ src/Utils/dest.txt | |
build/ | ||
bin/ | ||
*avi | ||
.cache/ | ||
|
||
#All logging files (including rotative) | ||
src/Log/* | ||
|
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import socket | ||
import struct | ||
from time import time | ||
import wrapper_pb2 as wr | ||
|
||
class FiraClient: | ||
|
||
def __init__(self, | ||
vision_ip="224.5.23.2", | ||
vision_port=10015): | ||
""" | ||
Init SSLClient object. | ||
Extended description of function. | ||
Parameters | ||
---------- | ||
vision_ip : str | ||
Multicast Vision IP in format '255.255.255.255'. | ||
vision_port : int | ||
Vision Port up to 1024. | ||
""" | ||
|
||
self.vision_ip = vision_ip | ||
self.vision_port = vision_port | ||
|
||
self.vision_sock = socket.socket( | ||
socket.AF_INET, socket.SOCK_DGRAM) | ||
self.vision_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | ||
self.vision_sock.setsockopt(socket.IPPROTO_IP, | ||
socket.IP_MULTICAST_TTL, 128) | ||
self.vision_sock.setsockopt(socket.IPPROTO_IP, | ||
socket.IP_MULTICAST_LOOP, 1) | ||
self.vision_sock.bind((self.vision_ip, self.vision_port)) | ||
|
||
# self.vision_sock.setblocking(True) | ||
self.frame = None | ||
self.det_frame = None | ||
|
||
def receive_frame(self): | ||
"""Receive package and decode.""" | ||
data = None | ||
while True: | ||
try: | ||
data, _ = self.vision_sock.recvfrom(1024) | ||
except Exception as e: | ||
print(e) | ||
if data != None: | ||
break | ||
|
||
if data != None: | ||
decoded_data = wr.SSL_WrapperPacket().FromString(data) | ||
print(decoded_data) | ||
# return self.frame, self.det_frame | ||
|
||
a = FiraClient() | ||
while(1): | ||
a.receive_frame() | ||
|
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.