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

A problem with a sensor packet.

asked 2012-08-14 05:50:26 -0500

Vasiliy Pankratov gravatar image

updated 2012-08-14 05:57:49 -0500


Could you help us to resolve the strange problem?

We built TurtleBot baced on IRobot Roomba 500. We did some changes in «» for using Roomba. Such as in the «init_params» method:

self.robot_type = rospy.get_param('~robot_type', 'roomba')
self.has_gyro = rospy.get_param('~has_gyro', False)

And in the «reconfigure» method we commented an updating of the «has_gyro» field:

#self.has_gyro = config['has_gyro']

However for the serial communication we decided to use Arduino. So we plugged Roomba to Arduino via MiniDIN cable according to Roomba Open Interface. We also pluggud Arduino to NetBook via USB-cable. We uploaded following sketch on Arduino:

#include <SoftwareSerial.h>

SoftwareSerial myserial(10, 11);

void setup() {

void loop() {
    if(Serial.available() > 0) {
    if(myserial.available() > 0) {

So Arduino is just retransmitting data from CPU to Roomba and vice versa. Also we did some changes for it. Such as in «» we changed default port (because Arduio works on ttyACM0 port):

__init__(self, default_port='/dev/ttyACM0', default_update_rate=30.0)

We just decided to change it in the constructor, because there is no redifinitionining of it when this object initializes.

That's it. It worked perfectly. We even ran «follower» node.

But one day something happened with our TurtleBot. It crashes with the following error:

Failed to contact device with error: [Distance, angle displacement too big, invalid readings from robot. Distance: 5.42, Angle: -46.11]. Please check that the Create is powered on and that the connector is plugged into the Create.

We tested different NetBooks, different ROSes (electric and fuerte), different Roombas, different Ubuntus (12.04 and 11.10), different cables, different bauds (19200 and 57600), different Arduinos at least. We've read every string of the code. But we can't find where is the problem. Roomba periodically is sending noise in sensor packet. Maybe the problem with delay between requsting sensors data and reading it? Could you please help us.

By the way, when we are sending two bytes (142 and 100) on Roomba, it returns 63 bytes of sensor packet instead of expected 80.

Thank you!

edit retag flag offensive close merge delete


I don't have an answer for your question, just a note: you shouldn't comment out or change source code in if not necessary. All the parameters you wanted to change can be changed using ros parameters and that's what you should use.

Lorenz gravatar imageLorenz ( 2012-08-14 06:46:37 -0500 )edit

Thank you, Lorenz. I didn't think about it. I'll try to use rosparams.

Vasiliy Pankratov gravatar imageVasiliy Pankratov ( 2012-08-14 07:08:32 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2012-08-17 22:33:04 -0500

Vasiliy Pankratov gravatar image

updated 2012-08-17 22:37:33 -0500

We've resolved this problem. We just rejected Arduino from our scheme and now it's work. Now data is transmitting on the roomba directly from CPU through the ftdi.

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: 2012-08-14 05:50:26 -0500

Seen: 687 times

Last updated: Aug 14 '12