The Walnut Project
Background
Walnut is a project to write the software that will eventually control the micro robots of the FPath project.
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 GitHub Commit ID.
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). The Tanta project provides the basics of the ability to process a stream of data from a Webcam via Windows Media Foundation.
Video Documentation
Three short videos (11 min each) have been made to explain the design decisions behind the Walnut software, how it works and why it does what it does. These videos are the easiest way to get familiar with the Walnut software.
- Part 1: Introduction to the Walnut Software
- https://youtu.be/hjruZfx5GAw
- Part 2: A Deeper Look at the Walnut Software
- https://youtu.be/3JIUdZHgA5w
- Part 3: A Demonstration of the Walnut Software
- https://youtu.be/k5WKsLiTAsU
A Summary of the Walnut Versions
Below is a brief summary of the Walnut Versions.
- 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.
- Walnut 00.02.03 Commit ID: 4902917
- Built to support FPath Experiment 001, this experiment used image recognition to move a red square on a rotating platform as close as possible to a static green square off of that platform.
- Walnut 00.02.04 Commit ID: d9a1b38
- Built to support FPath Experiment 002, this experiment developed the ability to inject video images into the webcam stream processed by the Walnut software and to get that software to react to those images as if the virtual entity actually existed in the real world.
- Walnut 00.02.05 Commit ID: ae0b457
- Built to support FPath Experiment 003, this version contains code which implements the 2D control of DC Gear Motors via pulse width modulation. It is designed to identify red and green squares via image recognition and move the red square onto the position of the virtual green square.
- Walnut 00.02.06 Commit ID: 424bddc
- Built to support FPath Experiment 004, this version contains code which implements the controlled motion of a movable red circle over a virtual linear path drawn in the color green. The green path is removed as the circle moves over it. As the red circle moves along, it can lay down a colored "trail" which forms a return path. When there is no more of the green path to follow, the red circle will follow the return path back to the start.
- Walnut 00.02.07 Commit ID: 1fb9950
- Built to support FPath Experiment 005, this version contains code designed to support the 2D area filling using a technique dubbed Stigmergic Fill. A new WMF transform has been implemented and this code uses various fast bitmaps to overlay, in real-time, an image frame with a virtual area which clearly shows which pixels of a certain color underlie it. Since the pixels on the areas which have not been filled are clearly a different color it is very simple algorithmically to determine which areas remain to be processed.
- Walnut 00.02.08 Commit ID: 6a96848
- Built to support FPath Experiment 006 - the goal of which was to demonstrate that closed loop control is a viable error reduction option when having large machines make smaller machines which then make smaller machines. An interesting application of a transparent panel control has also been implemented. This allows mouse events to be intercepted on third party controls.
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.
Note also that if you are going to setup your own version of the Walnut software you'll probably want to contact me for assistance. There are a lot of things to configure and some of them are not especially obvious.
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.