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

rosserial_arduino: Serial port read failure

asked 2015-05-29 11:19:41 -0500

updated 2015-06-02 12:57:56 -0500

I am using Arduino Mega with maxbotix (three in number) sensors. I get the following error: Serial Port read returned short (expected 37 bytes, received 9 instead). [WARN] [WallTime: 1432915999.770362] Serial Port read failure

  1. I don't think it is an issue of what sensors type I am using.
  2. I compiled rosserial from source and also tried using the binary but the error remains.
  3. I also changed the (though advised against changing the source) but did not help.
  4. I added the line #include<wire.h> (someone suggested) but no positive results
  5. I have tried changing the baud rate and currently I am using 9600 but does not help.

Does anyone know what the issue is? Also, why despite the warning am I still able to get the data from ROS publisher?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2015-06-02 12:27:23 -0500

updated 2015-06-02 12:56:57 -0500

I also tried running the ultrasound example code in ros_lib. I still get the error. I am running my code at 57600 and 9600, it runs at both the baud rate. I am totally confused now, Can someone help?

edit flag offensive delete link more


difficult to say without any code to look at. You are using different sensors from the one in the example - do they operate in the same way with the same commands ?

nickw gravatar image nickw  ( 2015-06-02 13:38:23 -0500 )edit

Yes they operate exactly in the same way. The example is also written for maxbotix sensors.

I changed the timeout from 5 to 10 in, it has reduced the frequency of error by quite a lot.

jaghvi gravatar image jaghvi  ( 2015-06-02 14:55:18 -0500 )edit

I also changed the published bytes in node_handle.h to 1024 but that also did not help. I am running out of solutions now

jaghvi gravatar image jaghvi  ( 2015-06-03 13:57:25 -0500 )edit

Did you land up finding a solution to this?

miguel gravatar image miguel  ( 2015-07-26 05:32:24 -0500 )edit

Question Tools

1 follower


Asked: 2015-05-29 11:19:41 -0500

Seen: 818 times

Last updated: Jun 02 '15