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

Revision history [back]

click to hide/show revision 1
initial version

For others: this is how I used Capt_Crunch's fix on Ubuntu:

1) I followed the steps in How to Connect Arduino to ROS to try out a simple ROS node that toggles the Arduino LED. It all worked for me with an Arduino UNO. However, using my MKR-Zero the rosrun rosserial_python serial_node.py /dev/ttyS0 command failed to communicate with the node. (Note: my MKR Zero is at /dev/ttyACM0)

2) To find out where my ArduinoHardware.h file was I looked at the Arduino IDE "Sketchbook location:" in the under File->Preferences. In the "Sketchbook location:" dir I edited libraries/ros_lib/ArduinoHardware.h. To verify I had the right file I first added a line of code that obviously would not compile. When I tried to upload the toggle LED program the Arduino IDE verified the Python code but the upload (compile) failed. Then I removed the line and the upload worked.

3) To find Capt-Crunch's fix I looked in his repository https://github.com/MWahbahCC/ros_lib.git at his ArduinoHardware.h file. I found the code in the #if defined(SAMD21) section. Note: in that code it hardcodes the baud to 250000.

4) I added that section (plus the #endif) to my ArduinoHardware.h file changing the #if defined(SAMD21) to #if 1

5) I then uploaded the toggle LED node through the Arduino IDE and the rosrun rosserial_python serial_node.py /dev/ttyS0 _baud:=250000 worked

YMMV

(Additions keywords so google can point people to this: MKR MKRZero MKR-Zero Zero MKR1000 MKR-1000 MKR1010 MKR-1010 Cortex M0)

For others: this is how I used Capt_Crunch's fix on Ubuntu:

1) I followed the steps in How to Connect Arduino to ROS to try out a simple ROS node that toggles the Arduino LED. It all worked for me with an Arduino UNO. However, using my MKR-Zero the rosrun rosserial_python serial_node.py /dev/ttyS0 command failed to communicate with the node. (Note: my MKR Zero This is at /dev/ttyACM0)

the error message I got:

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

2) To find out where my ArduinoHardware.h file was I looked at the Arduino IDE "Sketchbook location:" in the under File->Preferences. In the "Sketchbook location:" dir I edited libraries/ros_lib/ArduinoHardware.h. To verify I had the right file I first added a line of code that obviously would not compile. When I tried to upload the toggle LED program the Arduino IDE verified the Python code but the upload (compile) (compile phase) failed. Then I removed the line and the upload worked.

3) To find Capt-Crunch's fix I looked in his repository https://github.com/MWahbahCC/ros_lib.git at his ArduinoHardware.h file. I found the code in the #if defined(SAMD21) section. Note: in that code it hardcodes the baud to 250000.

4) I added that section (plus the #endif) to my ArduinoHardware.h file changing the #if defined(SAMD21) to #if 1

5) I then uploaded the toggle LED node through the Arduino IDE and the rosrun rosserial_python serial_node.py /dev/ttyS0 _baud:=250000 worked

YMMV

(Additions keywords so google can point people to this: MKR MKRZero MKR-Zero Zero MKR1000 MKR-1000 MKR1010 MKR-1010 Cortex M0)