Demo Perl Scripts (Dafydd Walters)
Obstacle Avoidance, Detecting and Greeting People
Here are a couple of Perl scripts that can be installed on a bare OAP robot to make it drive around autonomously, avoiding obstacles, occasionally stopping, panning the human body-heat sensor, and then greeting any humans found. This was my "exhibition mode" for the OAP Reference Design at the Seattle Robotics Society 2003 Robothon.These scripts are actually rather kludgy, and were quickly hacked out in my hotel room on the night before the Robothon; I'm not exactly proud of this code, but if you're looking for something to quickly test your OAP droid before writing "serious" code, it might suit your needs.
Dependencies
These scripts rely entirely on the OAP command-line utilities to drive the robot and take sensor readings (note, however, that those command-line utilities were never really intended to be any kind of programming interface to drive the robot - merely builders tools for testing the operation of the modules).Source Code
These scripts are intended to be installed and run from the /root directory, and run under root privileges.This code is provided as-is, without warranty, and may be used for any purpose.
Running the Scripts
For these scripts to work properly, the following are required:-
The OAP droid must be configured the same as the prototype,
-
* The perimiter sonar sensors mounted in the configuration described on the
prototype page (in particular, note the sonar firing sequence numbers, just over a third the way down the page),
-
* The Festival speech synthesiser needs to be installed as described on the prototype page.
The first script, avoid.pl, is the main program; this is the script you must launch. It, in turn, calls the script greeting.pl occasionally to detect and speak to humans.
Links
CategoryCode