How to write - jackskalitzky/tapsterbot GitHub Wiki

Writing With Tapsterbot: A Tutorial

Not only is the Tapsterbot capable of state-of-the-art screen testing and producing artwork that rivals that of the the greatest artists in history, but it is also a fully-functioning scribe and can write in beautiful script. What more could you want from a robot?

Here is a step-by-step guide on how to harness the robot's incredible handwriting for yourself.

Requirements:

  • One Tapsterbot with whiteboard inserts and marker holder
  • Inkscape
  • A dry erase marker
  • EggBot extension for Inkscape
  • Optional: A second Tapsterbot, for additional writing fun and to keep me from losing my job

Step 1: Installing EggBot

Inkscape's default text is useful, but not fully suitable for Tapsterbot. The text is based on the area filled, not the shape itself; since Tapsterbot does not support fill, the text often comes out looking like an outline of a letter rather than simply a letter.

To work around this, we use specially-designed single-stroke fonts. These fonts, usually used for things like engraving, produce text that is comprised of strokes only, with no fill. This article contains a lot of information on the distinctions between the two and using single-stroke fonts.

To access these single-stroke fonts, the EggBot Inkscape extension is required. It is simple to install from the instructions provided here.

Step 2: Configuring Inkscape

Like we did when preparing Tapsterbot to draw, it's good to configure Inkscape to achieve the best results. To make things as easy as possible, edit the document properties (File > Document Properties or Ctrl+Shift+D) so that the Inkscape canvas matches Tapsterbot's canvas (80mm by 95mm).

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

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 result will probably not be as good.

Step 3: Calligraphy

Open up the Hershey Text menu (Extensions > Render > Hershey Text)

Opening up Hershey Text

type in what you want the robot to write and choose your font

So many choices

and apply your changes. After some rendering time your text will appear.

The text may appear offscreen. Pressing 4 will zoom to the text, which you can select and drag to the canvas. From there, you can modify it as you wish.

To modify individual characters and parts of the text, ungroup the text (Path > Ungroup or Ctrl+Shift+G) and select the parts you would like to modify.

Again, keep in mind that bigger text means a more accurate drawing.

ohai

Step 4: Miscellaneous Adjustments

There are almost certainly a few transformations affecting your text by this point. These transformations make life difficult for Tapsterbot, so it's best to remove them.

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

Having done this, the text is ready to be written by Tapsterbot. Save it and copy the filepath.

Step 5: Telling Tapsterbot to write

Now that we've got an .svg file full of path data just waiting to be converted into whiteboard text, 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 text as a parameter (make sure to enclose it in quotes).

Like so.

Tapsterbot will begin writing right away.

Step 6: The final product

It is done. Tapsterbot has produced a beautifully illuminated message of your choice. Try not to become overwhelmed as you take it all in.

Flawless


Writing In Cursive

Tapsterbot also supports writing in cursive. Here is a quick summary of how to do so.

Step 1: EggBot

Step 2: Configure Inkscape

Step 3: Hershey Text

Select one of the Script fonts and input your text. Currently, cursive is only supported for one line of text at a time.

Fancy.

Adjust as needed.

Fancier.

Step 4: Miscellaneous Adjustments

Step 5: Telling Tapsterbot to write in cursive

The same basic procedure is followed; however, when calling the svg.drawSVG method, an extra "true" parameter is added at the end, after the filepath. This tells Tapsterbot to connect each path.

Like so

Step 6: The final product

Beautiful cursive, custom written just for you.

Faaaaancy.

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 text comes out very poorly

Double check your document size. If the canvas is too large or too small the text the Tapsterbot draws may be drastically different from the one you expected. Make sure that the zoom level is at 100%, so you can see how the writing 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 character. You can also manually edit the nodes in the drawing path. Adding additional nodes keeps Tapsterbot on target and improves writing 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 writing in. Due to the design of the Tapsterbot, it has some difficulty writing outside of the recommended 80mm by 95mm rectangle. If possible, keep your writing inside this rectangle for the most legible and best text.