-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support latched topics in udp bridge #33
Conversation
1082ec7
to
ef2ac16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the idea behind the message delimiter and the looping receive was that using that method larger messages than 65535 could be sent over the wire by splitting them into multiple udp packets.
This was never implemented on the sending side though :/
You could think about whether that is a useful property to have. If all relevant data packets including images are small enough then I agree that you won't need it.
udp_bridge/aes_helper.py
Outdated
return Fernet(key=self.encryption_key).encrypt(bytes(message, encoding="UTF-8")) | ||
return Fernet(key=self.encryption_key).encrypt(message) | ||
|
||
def decrypt(self, enc: bytes) -> str: | ||
if len(enc) == 0: | ||
raise ValueError("Cannot decrypt empty data") | ||
if self.encryption_key is None: | ||
return str(enc, encoding="UTF-8") | ||
|
||
return str(Fernet(key=self.encryption_key).decrypt(enc), encoding="UTF-8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I'm aware the official documentation says that bytes are used as input to encrypt and output of decrypt.
https://cryptography.io/en/latest/fernet/#cryptography.fernet.Fernet.encrypt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I forgot to update the type hints. message
is now bytes.
ef2ac16
to
f43c9ff
Compare
It would be nice to be able to do that, but the current state did not work for packets bigger than that size and even for packets smaller than that size, merging the packets did not actually work :/ (e.g. size 12000 bytes) |
Also, I am not sure if that can even work because packets might arrive in a different order. |
yes they might; using udp is always on a best-effort basis.
That might be because the sending side never actually did split the packets so they would just be chopped by the linux kernels udp handling. |
Btw. maybe we should use the standard ROS serializer, instead of pickle. This might have security and compatibility reasons. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments including running the auto formatter and addressing the logging
Summary
colcon build
Software
project board