-
Notifications
You must be signed in to change notification settings - Fork 0
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
Compare with python & C++ image folder publishing #3
Comments
Make a version of the image_folder_pub that publishes using zenoh |
Update all the dependencies, especially -> That seemed to do the trick, now it takes about the same amount of cpu as the python and C++ nodes |
This converts a It is received successfully by https://github.com/lucasw/ros_one2z/blob/main/ros1_example_pkg/scripts/zenoh_image_to_contour.py (too many zenoh experiments scattered across too many repos, I know) But using rosrust I added the bytes and have the right length, but it's not working
-> encode_vec may be completely wrong, look more in rosrust to see how messages are encoded The message starts in api/raii.rs Publisher send() and gets passed into LossySender try_send |
header + rosrust encode_vec():
An 8x8 white image encoded with ros python, secs set to 1 and nsecs to 2, frame_id is "":
the different parts:
So the header is already there with the [233, 0, 0, 0], don't need to add one, but with reversed endianness- where in the rosrust code is the endianness reversed- probably in the network send, it looks like the Also did I remove the need for the header elsewhere (e.g. in the zenoh to mcap scripts?)- no there's just no parity with the encode_vec vs. the python and c++ serialization- thoughs defer that header until the tcp send. Probably will just remove the header from encode_vec in my rosrust fork. |
45% cpu
vs.
https://github.com/lucasw/image_manip/blob/master/image_manip/scripts/image_folder_publisher.py
25% cpu
The python script loads each image with imread fresh and converts to a ros image every single publish.
And now a C++ version:
https://github.com/lucasw/image_manip/blob/fix_zero_frame_rate/image_manip/src/image_folder_publisher_node.cpp
It is also around 25% cpu (should see if it is lower latency later)
Why is it faster- and where is it faster? The image loading library and the pixels to Image message are places to look, but rosrust itself is the big one.
Zenoh docs mention wanting to refactor RT rosrust to speed it up
The text was updated successfully, but these errors were encountered: