CanHaptics Lab 2: Intro to Haply

Task: Get started with the Haply device, create a maze design using the “Hello, Wall” example.

Rúbia Guerra
3 min readFeb 5, 2021

Goals

The main goals of this lab were to get started using Haply and playing with Processing and fisica. In this activity, we also designed a simple haptic virtual environment based on existing examples for Haply.

Materials

Haply device and cables, assembly tutorial, firmware and examples.

Tools

Box cutter, torx allen key (provided with Haply). Software: Arduino IDE, Processing Development Environment.

Part 1: Setting up Haply

Putting Haply together took me over 2 hours. Although the process was relatively easy, the holes in the 3D-printed pieces were quite small for the screws we were given. Since I didn’t have access to anything other than a box cutter, widening the holes and getting everything together took some patience. Shoutout to Hannah E. and Kattie S. for providing company over a video call while we figured out what part goes where.

With the device ready to be used, I downloaded and followed all instructions provided on Haply’s GitHub repository. Here I ran into a small calibration issue, captured in the video below. Thanks to Preeti V., who pointed out there were updated instructions in the course’s website, I was able to fix the problem. After this, I was able to interact with all the examples for Haply available at 2diy.haply.co/.

Haply’s “Hello, Wall!” example using Processing and the fisica package. I had calibration issues since I forgot to update a few parts of the code to work with the new version of Haply

Part 2: Hello, Wall!

Now that Haply was up and running, it was time to design a maze. The first step I took was to plan how my maze would look like. I started by drawing a 9 x 15 point grid (dimensions chosen arbitrarily), in which the distance between two adjacent points corresponds to 1.5 units in the Haply virtual environment. Then, I drew a path from the top of the grid to an exit located at the bottom. Finally, I added walls randomly around the path to create the maze.

Sketch of the maze

Next, I turned to the “Hello, Wall” code and identified the snippet that corresponds to a single wall, captured below:

/* creation of wall */
wall = new FBox(10.0, 0.5);
wall.setPosition(edgeTopLeftX+worldWidth/2.0, edgeTopLeftY+2*worldHeight/3.0);
wall.setStatic(true);
wall.setFill(0, 0, 0);
world.add(wall);

In the spirit of sketching, I replicated the above code 9 times horizontally and 15 times vertically with a spacing of 1.5 distance units between each line, to create a “grid of walls”. Then, I modified each wall by adjusting the correct length and position. After around an hour, I was able to create a functional maze example, which can be found here.

Running my maze design using Processing and Haply

Reflections

Although assembling Haply took a lot longer than what I originally anticipated, it gave me enough time to realize how simple and accessible this device is compared to my previous notion of haptic devices. Most parts are 3D printed, and both the motor and hardware platform can be obtained at consumer-level prices. Also, getting started with the coding portion was relatively pain-free. After this exercise, I’m inspired to take a stab at reproducing a random maze generator using Processing. I’ll report back if have time to get to it!

--

--

No responses yet