#!/bin/sh # # # PATH=${PATH}:.:/tmp # edit this: serial port of the roomba PORT="/dev/usb/tts/0" # edit this: path to roombacmd.mpl ROOMBACMD="/tmp/roombacmd" # edit this: where the webcam is writing an image PICPATH="/tmp/SpcaPic.jpg" # edit this: where archived ("snapshot") images should be stored SNAPPATH="/mydisk/archive/cam-`date -Is`" me="$SCRIPT_NAME" cmd="$QUERY_STRING" cat < Roomba Control Panel

Roomba Control Panel

init sensors spy
   
  forward  
spinleft stop spinright
  backward  
   
    snapshot
EOF

echo -n "Date: "; date

if [ "$cmd" ] ; then
    echo "cmd: $cmd"
    if [ "$cmd" = "snapshot" ] ; then
        echo "saving image and sensors to $SNAPPATH!"
        cp $PICPATH "$SNAPPATH.jpg"
        $ROOMBACMD -p $PORT --sensors-raw > "$SNAPPATH-sensors.txt"
    else
        $ROOMBACMD -p $PORT --$CMD
    fi
fi

cat <


EOF