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

A problem with a sensor packet.

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

Vasiliy Pankratov gravatar image

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

Hello.

Could you help us to resolve the strange problem?

We built TurtleBot baced on IRobot Roomba 500. We did some changes in «turtlebot_node.py» 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() {
    Serial.begin(57600);
    myserial.begin(57600);
}

void loop() {
    if(Serial.available() > 0) {
        myserial.write(Serial.read());
    }
    if(myserial.available() > 0) {
        Serial.write(myserial.read());
    }
}

So Arduino is just retransmitting data from CPU to Roomba and vice versa. Also we did some changes for it. Such as in «turtlebot_node.py» 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

Comments

I don't have an answer for your question, just a note: you shouldn't comment out or change source code in turtlebot_node.py 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 image Lorenz  ( 2012-08-14 06:46:37 -0600 )edit

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

Vasiliy Pankratov gravatar image Vasiliy Pankratov  ( 2012-08-14 07:08:32 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

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

Vasiliy Pankratov gravatar image

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

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

Question Tools

Stats

Asked: 2012-08-14 05:50:26 -0600

Seen: 839 times

Last updated: Aug 14 '12