ros servo control arduino fails
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
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
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.
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
Many thanks that was the problem there isn't enough current. With an external power supply it works fine