DIY : Precise Duckietown Straight Road Measurements (and Templates!)
Now that I built a Duckiebot, I need to build a Duckietown. Because the existing software relies exclusively upon visual recognition, it is essential that all Duckietowns are constructed with identical building blocks.
Roads are constructed on puzzle-style interlocking tiles for home gyms and playrooms, made of PVA foam. There are four tile types that serve as building blocks for custom roads. Markings are white duck tape for the outer road, dashed yellow for the center lines, and red for intersection stop lines.
There are some computer graphics of some sections and a few pictures on their website, but I find their instructions far too vague. Also, a nice set of templates will speed up duplication and reduce error. I will show you how to make my templates for the straight section tile, and the skeptical may page down for my mathematical proofs.
I highly recommend digital calipers! I used mine whenever possible, but also relied on a metric tape measure and T-square. My templates are heavy cardboard (the kind used for matting in picture frames), but poster paper or foam board should work fine. Masking tape is super handy for holding things down and making temporary markings, especially for cutting sections of yellow tape. I used a very sharp razor and scissors for my cuts. This is essential! And dangerous. Use caution when handling sharp objects.
White Line Template
The white line template is the height of the tile (61.4 cm) and the width of the margin between the edge of the tile and a white line. Align it with the edge of the tile (including the puzzle edge), and butt your white tape against its side. This template works for both white lines; just flip the tile and repeat the process.
Cutting and folding the tape edge is a really nice touch.
If you cut from the inside corner of the puzzle edge and from the outside corner to the edge of the tape, you can fold the tape around the corner, and it makes your tiles fit better later.
Yellow Dash and Space Templates
These are the height templates for your yellow dashes and the spaces between them. You’ll need to be precise with these. Use your digital calipers. The widths are unimportant, but the heights are absolutely critical; get fussy with these.
Yellow Dashed Line Spacer
Now that you have templates for your yellow dash and space heights, we will use them to make a template to align all our dashes. Each side of your yellow line will sit 29.5 cm from the edge of your tile (including the puzzle edge). Cut a 29.5 cm by 61.4 cm rectangle from your poster board.
Starting in a factory-cut corner (don’t use a side that you have cut), use your Yellow Spacer template to draw a mark on the edge of your Yellow Dashed Line Spacer Template (29.5 x 61.4).
That first mark is your 1st Spacer. Place your Dash Template on top and make another mark. Keep leap-frogging your templates until you reach the top with your 9th Spacer. Draw X’s in the shorter sections (where you traced your Spaces).
It should look like this:
Cutting Yellow Tape Dashes
If you got along with scissors before, you might need that razor now. The best way I found for cutting the dashed tape is with a razor and a cutting board. Put the tape down on the board, then measure the middle from both sides and split the difference. Masking tape helps here, too. Use a metal ruler and cut the duck tape in half (down the middle).
Now use your Dash Template to measure lengths of yellow tape. Since your tape is still doubled on the cutting board, each razor slice will net two dashes. Do not cut against your template! You will ruin it, and you’ll need it again the next time you make a straight tile. Instead, make your marks on masking tape along the edge of your yellow tape.
Now make your cuts against a metal ruler.
Getting the tape pieces up can be a bit fiddly, so be patient and careful. I like to peel them all up and loosely tack them to the side in preparation for my next step.
Align your Yellow Dashed Line Spacer Template (29.5 x 61.4) with the right edge of your tile. (For what that looks like, refer back to the first picture in this article.) It should cover the whole side, including the puzzle edge, and the dash and space marks should now be in the center of your tile.
Place a yellow strip at each dash location on your template, and breathe a sigh of relief! Now that you have a template, your next straight tile will be so easy!
Detective work (And Mathematical Proofs)
There are a couple of good clues in the Duckietown documentation on the grainy picture (Figure 2.10). One is that the space between the white lines should be 43.5 cm. The white lines are made with a standard width of duck tape, which they list as two inches. This is incorrect; let’s be precise. A standard width of duck tape is 1.88 inches, or 4.78 cm.
White Line Calculations
The width of the entire tile, including the rough puzzle edges, is 61.4 cm. Let’s then calculate the margins outside the white lines. We’ll call this margin.
You can see my calculations in the picture. We know the widths of the duck tape and the space between white lines. Subtract two widths of duck tape and the space between it from the total width of the tile, and we get the width of the margins (the total space outside the white lines). Divide by two and we get the space between the side of the tile and each white line.
Dashed Yellow Calculations
A dashed yellow line extends down the middle of the tile. It is specified as a half-width strip of duck tape.
Now we take half of that width (now a quarter-width of duck tape) and subtract it from half the width of the entire tile. The result is the margin from edge of tile to side of the yellow center tape.
Dashes Height Calculation
Duckietown specifies that yellow dashes are ‘approximately’ two inches long and spaced one inch apart. That means 5.1 cm and 2.55 cm respectively. A dash and space unit is then 7.65 cm. There is space for eight of these sets down the tile, but there is a dead zone created by the puzzle edges; there must be a space at the top and bottom so that yellow lines do not run into each other between tiles.
Since the ratio is approximately 2:1 of dash to space, and since we now need eight dashes of 2x and nine spaces of single x, that makes 25x spaces in 61.4 cm. The dashes would then be 2.456 cm (2.46) and the dashes would be 4.91 cm.
Nice math, but when I used these numbers for templates, the margin of error in my markings threw off the total height, so I adjusted the numbers (2.35 cm and 4.9 cm) and it worked perfectly. If you are now worried that I am playing fast and loose with my Duckietown specs, you will be relieved that 4.9 cm is 1.92 inches, and 2.35 cm is 0.92 inches. They said ‘approximately!’