Ask Your Question

Can rosserial be used to communicate over xbee between a robot and a laptop

asked 2014-01-15 16:07:59 -0500

Troy gravatar image

updated 2014-01-28 17:19:03 -0500

ngrennan gravatar image

It seems that the rosserial package has been designed to allow remote sensors attached to smalled embedded/arduino devices to communicate with a pc running ros and act as ros nodes.

What I am putting together is a robot(an autonomous surface vessel) with ros hydro running on unbuntu installed on a pc104. I want to use an xbee to communicate from the robot to a laptop also running ros hydro to both send me some information on what is going on and also allow me to send messages (ie cmd_vel, so I can have manual control when needed).

Am I able to use this package to communicate over serial (through xbees) between 2 PC's both running full ROS installations? And if so, are there any examples out there?

I guess what I am after is are there any examples of a normal ros node(not running on arduino) sending/receiving data over an xbee using rosserial(preferably in python).

edit retag flag offensive close merge delete


I am having the same issue. There is no way to use rosserial with an Xbee attached directly to a computer if the Xbee is configured as an end node. It seems silly but appears to be a persistent issue, haven't been able to find a workaround.

BonOliver gravatar image BonOliver  ( 2018-04-03 19:47:50 -0500 )edit

I ended up writing some python modules to listen to published messages, package them up and broadcast them over the xbee. On my laptop I then had scripts to decode what the xbee heard and display it in a GUI. All code is here

Troy gravatar image Troy  ( 2018-04-03 22:02:15 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2014-01-15 21:13:40 -0500

davinci gravatar image

You can use two computers both with an arduino and a xbee to communicate with each other. You can look at It is probably also possible to use a serial link from the computer directly to the Xbee. Look at or

edit flag offensive delete link more


I don't have an arduino attached to the computers so I guess you answer is that rossserial cannot be used in that case. I have got communication directly over the xbees working using pyserial (so similar to what you suggested through your last link), so I will continue on that vein and write a node on the robot that subscribes to the messages I want to send over the xbee and converts and send them, and listens to the xbee and publishes relevant info back into the robot. Thaks.

Troy gravatar image Troy  ( 2014-01-16 09:15:47 -0500 )edit

This can be done using rosserial_xbee ( I've tested this using two series 1 pro xbees with an Arduino Mega on Hydro.

tonybaltovski gravatar image tonybaltovski  ( 2014-01-20 02:49:17 -0500 )edit

I was trying to do it without an arduino. Why should I need to put 2 arduino boards between my PC's. It would be nice if there was a package that allowed 2 PC's running ROS to directly communicate topics over xbee. In the end I just set up a node on the robot to communicate with the xbee over the serial port the topics that I was interested in, and then on the PC side wrote some python code and a QT interface to display it. That works, but it means I need to write new code for every extra topic I want to send between the robot and my laptop.

Troy gravatar image Troy  ( 2014-02-16 16:25:34 -0500 )edit

Is wifi not an option?

tonybaltovski gravatar image tonybaltovski  ( 2014-02-25 06:09:35 -0500 )edit

wifi range, especially over water is very limited

Troy gravatar image Troy  ( 2018-04-03 21:54:37 -0500 )edit

Troy, Can you share the code you wrote ?

tilak gravatar image tilak  ( 2019-01-12 23:52:37 -0500 )edit

Tiliak, as I mentioned in my comment, to code is on github( If you find it useful and use in in research it would be great if you could cite the paper I used in in ( ).

Troy gravatar image Troy  ( 2019-03-29 18:23:44 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2014-01-15 16:07:59 -0500

Seen: 1,772 times

Last updated: Jan 15 '14