-
Notifications
You must be signed in to change notification settings - Fork 180
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
[Python] Added BinarySubscriber and BinaryPublisher with examples #1526
Conversation
|
||
find_package(eCAL REQUIRED) | ||
|
||
set(PROJECT_GROUP minimal) |
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.
PROJECT_GROUP should be "binary" here
while ecal_core.ok(): | ||
ret, msg, time = sub.receive(500) | ||
if ret > 0: | ||
print("Received: {} ms {}".format(time, msg)) |
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.
Embedding the binary into a regular doesn't look very pretty as non-printable characters will be escaped with leading backslashes which make it looks kind of messy . Maybe a hexadecimal representation would be better here such as "FF EE CC 1A".
|
||
find_package(eCAL REQUIRED) | ||
|
||
set(PROJECT_GROUP minimal) |
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.
PROJECT_GROUP is wrong
|
||
# eCAL receive callback | ||
def callback(topic_name, msg, time): | ||
print("Received: {} ms {}".format(time, msg)) |
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.
Same here with embedded binary data.
|
||
find_package(eCAL REQUIRED) | ||
|
||
set(PROJECT_GROUP minimal) |
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.
wrong PROJECT_GROUP
# send messages | ||
staticmsg = msg | ||
while ecal_core.ok(): | ||
pub.send(msg) |
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 first send iteration should already contain the random binary array.
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.
See comments, I attached to the source files.
Description
I added a BinarySubscriber and a BinaryPublisher class to the Python wheel. Now you can send binary data using Python
Related issues
Cherry-pick to