Skip to content
jackskalitzky edited this page Jul 10, 2015 · 9 revisions

Drawing With Tapsterbot: A Tutorial

Pushing buttons and beating Angry Birds is fun and all, but Tapsterbot comes with some more interesting functionalities. Most notably, it can create beautiful works of art from a simple .svg file. Here is a step-by-step guide on how to tap into the bot's artistic potential to draw whatever your heart desires.

Requirements:

  • One (or more!) Tapsterbot with whiteboard inserts and marker holder
  • Inkscape
  • A dry erase marker

Step 1: Configuring Inkscape

The standard Tapsterbot has a hexagonal base, but for a variety of reasons (simplicity, mainly) the drawing area is confined to an approximately 80mm by 95mm rectangle. It is possible to go outside of this area but your results may vary.

To make things easy on Tapsterbot and ourselves, it's best to draw with these restraints in mind. Opening up the Document Properties in Inkscape (File > Document Properties or Ctrl+Shift+D) allows us to set the document width and height to 80mm by 95mm, giving us a canvas that is 1:1 with Tapsterbot's.

![Editing the document properties] (http://puu.sh/iTe5k/e1927c1edf.png)

Setting the default units to mm is also helpful, but not required.

The other units are fully supported and it is possible to work with a canvas that is larger or smaller than Tapsterbot's, but the end drawing will probably not be as good.

Step 2: Art

This is the fun part. Here, you are limited only by your artistic merit, so draw to your heart's content. Feel free to utilize any of Inkscape's tools, but remember that Tapsterbot does not support fill or multicolored drawings (yet). Text is supported, but is slightly complicated; see here for more information.

With Tapsterbot, it's important to remember that bigger is generally better. For the best looking drawing, it's good to make everything as large as possible so that the marker's stroke width doesn't mess things up. Also remember that if you're drawing at a zoom level greater than 100%, your drawing will come out smaller than expected.

For this tutorial, I drew a smiley face.

A photorealistic drawing of myself when I get to watch Tapsterbot draw

Step 3: Miscellaneous adjustments

Depending on how you drew your picture, the .svg file might have path data, object data, or a mixture of both. Tapsterbot deals only with path data, so to be safe we have to convert all data to path data.

This is easily accomplished with Inkscape. Select all of the components of the drawing and convert them with Object To Path (Path > Object to Path or Ctrl+Shift+C). Now all of the data is in a format that Tapsterbot can read with ease.

But, if you manipulated the components at all during the drawing process, it's likely that there are some transformations that are making things hard on our robot, who prefers to take things at face-value.

To get rid of these, select all of the components again. Ungroup them (Object > Unroup or Ctrl+Shift+G) and then Group them (Object > Group or Ctrl+G). This applies the transformations to all the points and updates the path data, just as Tapsterbot likes it.

With these preparations made, we're ready to pass the torch to our robotic Raphael. Save the image wherever you want and copy the filepath. It's time to draw.

Step 4: Telling Tapsterbot to draw

Now that we've got an .svg file full of path data just waiting to be converted into a whiteboard picture, we need to give it to Tapsterbot so that he can work his magic.

Open the command line interface of your choosing and navigate to the Tapsterbot files. We specifically want to be inside the src folder, which is currently in Tapsterbot/software. From there, launch the bot.js file with node. Assuming everything is plugged in and set up properly, the Tapsterbot is now ready and waiting for your command.

Call the svg.drawSVG method, with the filepath of the image as a parameter (make sure to enclose it in quotes).

Like so.

Tapsterbot will jump into action and rapidly produce your dream drawing.

Step 5: The final product

After a long and arduous process, the drawing is finally complete. Brush away any tears of joy that might cloud your vision and gaze upon your masterpiece with pride.

It's perfect.


Troubleshooting

TypeError: Cannot read property 'length' of undefined

Something is messed up with the grouping. Ungroup several times, and then regroup the objects once. If that doesn't solve the issue, open up the XML Editor (Edit > XML Editor or Ctrl+Shift+X) and find the start of the groups (marked by <svg:g id=... />). Ungroup everything and regroup.

The console displays [1, 0, 0, 0] several times and nothing happens

Something is messed up with the grouping. See above.

The image comes out really poorly

Double check your document size. If the canvas is too large or too small the image the Tapsterbot draws may be drastically different from the one you draw. Make sure that the zoom level is at 100%, so you can see how the picture actually should look. If possible, increase the size of the drawing, so that there is more room for error. If these do not fix the problem, try changing the delay value in config.js. A higher value means the robot takes more time to draw each point, so the end result is a smoother picture. You can also manually edit the nodes in the drawing path. Adding additional nodes keeps Tapsterbot on target and improves drawing quality.

The marks are streaky, inconsistent, or otherwise messed up

There are several reasons this could be happening. If the whiteboard surface gets too gummed up with dry erase particles, the marker won't be able to draw as clearly. Wiping the whiteboard down with Windex usually fixes this.

If the whiteboard surface is wet, the ink may not apply properly. Wipe down the whiteboard with a dry paper towel to get off any water that may be present.

Make sure that the marker hasn't gone dry. Forgetting to put a cap on the marker can cause it to dry out in a few hours.

Adjust the drawHeight level in config.js. A lower value drops the marker closer to the whiteboard, which causes it to press more firmly and potentially draw better. Because dry erase marker tips flatten out over time, it may be necessary to adjust this value so that the marker tip continues to reach the whiteboard. This should only be adjusted by about .5-1 at a time. Making the marker press too firmly into the whiteboard can place too much strain on the servos and cause them to stop working.

Adjust the location that you are drawing in. Due to the design of the Tapsterbot, it has some difficulty drawing outside of the recommended 80mm by 95mm rectangle. If possible, keep your drawings inside this rectangle for the most accurate and best pictures.