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

rosserial - Arduino DUE - sync issues

asked 2017-06-26 09:06:21 -0600

jesse gravatar image

updated 2017-06-29 08:34:21 -0600

I am trying to get an Arduino DUE to work with ROS Kinetic on my machine running Ubuntu 16.04 (using the DUE programming port, although I've tried the native one too). I seem to be having issues unique to the DUE as everything seems to work perfectly fine with the exact same cone with an Ardunio Uno.

When running the code:

rosrun rosserial_python serial_node.py /dev/ttyACM0

I get the following error message:

[ERROR] [1498484524.793356]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

Again using the exact same code uploaded to the Arduino Uno I do not get this error. I have tried a number of different baud rates (all from 9600 - 115200), where I found that the Uno gives the same error if it doesn't have the correct baud rate set, however, I continue to get the same message for the DUE regardless of the setting.

I have tried both my simple custom code as well as the example code provided with ros (e.g. pubsub), but have had not success. Further to force a specific baud rate I have including the following lines in setup (both individually, and alone):

nh.getHardware()->setBaud(115200);

Serial.begin(115200);

Using pyserial I can connect to the DUE unlike with ROS. It appears that others have been successful using the DUE based on other questions on here, however, nothing that I have found seems to resolve my issue.

Any ideas what might resolve the issue?

edit retag flag offensive close merge delete

Comments

I've tried pretty much everything suggested related to arduino sync issues included in this question too:

http://answers.ros.org/question/19620...

jesse gravatar image jesse  ( 2017-06-26 10:09:49 -0600 )edit

From rosserial/SerialClient.py (found at https://github.com/ros-drivers/rosser... ) line 432, it appears that the given Error is simply indicative of sync timing out.

jesse gravatar image jesse  ( 2017-06-26 11:45:16 -0600 )edit

Looking at https://github.com/ros-drivers/rosser... It appears that you need to add:

#define _SAM3XA_

however, this does not seem to work. There's also mention something about using:

#define USE_USB

which also does not work.

jesse gravatar image jesse  ( 2017-06-29 07:48:22 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
8

answered 2017-07-02 11:55:06 -0600

jesse gravatar image

I ended up finding several solutions, however, I would hope that a change to /rosserial_arduino/src/ArduinoHardware.h might make any work arounds necessary.

1 -- First solution that worked. In your version of ArduinoHardware.h in the Arduino Libraries directory change line 75 to read:

iostream = &Serial;

This works but will likely make use of other Arduino boards a problem (e.g. Leonardo)

2 -- Put the following code before including the ROS library

#define USE_USBCON

This also seems to work, however, it means that you'd have to add this in every case you use a DUE, which you might forget.

3 -- Modify the line 73 to read:

#if defined(USBCON) and !(defined(USE_USBCON)) and !(defined(_SAM3XA_))

Which I believe will resolve all previous issues, however, there might be another board released that also uses the SAM3X... processor and may be an issue in the future.

edit flag offensive delete link more

Comments

Thanks a lot. I solved this issue by using what you said. Thanks

Rakjoon gravatar image Rakjoon  ( 2017-09-20 08:56:50 -0600 )edit

very useful

quannv gravatar image quannv  ( 2018-04-04 05:10:33 -0600 )edit

Thanks! This finally fixed my problem, after many hours of searching and trying other solutions.

jakegoldsmith gravatar image jakegoldsmith  ( 2018-04-08 08:24:11 -0600 )edit

For me, this does not seem to work. Can you provide us with the full ArduinoHardware.h file? Tried all three suggestions, but none seem to work.

R Valk gravatar image R Valk  ( 2018-10-18 06:38:03 -0600 )edit

Thanks! This helps a lot, glad I've googled the issue with "DUE" keyword.

EwingKang gravatar image EwingKang  ( 2019-03-28 04:36:11 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2017-06-26 09:04:09 -0600

Seen: 3,895 times

Last updated: Jul 02 '17