"... and no one shall work for money, and no one shall work for fame; But each for the joy of the working, and each, in his separate star, shall draw the thing as he sees it, for the god of things as they are"

-Kipling

 

The Walnut Project

Background

Walnut is a project to write the software that will eventually control the micro robots of the FPath project. Initially, it will use visual servoing techniques to control the 2D arm of a Roland Plotter.

The FPath project is an ongoing exploration of the Feynman Path to Nanotechnology and since the FPath project is so open-ended, the Walnut software does not have a fixed endpoint. It will be modified, rewritten and forked repeatedly as each iteration is reconfigured for a different goal. A list of the iterations and their main features is provided below. If you wish to have a specific version you will need to download or clone based off of the commit number.

The name Walnut is derived from Waldo (the Heinlein story) and a kernel - the controlling core of an operating system. Thus Walnut contains the kernel behind the movements of the Waldos in the FPath project.

Walnut is written in C# and is a Windows Media Foundation application with integrated image recognition functionality from the EmguCV library (a C# OpenCV Interface).

A Summary of the Walnut Versions

Below is a brief summary of the Walnut Versions - a more extended discussion of each application can be found further on down the page.

Walnut 00.01.01 Commit ID: 9e5b761
Streams a webcam to the screen, can record the stream as an mp4 file. It also overlays each frame with timing information and can recognise Red, Green and Blue rectangles and display the center coordinates of each.
Walnut 00.02.01 Commit ID: c6d0e6f
Contains all the functionality of v00.01.01 but also has a client for the BeagleBoneBlack microcontroller and can exchange a typed object with it.
Walnut 00.02.02 Commit ID: e4fef89
Contains all the functionality of v00.02.01 but the WalnutClient can send up to six stepper motor control signals.

A Longer Discussion of the Walnut Versions

Walnut 00.01.01

Walnut000101 ScreenDisplays webcam images on the screen via Windows Media Foundation and, optionally, saves the stream to an mp4 file.

Walnut also contains EmguCV library image recognition code imbedded in a WMF Transform (operating in an independent thread) which can recognise rectangles of Red, Green and Blue color and mark them on the display with a black cross.

Other code accesses the data in the recognition transform and displays the color and center of each rectangle in a text box on the main form once per second.

A further WMF Transform writes timing, frame count and other information in white text on a black background on the bottom of each frame.

Please note that the primary purpose of this version is to implement the image display, save, text overlay and object center detection functionality. As such the image recognition algorythms have not been particularly well tuned. For example, although the EmguCV code will recognise colored rectangles in the image, it will also recognise circles. In reality, it seems be just finding the centroid of various colored blobs. This is sufficient for the purposes of this version.

Walnut 00.02.01

Contains all the functionality of v00.01.01 but also implements client software for the Beaglebone Black. The functionality of the RemCon project has been incorporated into the Walnut Server and Client to provide a mechanism to exchange typed objects over a TCP/IP link in a server/client relationship. At the moment the typed object just consists of the screen coordinates and colors of rectangles picked up by the image recognition system of v00.01.01. Elements of the Tilo project have been incorporated to provide eventual control over the FPath Waldos however this code is largely non-functional as yet.

Walnut 00.02.02

Contains all the functionality of v00.02.01, but adds the ability of the WalnutClient to control stepper motors via a assembly language program running in the Programmable Realtime Units (PRU's) of the Beaglebone Black. As a test, the Walnut Server software can send control signals to activate a stepper motor. This functionality has largely been derived from the Tilo project and is now fully operational.

The Source Code

All Walnut versions are open source and are released under the MIT License. You can download, clone or fork the Walnut software at the following address:

https://github.com/OfItselfSo/Walnut

Note that all of the versions expect to read from, and write to, a directory named D:\Dump\FPathData. This can be changed in the code of course but there is no particular provision to change this at runtime by the user in most versions.

License

The contents of this web page are provided "as is" without any warranty of any kind and without any claim to accuracy. Please be aware that the information provided may be out-of-date, incomplete, erroneous or simply unsuitable for your purposes. Any use you make of the information is entirely at your discretion and any consequences of that use are entirely your responsibility. All source code is provided under the terms of the MIT License.

Acknowledgements

The icon used for the Walnut application is from the the lovely Windows 8 Iconset by Icons8.

The Prism6 application in the OfItselfSo Prism project http://www.OfItselfSo.com/Prism was used as the initial structure and has been much modified since then.