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

ros servo control arduino fails

asked 2016-01-31 15:51:34 -0500

jcardenasc93 gravatar image

I want to get the control of a servo under ROS, for that I am using arduino UNO, following this tutorial. When I run the rosserial_python at the moment when I publish the angle I got this error:

Traceback (most recent call last):

 File "/home/jcardenasc93/catkin_ws/src/rosserial/rosserial_python/nodes/", line 82, in <module>

File "/home/jcardenasc93/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/", line 495, in run
  File "/home/jcardenasc93/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/", line 392, in requestTopics
  File "/usr/lib/python2.7/dist-packages/serial/", line 500, in flushInput
    termios.tcflush(self.fd, TERMIOS.TCIFLUSH)
termios.error: (5, 'Input/output error')

Could anyone help me please? I don't understand why this is happening

edit retag flag offensive close merge delete


does your user have permission to access the serial port?

did you try specifying the port to use?

rosrun rosserial_python /dev/ttyUSB0


rosrun rosserial_python /dev/ttyACM0

Gary Servin gravatar image Gary Servin  ( 2016-02-01 12:14:15 -0500 )edit

Yes @gary-servin I changed the permission with chmod and at the moment to run the rosserial_python I gave the port parameter (in my case /dev/ttyACM0). At the beginning it looks like works, but when the servo begin to move the node crashes.

jcardenasc93 gravatar image jcardenasc93  ( 2016-02-01 22:48:10 -0500 )edit

can you try disconnecting the servos and running the serial node again? If it works without the servo, then it should be a problem related with the power supply, the regulator on the arduino can't provide enough current to the servo and it resets the arduino when you try to move the motor

Gary Servin gravatar image Gary Servin  ( 2016-02-02 07:28:43 -0500 )edit

Many thanks that was the problem there isn't enough current. With an external power supply it works fine

jcardenasc93 gravatar image jcardenasc93  ( 2016-02-10 19:10:13 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-02-10 19:13:19 -0500

jcardenasc93 gravatar image

The problem as @gary-servin said below it was for insufficient current. That solves with an external power supply.

edit flag offensive delete link more


external power supply for arduino or motor?

adelleodel gravatar image adelleodel  ( 2016-05-26 09:07:25 -0500 )edit

I had the same problem and it was an excess of demanded current from the servo, thanks for the solution

NeoM gravatar image NeoM  ( 2018-10-22 12:20:00 -0500 )edit

Question Tools


Asked: 2016-01-31 15:51:34 -0500

Seen: 643 times

Last updated: Feb 10 '16