Harvey Mudd College
Computer Science 154
Robotics Software Page

- Brand New for the game of Set!
The starting vision code (VideoTool.zip)
Instructions:
- Download this file to C:\Program Files\ERSP\sample_code\driver\.
- If you have a VideoTool already there, rename it. (Don't delete it --
you may want to copy some of your code from it!)
- Unzip the new VideoTool.zip and go into the folder created.
- Run the new program -- the most important change from the old version
is that typing a capital S will start the game of set. Each
subsequent S will randomly choose new cards. Just as with the
red moldings, you can use the space bar to wrap through all 81
cards to tune your algorithms!
- See if you can beat the computer -- Good luck!!
- The following notes are only applicable if you have not
used the VideoTool before:
- Check if you already have C:\Program Files\OpenCV
on your machine. If not, download this
file (OpenCV.zip) to C:\Program Files and
then unzip it to that location. Note if you unzip it
to C:\Program Files\OpenCV you will get two
layers (folders) named OpenCV. Be sure there's
just one.
- Double-click on the .sln file to bring up the source code.
- Glance through the source code and this
brief guide to the VideoTool software.
- Try it out! It will grab live images by default if you have
any Windows-recognized camera plugged in.
- If you would like a LARGE set (~500; 95mb) of bitmaps that have
red moldings in them, download this VideoBMPs.zip
zip file. Unzip the archive and replace the existing VideoBMPs
directory with the newly unzipped one.
-
A map-visualization server (MapTool.zip)
including an example python client.
Instructions:
- Download and try it! I don't think it needs to be in any particular
directory, and you can run MapTool.exe from the top-level
directory (you need to have the map.txt file in the same
directory). It should set up a server that will respond to the following
ASCII messages (an example mapClient.py is provided in the zip file):
- t x y th translate the robot's pose in absolute terms to x y th
in cm and degrees, I believe
- d x y th add x y th to the robot's current pose (relative,
rather than absolute, motion
- p toggles showing the robot's path
- c clears the robot's path history, which is useful for
starting it somewhere else!
- q quits
In addition, there are lots of keyboard commands active when you're in the
map window. The most useful are x and z which zoom in and
out, along with v, which toggles the path on and off.
- A server that talks to the servo and sonar
(servoServer.zip)
including an example python client.
Instructions:
- If you have the board plugged in and powered, you should be able
to try this out. You'll have to answer a couple of questions
when you run the server (the COM port number, e.g., 4, 5, 6, or
7 are common with the USB/serial converters) and whether you're
using Tommy Leung's board, which has a different data rate.
- Then, you should be able to run the python client (it's
located in the top directory of the zip file) and
send it strings (it talks over port 5010). It will simply
pass on any motor-command strings, e.g., BD1SV2M200
moves board 1's servo #2 to position 200. q quits and
1 asks for the raw reading from the sonar on A/D
pin 1 (where they should all be). That's pretty much all you'll
need.
- You'll want to integrate this into your wandering
client, rather than use the separate python client, but
it's good to have just to check if things are working.
- Warning You'll need all of the helper files listed under
the servoTest.zip section below. (You probably already
have them installed.) You'll also need to check the comm
library under project...properties...libraries.
- An example python program (remoteControl.py)
that handles keyboard input without buffering it.
Instructions:
- Download and try it! This will help in building a
remote-control program for your robot.
- This is not cross-platform! Of course it's possible
to create unix versions,
for example, by using the curses library support
in python.
- The resource-config.xml configuration file
Instructions:
- Download this file into the C:\Program Files\ERSP\config folder (or wherever
the Evolution software is located).
- Make sure it's named resource-config.xml.
- If you don't have the IR sensors attached, it will complain, but it will still work.
- If the robot server hangs while looking for an audio device, this is likely the issue -- the
default config file is telling the system that you have every conceivable hardware
device installed.
-
Robot Server (source and executable): baseNew.zip
Instructions:
- Download this file to C:\Program Files\ERSP\sample_code\driver\.
You might want to make a desktop shortcut to this location.
- If there exists a baseNew folder already, change it to
a different name.
- Unzip baseNew.zip to create a baseNew folder.
- You can double-click the .sln file to open the source code,
or just run base_drive_test.exe in the Release folder.
- Make sure the robot is on and attached!
- Note on using this without Vis Studio: you will need
a couple of additional libraries (dlls) to make this work.
They are available here.
-
A simple client for the robot server: simpleclient.py
Instructions:
- Download this file to a folder you create or the desktop.
- Make sure python is installed and in the path...
- You can edit the file with python's "IDLE" editor by right-clicking
on the file (once python with IDLE is installed)
- Open a command window cmd and move to the directory in which
simpleclient.py is located. I have not had success running
the client from IDLE.
- Run python simpleclient.py at the prompt. A connection should
be made and you should be able to try out commands. At the moment, the
code is its own documentation...! However, to get you started, you might
try
- v f 20 10 0 to go forward at 20cm/s.
- v f 0 10 0 to stop.
- q to quit both client and server.
- Try things out! Good luck...
-
The java program for testing the servomotor servoTest.zip
Instructions:
- Download this file somewhere.
- Make sure java is installed, for the sake of the following
instructions, suppose that java is installed in C:\j2sdk1.4.2
If yours is elsewhere, adjust accordingly.
- Download this file
(win32com.dll) to C:\j2sdk1.4.2\bin and
C:\j2sdk1.4.2\jre\bin.
- Download this file (comm.jar)
to C:\j2sdk1.4.2\lib and C:\j2sdk1.4.2\jre\lib (or
somewhere else in the classpath).
- Download this file
(javax.comm.properties) to C:\j2sdk1.4.2\lib
and C:\j2sdk1.4.2\jre\lib, just as the previosu file.
- Then, you should be able to unzip the servoTest.zip
file. You can open the CS5hw.jcw file (!!) if you have
JCreator (freely
available). From there, you should make sure that it is
using the comm.jar library by checking the COMM
checkbox under the Libraries tab, under the Project --
Project properties menu choice.
- If you have a serial port on your machine, you'll have to
make sure the java code is addressing the correct one. Search for
COM2 in the code and replace it with the COM port you're
attached to.
- If you don't have a serial port, you can use a USB port with
one of the USB-serial converters in the lab. Install the
software first, then plug in the USB-serial converter, and look
up the new serial port number in your System control panel
(hardware -- devices tabs).
- Try it out! Good luck with this...