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

rosserial_arduino error on terminal

asked 2013-07-18 02:51:54 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

When I write this command on terminal: rosrun rosserial_python serial_node.py /dev/ttyUSB0 but I change my port from USB0 to ACM0 as I work on ACM0

it appears to me that: [INFO] [WallTime: 1374151755.600608] ROS Serial Python Node [INFO] [WallTime: 1374151755.601022] Connecting to /dev/ttyACM0 at 57600 baud [ERROR] [WallTime: 1374151755.603582] Error opening serial: could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'

and I rum roscore in a new terminal

I am on groovy

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2013-07-18 07:43:23 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Your serial port doesn't exist. Are you sure your arduino is plugged in?

ls /dev/ttyACM* and ls /dev/ttyUSB* may help you find it.

edit flag offensive delete link more

Comments

I did what you told me but I have a new error: [INFO] [WallTime: 1374246906.900536] ROS Serial Python Node [INFO] [WallTime: 1374246906.901156] Connecting to /dev/ttyACM0 at 57600 baud [INFO] [WallTime: 1374246909.946657] Failed Packet Flags [ERROR] [WallTime: 1374246924.016878] Lost sync with d

ahmed.shamroukh gravatar image ahmed.shamroukh  ( 2013-07-19 05:17:18 -0500 )edit
-1

answered 2014-08-10 10:00:58 -0500

MKI gravatar image

updated 2014-08-11 16:07:11 -0500

Hi,

Try, Matching the baud rate of the ros node which you are running. Below are the instructions

cd <catkin_ws>/src/rosserial/rosserial_python/nodes

Edit: <Not recommended

  gedit serial_node.py

here find the line where your baud is set, and try changing it to match the baud rate of your device (which you can find it in the preferences.txt in your sketchbook )

baud = int(rospy.get_param('~baud','9600'))

save the file, exit

and run the below command

   ./serial_node.py _port:=/dev/ttyACM0

Edit: <Recommended

change baud rate using command line arguments ./serial_node.py _port:=/dev/ttyACM0 _baud:=9600

It does connect for a brief moment successfully and then it throws up an error for me, I'm using groovy on 12.04. Please Let me know if can find a way to stay connected for a longer time without getting disconnected. good luck.

Edit: The threads, here, and here looks similar to what I encountered. Also to be noted, No changing Default params, as pointed out by the moderator.

edit flag offensive delete link more

Comments

Please DO NOT recommend that users modify the source code for installed programs, particularly just to change the default parameters.

ahendrix gravatar image ahendrix  ( 2014-08-11 13:54:36 -0500 )edit

Point Noted! No changing default parameters. Thank you for pointing it out. would like to ask you, if you could kindly point me out to the best practices and methods?

MKI gravatar image MKI  ( 2014-08-11 15:14:13 -0500 )edit

Not modifying the source for software is a software engineering best practice; not specifically limited to ROS. It's something that I learned through a college education and industry experience. I don't have a good reference.

ahendrix gravatar image ahendrix  ( 2014-08-11 15:35:55 -0500 )edit

Note that instead of modifying the source code, you can simply pass the baud parameter to the serial node the same way you pass the port parameter:

./serial_node.py _port:=/dev/ttyACM0 _baud:=115200

ahendrix gravatar image ahendrix  ( 2014-08-11 15:36:54 -0500 )edit

Thank you again, I am relatively new to rosserial_arduino and I am looking for a solution to overcome similar problem as posted above. So again, If you have any Idea? kindly share. should I look for any particular commit from the github repo for rosserial_arduino?

MKI gravatar image MKI  ( 2014-08-11 15:47:27 -0500 )edit

You should ask a new question with a detailed description of your problem, rather than posting a bad answer to an old question.

ahendrix gravatar image ahendrix  ( 2014-08-11 16:28:14 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-07-18 02:51:54 -0500

Seen: 4,681 times

Last updated: Aug 11 '14