Controlling a Robotic Marine Environmental Sampler with the Ruby Scripting Language

Abstract
The Environmental Sample Processor (ESP) is an autonomous robotic instrument developed at the Monterey Bay Research Aquarium Institute (MBARI) that operates below the ocean's surface, sampling raw seawater and executing a variety of sample manipulation and analytical protocols, in situ. It uses DNA and antibody probes to identify marine planktonic organisms and substances they produce. Initial prototypes of the ESP were hosted on an Intel i486 CPU running a commercial real-time operating system (OS). The application, coded in C++, included a custom ‘macro’ language interpreter to direct biochemical analyses. To achieve greater flexibility and minimize the development effort for the 2nd generation of the ESP (2G ESP), MBARI replaced its ‘macro’ language with a general purpose, open-source scripting language, selecting Ruby for its unique combination of a succinct, English-like syntax with a seamless underlying object-oriented paradigm. The 2G ESP application, aside from custom servo control firmware, is coded entirely in Ruby, hosted on a low-power ARM9 CPU running Linux. Servo control was distributed onto a network of dedicated microcontrollers to cope with the nondeterministic delays inherent in the Linux operating system and Ruby interpreter.