## 3 Changes Made to e-David
### Painting Software Improvements  
One of the first software improvements made was the precise _Definition of Core Data_. The data structures used in e-David must facilitate simple painting operations, while also accurately modeling the state of the machine, to allow safe operation. For example, a safety mechanism is in place which stops the execution of commands which would crash the tool or contaminate a paint container. The stroke is the basic primitive of painting operations. It describes a single tool movement and associated state. It includes the following. * The required brush
* The paint used for the stroke
* The associated canvas object
* Approach and departure mode, which defines the angle at which the stroke is placed onto or removed from the painting surface
* The stroke trajectory given as a sequence of XYZ coordinates, in millimeters relative to the associated canvas object  
Before any given stroke is executed, the driver can ensure tool or paint changing occurs so the desired stroke can be painted. Keeping track of the machine state is required to avoid common user errors. By enforcing all strokes to be given in millimeters, they are kept separate from the camera and painting modules, which usually operate on a virtual canvas that uses pixels to reference points on it. An explicit conversion from pixel space to millimeter space must be performed, based on the known size of the target canvas. At this interface we can also use known data about stroke width and its relation to brush pressure (see [2]) to compute the required brush pressure for a required stroke width. Besides strokes, e-David uses more general paint commands, which trigger other actions, like brush cleaning, tool changes, or dipping the brush into paint. Several paint commands can be bundled into higher-level actions, which represent more complex painting actions, like filling in regions or applying a certain blurring technique with a brush only dipped into water. Building on these generalized paint commands, e-David can be externally controlled via a simple command language, through which the project exposes an _open interface_ for others. Commands can be passed through a text file which is parsed line by line or sent through a socket. Received painting commands are logged, so a painting process may be resumed when it is interrupted. An example of the command language can be seen in Listing 1. The language is human-readable and adapted to the stateful nature of painting machines: After a brush has been picked up and dipped into paint it follows that subsequent strokes are executed in that color. Many actions can be set to an automatic mode, like re-wetting the brush after \(n\) strokes. Using a default configuration, the robot can be immediately used for painting, without requiring a lot of configuration overhead by the painting program. Feedback pictures of the canvas are provided by e-David by placing them into a folder, which can be accessed locally or though FTP. We found this to be the most simple approach to implement, which also provides a log of steps \"for free\". This data can be used to regain the painting state after a shutdown and to build a database that relates stroke commands to the results. Furthermore, avoiding an explicit connection reduces dependencies. Previous work with \"Cap'n Proto\" [31], a protobuf implementation, turned out to be overly complex: The painting process does not need high speed or memory-efficient tools, as the machine is the limiting factor when it comes to the speed of painting. Moreover, debugging is much easier, as a user can simply drop in files to use the system. We have implemented several small painting programs in Python and Processing, which use these interfaces to generate images. Thus we show that the new core system allows for _modular painting processes_. The modularization also gives us improved _usability for artists_: They can use familiar programming environments or a graphical user interface, exposing only a part of the system, can be implemented.