|Surveyor Robotics Journal|
Wed, 27 Dec 2006
test version of SRV-1 firmware with C interpreter
As discussed previously, we now have a version of SRV-1 firmware that includes a C interpreter as an alternative to BASIC. A set of SRV-1 specific functions have been included - motors(), ir(), imgcap(), scan(), blob(), colorcap(), colorset(), colorget(), bitdir(), bitset(), bitget() - so it should be possible to develop a variety of interesting behaviors that are controlled by onboard code.
Here's a code sample that uses some of these functions ...
/* capture color sample for scan() function */
int _x, _y, _z, _ymin, _ymax, _umin, _umax, _vmin, _vmax;
colorcap(1, 30, 50, 1, 5);
print(_ymin _ymax _umin _umax _vmin _vmax);
print("test" _x _y _z);
ix = input();
} while (ix != 65); /* continue running until input = 'A' */
We'll start to build a libary of code samples, and welcome contributions from users.
There are now 2 versions of firmware - one that includes BASIC and one the includes C. The BASIC version is almost identical to the 120206 firmware release, with 3 minor changes -
Here are the latest download links for both versions of firmware -
Please post any problems, suggestions, and/or interesting code samples on the Surveyor Robotics Forum.
Sun, 24 Dec 2006
We recently received some samples of alternative lenses for the SRV-1 camera module, and took some comparison snapshots today in relatively low light. The new lenses are designed primarily for monochrome cameras, as they have no IR coating, and the ambient IR tends to wash out the color sensitivity of the camera imaging element. However, these lenses have significantly better light sensitivity, so there is always a tradeoff.
Here is a group shot of the 3 news lenses below the camera module with the standard lens. The standard lens is F2.8 with a 57-deg field of view (FOV). The lens on the lower left is F2.0 with a 66-deg FOV, the middle one is F.20 with 86-deg FOV, and the bottom is F2.5 with 118-deg FOV
Here are snapshots from the robot in approx the same position with no lighting change. First is the standard lens (57-deg) -
Next is the F2.0 66-deg lens -
Next is the F2.0 86-deg lens -
Finally, the wide angle F2.5 118-deg lens -
You can see how the colors wash out with the uncoated lenses, though it is easy to see the difference in light sensitivity. It would be interesting to find versions of these new lenses that have IR coating, since that might provide an ideal combination, though there might be application for the uncoated lenses.
Wed, 20 Dec 2006
C interpreter for SRV-1
We're a few days away from wrapping up a version of firmware that includes a C interpreter running onboard the robot. This will be similar in structure to our BASIC interpreter, with a set of built-in robot-specific functions for motion control, IR, timing, image capture, color management, and image processing (like the functions we added to BASIC). The C language itself is interpreted, so you just store the program source code in the flash memory and issue a command to run the program. I believe our C implementation is comparable in functionality to RobotC or InteractiveC, though I haven't looked at a full specification for those languages - we don't have complex data structures, but we do have a reasonable set of flow control commands (if, else, for, do, while, return), nested loops, nested function calls, etc.
At this point, we're not going to try to fit both BASIC and C into the same firmware image, so we will provide 2 versions of SRV-1 firmware - one with BASIC and one with C. From a coding standpoint, this isn't an issue, as there is a simple #ifdef in the source code to select between the languages, and all other aspects of the SRV-1 functionality will be identical between the two versions.
I'm personally pretty excited about this addition, as it should be quite helpful for users to have familiar language options like C and BASIC for onboard scripting of autonomous robot behaviors in addition to the host-based tools that are adding SRV-1 support (e.g. Microsoft Robotics Studio, Pryo, Webots, URBI, Player, SRV1Console, etc). Once this code release is complete, we will focus some energy on providing some sample onboard programs in C and BASIC for various functions, including the wander mode, object location and object tracking.
Mon, 11 Dec 2006
New Python-based SRV1Console for SRV-1
We've created a Python-based version of the SRV1Console with some added features, including the ability to edit the flash memory, check the firmware version, run the firmware update program, and test the image processing functions. Here is the download link -
At the moment, the displayed video frame rate is somewhat lower than the java version of SRV1Console, and the image processing commands still need some work, but this console is a *lot* easier to extend than the Java version, and we should be able to resolve the performance issues.
If you want to run from source (SRV1Console.py), you'll need Python 2.4 and the PySerial package (http://pyserial.sourceforge.net/).
If you have Python installed, the console is started with:
python SRV1Console.py -com /dev/cu.SLAB_USBtoUART
python SRV1Console.py -com COM4
If you don't have Python installed, there's an SRV1Console.exe which should run on Windows without any Python libraries installed. The command line parameters are the same as the Java SRV1Console, with one addition: '-com' to specify the com port string:
SRV1Console -com COM4
Once it's running, the main console page is:
We'll set up a discussion/troubleshooting thread in the Software section of the Surveyor Robotics Forum
Thu, 07 Dec 2006
Surveyor SRV-1 support in Microsoft Robotics Studio (MSRS)
There is now support for the SRV-1 in Microsoft Robotics Studio. The MSRS SRV-1 services were developed by SharpLogic Software, and while work continues to add some of the new SRV-1 image processing functions, there's already a nice collection of camera and motors services.
To download and configure the SRV-1 MSRS services, go to
Sat, 02 Dec 2006
one last set of firmware changes (120206 firmware)
We are going to wrap up this version of firmware, so the SRV_protocol is now frozen, at least for this release. We made these final changes -
Here's a variation of the previous BASIC example that uses the INPUT command - the program will continue to loop until the INPUT command receives a character via the serial port / radio :
COLORCAP 1 25 55 1 8
IF X = 0 THEN GOTO 100
Here are the latest download links -
Webots 5.1.11 from Cyberbotics will include support for SRV-1
The upcoming release of Webots 5 will include full 3D simulator support for the SRV-1, including camera and IR sensors, realistic physics for the dual-motor tread drive, and SRV_protocol commands. Cyberbotics has done an amazing job in modeling the SRV-1, as can be seen from this video (click on the image) -
For more information on Webots, visit the Cyberbotics website
If you have trouble accessing the video, there's a version posted on YouTube -
(thanks to Prof Doug Blank of Bryn Mawr College / IPRE)
Fri, 01 Dec 2006
using the image processing extensions in SRV-1 BASIC (113006 firmware)
As a result of code testing, a few small SRV_protocol changes have been made. In the BASIC interpreter, a COMMENT command was added, PRINTX was removed, and BITDIR / BITSET / BITGET were activated. For the moment, we haven't activated the INPUT command, thinking instead that we might add some kind of non-blocking read to check for incoming data, but haven't yet decided on the best approach.
In the core robot functions, two commands were added to manage flash memory - 'zs' to set the current flash sector number (default is 00) and 'zg' to get the current flash sector number. At the moment, the code only allows access to flash sector #00, but this limit will eventually be lifted.
Here's an example of how to use some of the image functions in SRV-1 BASIC to create a very primitive version of "wander mode":
COLORCAP 1 25 55 1 8
IF X < Z THEN MOTORS 75 25
IF Z < X THEN MOTORS 25 75
IF X = Z THEN MOTORS 50 50
IF X + Z = 0 THEN MOTORS 0 0
This code takes an initial color sample of nearby pixels (columns 25-55, rows 1-8), and stores the sample in color bin #1. It then looks at the left ('X') and right ('Z') Scan sectors (in BASIC SCAN, there are only 3 regions, not 80), turning one way or the other if one region seems more open. A useful extension to this code would be to also look at the center ('Y') region, and spin 45-degrees if all 3 regions were blocked, but I wanted to keep this simple.
Here are the latest download links -