Robotics StackExchange | Archived questions

Connect two computers with RS-232 cable.

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.

Asked by Spyros on 2018-09-17 14:16:37 UTC

Comments

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.

Asked by gvdhoorn on 2018-09-17 14:27:39 UTC

in this link you can see an example of rosserial

Asked by Hamid Didari on 2018-09-17 23:25:01 UTC

@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.

Asked by gvdhoorn on 2018-09-18 02:12:42 UTC

@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?

Asked by Spyros on 2018-09-18 11:03:36 UTC

@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 ..

Asked by gvdhoorn on 2018-09-18 15:18:18 UTC

.. 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, then rosserial would make sense.

Asked by gvdhoorn on 2018-09-18 15:19:03 UTC

@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.

Asked by Spyros on 2018-09-19 04:11:55 UTC

@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.

Asked by PeteBlackerThe3rd on 2019-08-23 03:40:01 UTC

Answers

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 https://www.teuniz.net/RS-232/ for serial communication.

Asked by nerellasureshkumar7 on 2019-08-23 02:03:47 UTC

Comments