CS 23 Software Design and Implementation

How to - sanity check for the bot

The following notes list how to test your robot is working fine. The notes cover the case were you can and cannot shh into the machine directly. We provide two binaries for you: the robot side ./cs23Garcia and computer side ./portal. These binaries allow you to check that the robot is working fine as a baseline - as a sanity check. If the baseline code works then your development code should work - assumming no bugs.

Steps for sanity check of your robot

1) Switch on the robot, and wait till the light on the wireless card is solid green. The robot is on the wireless network now.

2) Try to ssh into your robot. If you can ssh to the robot goto step 9 below else carry on at 3 (Check the purple light on the gumstix board; that light corresponds to the wifi card).

Start here: if you can’t ssh directly into your bot

3) Connect the serial port of you machine to the serial port of the Garcia.

4) Type minicom on the command window of your machine. This should set up the serial port for communicating with the robot, and prompt for a login.

5) Login to the robot with login name: root and password: gumstix. Once you log in, you should have a command shell on the robot; Run the script fix_wifi.sh (create this script on your robot if you haven't already done so), if you see it pinging successfully an outside CS server, then your wifi is fixed, proceed to 9; otherwise: Check the content of /etc/network/interfaces, make sure following are the only uncommented blocks of code

#

auto lo
iface lo inet loopback

#

auto eth0
iface eth0 inet dhcp

#

auto wlan0
iface wlan0 inet dhcp
        pre-up /sbin/iwconfig $IFACE mode managed
        pre-up /sbin/iwconfig $IFACE essid "Dartmouth Registered"

#

6) issue the command ifconfig wlan0. If you do NOT get something like

wlan0     Link encap:Ethernet  HWaddr 00:0B:6B:0D:B9:8E  
          inet addr:129.170.210.192  Bcast:129.170.210.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5436 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1896 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:973096 (950.2 KiB)  TX bytes:478507 (467.2 KiB)
          Interrupt:128 
then issue /etc/init.d/networking stop followed by /etc/init.d/networking start. Then retry ifconfig wlan0. You should get an IP by then.

7) If none of the above methods fix the wifi, do exactly the following: log in using minicom; type "exit" and minicom will give you another login prompt; do ctrl-A and then Z, which will give you the minicom menu; do Q and then [ENT], which will quit minicom, and you are back to bash prompt; turn off the robot; start minicom; wait for 5 seconds; turn on the robot; you should see your robot getting its IP as it boots up and dumps output on minicom.

8) Remember the IP, which is the IP of your robot on the "Dartmouth Registered" wireless network. Verify the IP by ping in or out of the robot, if normal, you should be able to ssh into the robot now.

Start here if you can ssh into your bot

9) Navigate to where the asf binary is located, type the following command on the shell:


./asf <PORT> /dev/ttyUSB0 57600 > /dev/null 2>&1 &

10) Now you can run the Garcia test program on the robot to check that the bot has no hardward or configuration issues. If this code runs then there is no reason why your developement code should not run - unless there are bugs in your new code. So running the test program is a sanity check. This program is your robots main interface to your computer. It opens sockets and listens for commands from your computer. Once the bot receives commands (turn left) it drives the controller on the bot to respond accordingly. Some example commands are move forward/backward, turn left/right, get an image from the webcam, etc.

To run the test program on your robot, navigate to /home/acroname/aBinary/ directory, type the following command on the Garcia shell:

./run ./cs23Garcia_simple 1

11) Now you run the command interface on your computer. Open a new terminal window and run the portal binary that we have given you.


      ./portal <IP Address of your robot>

This command opens a GUI window with buttons for different commands to drive the robot. The robot commands are self explanatory. You can test your robots navigation, webcam and wireless sensor using this GUI, if you wish. Play with this program to get comfortable with the robot the solution.

Please not that while we give you this code to do a sanity check for your robot and get use to driving the robot you should not simply copy the overall design. Please come up with your own design in terms of the GUI. We know that some basic functions will need replicating but many past projects came up with much better GUIs than this baseline.

Good luck.