Ask Your Question

Revision history [back]

Same problem here. If anyone has success, please share!

(I use the tutorial code as is; and it has no Serial.begin(). Thanks anyway for the suggestion!)

My hardware is the Arduino "MKR Zero", and the software environment is ROS Kinetic on Ubuntu 16.04LTS.

I, also, have demonstrated the tutorial code with the Arduino Uno as well as other Arduino variants. Of course, it is not strictly true that the Zero has "the same architecture" as the Uno. For example, you realize that the Arduino IDE must be -- and mine has been -- updated to handle the new "board type."

FWIW: I have other ROS 'sketches' which do run on the Uno, all of which fail on the Zero (with the same error type). I bought the Zero because the Uno's RAM was inadequate for any but the most trivial ROS functionality.

EDIT: I may have found it?

I find that the MKR Zero is expecting to communicate with ROS on its Serial1 object, which is exposed on Pins 13/14, rather than the Serial object exposed on the onboard USB connector. And, when I connect a USB/TTL cable to those pins, and launch with _port:=/dev/USB0, the demo code works as intended.

In troubleshooting, I looked at the library code in ros_lib/ArduinoHardware.h and added Serial.print() statements to my code to see which compiler directives are being executed. It appears that USBCON is #define'd and USE_USBCON is not. This logical combination compiles the statement "iostream=&Serial1". The resulting behavior is as I describe above.

= = = = This (below) was my previous answer = = = = Same problem here. If anyone has success, please share!

(I use the tutorial code as is; and it has no Serial.begin(). Thanks anyway for the suggestion!)

My hardware is the Arduino "MKR Zero", and the software environment is ROS Kinetic on Ubuntu 16.04LTS.

I, also, have demonstrated the tutorial code with the Arduino Uno as well as other Arduino variants. Of course, it is not strictly true that the Zero has "the same architecture" as the Uno. For example, you realize that the Arduino IDE must be -- and mine has been -- updated to handle the new "board type."

FWIW: I have other ROS 'sketches' which do run on the Uno, all of which fail on the Zero (with the same error type). I bought the Zero because the Uno's RAM was inadequate for any but the most trivial ROS functionality.