Pi Robot Meets Arduino

Arduino UnoOne of the key components of any robot is the onboard microcontroller or MCU (Micro Controller Unit).  The microcontroller typically interfaces directly with the robot's sensors (e.g. sonar and infrared), some number of servos (e.g. for controlling an arm), and ideally provides a means for controlling at least two drive motors and reading encoders.

Arguably the best known microcontroller among hobby robot builders is the Arduino.  The Arduino's hardware design is open source so that a number of clones are available which offer a variety of features for supporting different numbers of sensors, motor controllers, and communications protocols (e.g. XBee).

Basic ROS support for the Arduino exists in the form of the rosserial stack.  However, rosserial does not include support for controlling a differential drive robot with encoders.  (One of the authors of rosserial explained that the primary goal of the project was to provide support for reading inexpensive sensors and controlling servos but not to control an entire robot.)

To fill this gap, I used some of the Winter break to program a new ROS stack for the Arduino, called the ROS Arduino Bridge.  With the help of feedback from a number of members of our local robotics club (HBRC), the new stack seems to work well on a number of different hardware setups.  In particular, Pi Robot has swapped out his Element and ArbotiX controllers for an Arduino Mega 2560 R3 together with a Pololu motor controller and a Robogaia Encoder shield.  This hardware and the new code are stable enough to run the ROS Navigation stack and indeed, Pi passed the navigation endurance test with flying colors using his new hardware.

The same exact hardware is now being used on Pi's newest cousin, called Scout, who was built over the holidays to test the new code.  More about Scout in a later post.

The good news for both Pi and other robot builders, is that the ROS Arduino Bridge software provides an open source solution for robots running the open hardware Arduino platform--a combination that should provide some stability and a variety of choices well into the future.