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

implement ROS-TCP-ENDPOINT with C++ #172

Open
ketewang opened this issue Mar 16, 2024 · 4 comments
Open

implement ROS-TCP-ENDPOINT with C++ #172

ketewang opened this issue Mar 16, 2024 · 4 comments

Comments

@ketewang
Copy link

I'm trying to rewrite this module with C++ as this python project runs with high and unsteady cpu resource. have you ever considered this thought before? It looks like I'm facing the problem of dynamically deserialize ros2 msg or srv class. Any good suggestion for this? thanks.

@sebastieninria
Copy link

I just made a C++ implementation of the Endpoint for ROS2. I plan to make it available quite soon, as soon as i've cleaned the code. It's currently written for Windows but would be easily ported to any Posix system just by replacing the WinSocks with standard sockets.

@ketewang
Copy link
Author

I have finished using C++ to rewrite the endpoint in April, and it works with extremely low cpu usage like 1% in C++ while 60% in python running the same demon code.
I also conducted a pressure test running 200 topics with 1 publisher and 1 subscriber for each topic, publish frequency is about 100Hz. The CPU usage is about 6%(16 cores).

@Hydran00
Copy link

Hi @ketewang, would you mind making the C++ code open source?
Using the python endpoint with high bandwidth topics (like point clouds or FHD images) is not feasible, I would be happy to contribute to the C++ version.

@sebastieninria
Copy link

For anyone who may need it, our C++ implementation of the ROS-TCP-Endpoint node is available here : https://github.com/IH2A/ROS-TCP-Endpoint/blob/ros2-cpp/README_CPP.md
It's a fork of this repository in which i added a ros2-cpp branch which contains the C++ implementation based on the main-ros2 branch.
As i said, it's written for Windows systems because of the WinSock2 socket library, but it shall be quite easily ported to any Posix system without many changes since the socket paradigm is the same as Berkeley sockets.

For the tests i've made so far, it shows improved performances and much better stability than the python version. Publishers, Subscribers, ROS services and Unity services are available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants