-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync issues with rosserial and Arduino #125
Comments
Hi @aakarm, I haven't used the DUE myself, but I suspect that the If you get it working, please let us know how; I'd happily merge a change to |
@mikepurvis, I ran into this with the Leonardo on Indigo. No, unfortunately, specifying I found this post that suggested using I also tried |
Hi, anyone has solved this issue? I have the same problem but using ROS Kinetic. NOTE: I tested the Arduino Leonardo with the publisher-subscriber example. |
I don't think there's anything rosserial can do about this. In my experience, it's usually a problem with the Arduino running out of memory, or trying to send a message that's larger than the Arduino's serial buffer. If your Arduino sketch takes over 80% of memory, or you're sending a message like IMU, Odometry, or TF, that's probably the cause. |
@chrisspen I tried increasing the serial buffer but the problem continues... |
No. I tried sending sensor_msgs/LaserScan and a partial message was sent (4-5 out of 90 array points). Also, I experience this syncing issue when I do not change anything code-wise, just by disconnecting and reconnecting again. Please help! |
FYI, if you suspect size of messages is your issue and you’re using IMU, Odom, TF, etc., then you might want to checkout https://github.com/ecostech/rosproxy <https://github.com/ecostech/rosproxy>. It essentially compresses the messages sent over the serial link by getting rid of unused or redundant data on the arduino side and then expands the messages again on the server side. Hope this helps.
… On Apr 10, 2017, at 7:19 AM, Chris Spencer ***@***.***> wrote:
I don't think there's anything rosserial can do about this. In my experience, it's usually a problem with the Arduino running out of memory, or trying to send a message that's larger than the Arduino's serial buffer. If your Arduino sketch takes over 80% of memory, or you're sending a message like IMU, Odometry, or TF, that's probably the cause.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#125 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AK41mapTXf3JMwBRhN-u7OxLxJu8lO5iks5ruixcgaJpZM4CAJFE>.
|
I used |
In my experience, any Arduino with less than 40KB of memory (e.g. Uno, Leo, etc) will not work with Rosserial, as the relatively large packet sizes overwhelm the Arduino's memory, and cause the "Unable to sync with device". The hacks to increase the USB serial buffer have no effect, because those changes can't magically create more flash. You can allocate all your flash to the buffer, but eventually some queued odom packets will be too big to fit in it. The real obnoxious thing about this error is that the Arduino will appear to work for a short while...until it receives or has to send a packet that's a little too large, making it very difficult to diagnose. I banged my head against this error for months before I tested my code with an Arduino Mega and an Arduino Uno Pro, which have +100KB of flash, and found those worked perfectly. I'd recommend the Arduino memory limited be mentioned in the docs, as it seems like many many people have run into this problem, and the current docs imply all Arduinos should work equally well with rosserial. |
One thing you can do with an arduino is to lower the buffer size, which will limit the max length of the message by doing something like:
This limits each message to be 150 bytes and 1 sub/pub only. See http://wiki.ros.org/rosserial#Maximum_Size_of_a_Message.2C_Maximum_Number_of_Publishers.2BAC8-Subscribers for details. One thing that would be interesting to find out is how much space a message takes, then if you only use a particular message, you can optimize significantly. |
Hello All,
But still get error.
but still get no solution. I have searched a lot on different blogs and come to know that nav_msgs/Odometry message is quite a big which can be solved by reducing publish rate or choose message with small size. Please someone guide me through this problem Thank you |
Hi. I know it has been a while. I have the same issue. Have you found a fix so far? |
Hey all,
I know this question has been put up a few times earlier, but I haven't been able to find a solution to it yet. I have been getting the error "Unable to sync with device" when I run the rosserial node.
I have noticed till the time I have a simple code with no function calls, the device sync is not an issue. But when I call a few functions from the Loop(), the syncing with the device is an issue.
Reading other posts, I found that reusing spinOnce() again and again over a small interval of time is required. I have tried that too throughout my code. It still gives me an error. That solution worked for me only when I was getting the issue of "Lost sync with Device". In this case I think the device is not getting connected at all. I don't know if I am missing some posts online which have already clarified this issue.
I cloned the rosserial library for Groovy about a week ago and I am using an Arduino DUE.
Any help on this topic would be really great. Thank you!
The text was updated successfully, but these errors were encountered: