ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Connect two computers with RS-232 cable.

asked 2018-09-17 14:16:37 -0500

Spyros gravatar image

I am using Ubuntu 16.04 and ROS Kinetic. I want to connect a computer running ROS to another (without ROS) with a USB to serial connector (RS-232 cable), in order to send data (ex. send 3 decimals from a PC using ROS, and be able to see them in another's PC terminal). My research so far led me to install rosserial package, but I couldn't find any tutorial or sample code to see how exactly is going to work. I am new to ROS. Any suggestions or possible solutions would be appreciated.

edit retag flag offensive close merge delete



rosserial does not do what I believe you think it does.

It is a ROS-specific (and ROS-only) implementation of a ROS-like middleware transport over low-bandwidth connections. It does not make it easier to use serial ports with ROS nodes.

For that, look at serial fi.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-17 14:27:39 -0500 )edit

in this link you can see an example of rosserial

Hamid Didari gravatar image Hamid Didari  ( 2018-09-17 23:25:01 -0500 )edit

@hamid: the file you link is not part of rosserial, nor is it used in rosserial afaik?

It is part of the serial library though.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-18 02:12:42 -0500 )edit

@gvdhoorn I am not sure if I understand what you are saying. All I want to know is if it's possible to make that kind of communication using ROS, and if it is, how is that going to work? Does ROS has any package supporting USB to serial, RS-232 communication? If it does, where can I find an example?

Spyros gravatar image Spyros  ( 2018-09-18 11:03:36 -0500 )edit

@Spyros: I don't understand how this is a ROS-specific question. Do you want to exchange ROS msgs over a serial connection, or just raw bytes?

ROS does not need to support any serial to usb converter, your Linux OS needs to do that. It just so happens that the serial library provides some ..

gvdhoorn gravatar image gvdhoorn  ( 2018-09-18 15:18:18 -0500 )edit

.. convenience functions you can use to interact with a serial port under Linux.

Now if you want to send and receive ROS msgs across a serial link, thenrosserial would make sense.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-18 15:19:03 -0500 )edit

@gvdhoorn My ultimate goal is to connect a PIC18F4331 microcontroller with my ROS environment in order to send its input data (maybe with a ros node). I am trying to make the connection between the two PCs just to make sure the connection works ok, before I try anything with the microcontroller.

Spyros gravatar image Spyros  ( 2018-09-19 04:11:55 -0500 )edit

@Spyros I would recommend using a micro-controller which we know works out of the box, such as an arduino with the rosserial examples. You cannot use rosserial with two desktop PCs so it wont help you to prototype this.

Getting the simple arduino example working will give you a much better system to build from.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-08-23 03:40:01 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-08-23 02:03:47 -0500

nerellasureshkumar7 gravatar image

Hi, For testing ROS-PC to PC(non-ROS) communication, just write a ros node to send some garbage values to serial port and on the other side(non-ros) use hyper terminal like Docklight or some other and with that you can see the data which you are receiving via ros-pc. This link might helpful for serial communication.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-09-17 14:16:37 -0500

Seen: 470 times

Last updated: Aug 23 '19