rosserial kinetic [Error 5] Input/output error

asked 2018-12-23 10:45:18 -0500

WolfChen gravatar image

updated 2018-12-23 20:38:02 -0500

I sent a message from a moveit demo.launch (angles of the joints from sensor_msgs::JointState) which I created from moveit setup assistant to a .cpp file, and publish a converted value to my .ino file (arduino file).

The connection and subscriber/publisher worked fine when connected only an arduino board (I used arduino mega 2560 here, and chose the correct serial port and baud rate), but when I connected my servo motors to the arduino board, the connection was failed and showed me:

Run loop error: [Error 5] Input/output error

The error seemed cause by the connection of the servo. But I have run the ServoControl tutorial in rosserial.

Is there anyone can help me for this?

Is the requested voltage too big to be given?

This is my first time on ROS Answers, sorry for the bad typesetting.

Thanks, Wolf

Edited 1: error information

[WARN] [1545576797.165756]: Last read step: data checksum
[WARN] [1545576797.168735]: Run loop error: [Error 5] Input/output error
Traceback (most recent call last):
  File "/home/wolf/Mechanical_Practice/catkin_ws/src/rosserial/rosserial_python/nodes/", line 89, in <module>
  File "/home/wolf/Mechanical_Practice/catkin_ws/src/rosserial/rosserial_python/", line 554, in run
  File "/usr/lib/python2.7/dist-packages/serial/", line 532, in flushInput
  File "/usr/lib/python2.7/dist-packages/serial/", line 566, in reset_input_buffer
    termios.tcflush(self.fd, termios.TCIFLUSH)
termios.error: (5, 'Input/output error')
edit retag flag offensive close merge delete


Can you please update your question with a copy and paste of the entire error?

jayess gravatar image jayess  ( 2018-12-23 11:59:18 -0500 )edit

jayess: error updated.

BTW, how can you make your typesetting so clear?

WolfChen gravatar image WolfChen  ( 2018-12-23 18:09:18 -0500 )edit

If you're trying to run servos and the arduino mega off just the usb port of your computer then there probably isn't enough current. A computer's usb port can only provide 500mA, if the servo tries to draw more it will brown-out the arduino.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-12-23 19:25:21 -0500 )edit

@WolfChen Paste your formatted text into the text editor, highlight it, click on the 101010 button or press Ctrl-k.

jayess gravatar image jayess  ( 2018-12-23 19:30:23 -0500 )edit


That is one of my guess, too.

But I did run the ServoControl example with the same motor before, it worked fine...

So I am not sure if that would be the answer.

Btw, I connected another battery to the motor to supply the working current/voltage.

jayess: It works, lol! Thank

WolfChen gravatar image WolfChen  ( 2018-12-23 19:33:33 -0500 )edit