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

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 serial_node.py 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/serial_node.py", line 82, in <module>
    client.run()



File "/home/jcardenasc93/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/SerialClient.py", line 495, in run
    self.requestTopics()
  File "/home/jcardenasc93/catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/SerialClient.py", line 392, in requestTopics
    self.port.flushInput()
  File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", 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

Comments

does your user have permission to access the serial port?

did you try specifying the port to use?

rosrun rosserial_python serial_node.py /dev/ttyUSB0

or

rosrun rosserial_python serial_node.py /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 serial_node.py 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
1

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

Comments

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

Stats

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

Seen: 667 times

Last updated: Feb 10 '16