Jufeng Wu
2 min readMay 28, 2021

--

Micro ROS with Arduino (ROS2+Arduino)

I recently buy an Arduino and want to connect Arduino with my program with ROS2. I found there are a lot of problems when setting it, so I write a blog to record it.

There are 2 ways I tried, first is ros2_arduino and second is micro_ros_arduino.

Because the ros2_arduino is dashing, and what I use is foxy, finally I was using the micro_ros_arduino.

My Arduino board is Due, I followed the tutorial and found there are some problems.

1. I can not build the code, some codes did not find in Arduino IDE.

The Root Cause -> I should follow the instruction "Patch SAMD" to add patch in Arduino

2. I should follow the instruction “Patch SAMD” to add patch in Arduino, it still not find?

The Root Cause ->I should change the file inside the folder “.arduino15” not in “Arduino”.

3. When I build it successfully, but I can not update to Arduino due?

The Root Cause -> I should use program port, not USB port

4. When I run Arduino, I can not hear it from Arduino?

The Root Cause -> I should launch micro-ROS agent by following cmd:

ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0 -v6

5. I can not hear it in ros2 tutorial codes, but I can see the topic?

The Root Cause -> The tutorial in micro_ros_arduino is Int32, not String.

Finally, it work! Hooray!

--

--