ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to establish a TCP connection

asked 2016-12-21 11:28:50 -0500

Cayero gravatar image

updated 2016-12-21 11:30:52 -0500

I need to implement something that could send data from a not-ROS-running System(A) to a ROS-running System(Z) and later sending data from Z back to A using a TCP connection (using socket). I was looking for something on that page http://wiki.ros.org/ROS/TCPROS but it is not clear for me. Are there any tutorials/codes to launch a server on a ROS-running System and listening for clients? Are there any packages that allow to implement TCP communication?

edit retag flag offensive close merge delete

Comments

Hello, did you solve your problem? Now i have the same Problem. I really want to know what you have done. And i can not run the code from https://github.com/abhinavjain241/com... in ROS. I look forward to your answer.

bluesnow gravatar image bluesnow  ( 2019-04-26 08:53:05 -0500 )edit

This is already answered. However, I would like to add my words here. The comment above refers to a code that creates and manages a socket all by itself. It would be better to do this low-level task by an external library. For example, ZeroMQ is a robust and famous library with bindings in many languages. Please feel free to check out ros_zeromq_tutorial.

ravijoshi gravatar image ravijoshi  ( 2022-08-09 22:35:10 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-12-21 12:46:43 -0500

ahendrix gravatar image

ROSTCP is an adapter that lets ROS send messages over TCP for topics; not for general use.

If you want a TCP socket, use the standard OS interface for creating a TCP socket.

There are many good tutorials about this online; here are a few:

edit flag offensive delete link more

Comments

Thank you for your answer, I'll on that. I found some helpful code. But client_node cannot connect to the server. https://github.com/abhinavjain241/com...

Cayero gravatar image Cayero  ( 2016-12-21 13:26:37 -0500 )edit

I'm not familiar with that project, and I can't help you with it. I'd recommend that you ask a new question or open an issue on that repository. For either, I recommend that you include the specifics of your issue such as the exact commands and exact output.

ahendrix gravatar image ahendrix  ( 2016-12-26 12:51:29 -0500 )edit
0

answered 2022-08-09 13:33:35 -0500

akumar3.1428 gravatar image

updated 2022-08-09 13:34:35 -0500

I would like to suggest that you can use the following GitHub that can help you Link - https://github.com/adnanademovic/rosrust for using rust , however, there are different crates for different languages like roslibpy for python

edit flag offensive delete link more

Comments

Please explain how your answer is at all related to the above question. This looks very much like spam to me.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-08-09 18:58:40 -0500 )edit

Greetings I was using ROS Neotic, initially using the example code from GitHub I was able to publish some data to ROS and also subscribe from it using the rust language. We can also use rospylib - https://roslibpy.readthedocs.io/en/la... if we are using python. Different languages have different ROS Bridge libraries that can attain the respective task of transmission data. I hope I am more clear now

akumar3.1428 gravatar image akumar3.1428  ( 2022-08-09 19:08:15 -0500 )edit

Thank you for the clarification.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-08-09 19:14:14 -0500 )edit

Now the problem is that I can do it when ROS bridge and Publisher are working on the same machine, however when I am trying to run ROS on my laptop and publish data to it from raspberry pi I am not able to do it, do you have any suggestions ?

akumar3.1428 gravatar image akumar3.1428  ( 2022-08-09 19:16:37 -0500 )edit

Don't hijack someone else's question. Instead, you should create a new question of your own. In your description, include a url back to this one if you think it helps explain your issue.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-08-10 07:05:07 -0500 )edit

I am sorry about it I am new to ROS community

akumar3.1428 gravatar image akumar3.1428  ( 2022-08-10 07:35:42 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2016-12-21 11:28:50 -0500

Seen: 4,799 times

Last updated: Aug 09 '22