Skip to content
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

Merged
merged 5 commits into from Apr 30, 2024

Conversation

LeonHosch
Copy link

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


find_package(eCAL REQUIRED)

set(PROJECT_GROUP minimal)
Copy link
Contributor

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))
Copy link
Contributor

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)
Copy link
Contributor

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))
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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.

Copy link
Contributor

@hannemn hannemn left a 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.

@hannemn hannemn added the cherry-pick-to-NONE Don't cherry-pick these changes label Apr 22, 2024
@hannemn hannemn marked this pull request as ready for review April 22, 2024 07:13
@hannemn hannemn merged commit c0e3049 into eclipse-ecal:master Apr 30, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-to-NONE Don't cherry-pick these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants