CanHap Lab 2: Intro to Haply

Hannah Elbaggari
5 min readFeb 5, 2021

This week we were asked to set up and get familiarized with our Haplys (Haplies?). We were tasked with running “Hello Wall”, the “Hello World” of the Haply. Additionally, we were asked to create our own maze.

Assembly

Luckily I asked a few people to hop on a call while assembling the Haply. This was mostly for chit-chatting and sharing struggles with screws. While most of these labs will be at home and on our own to some extent, I wanted to still get the “lab feel” so this helped quite a bit (thanks Rubia and Kattie!)

Assembly went smooth. I did this pretty early on since I was moving over the weekend and had to make sure I split my assembly and implementation time wisely. The assembly video was really helpful. I was able to assemble the Haply no problem with it. Even though I am a visual person, I would have appreciated some written notes — for example, the way the motor mounted on the metal surface was not very straight forward and took some trial and error and careful video watching. One screw I had probably had a stripped hole that it went in and is a bit loose, so one of the arm joints may eventually be looser than another, but I will keep this in mind while I play around with the Haply a bit more.

“Hello Wall”

I first tried the demo that was on the course website — the old one with the red avatar. This demo had lots of calibration issues and was pretty “bumpy” feeling. I attempted to debug this one, but with the overwhelming support for the new demo on the course Discord, I resorted to switching. Debugging helped me get familiarized with some of the (Fisica) documentation though, so I found this beneficial.

I ran the 2diy version of the Haply demos. First I ran the “Hello Wall” which only had a few changes to my machine specifications. After that, it worked great. I did feel a bit of the bumpiness, but only on the bottom edge of the wall. Still can’t figure out why this is happening, but I can foresee some issues with that in if it continues. I then ran the “Maze” version of the demos. This was more attuned to what we were asked to do in the next task of Lab 2. It was interesting to play around a bit with some of the densities that were specified in this one. The “water” level was cool too, although I am not 100% sure I understand how it works yet, so I will be playing around with that a bit more on my own.

In the 2diy version of the demos I also saw that the avatar rotated with the end effector ball. This is a great thing to know that I don’t think was explicitly expected from this lab. The rotating avatar is helpful for many reasons, one of which I show in my maze demo below.

Maze Creation

Inspired by Line Rider, a game I often played on Miniclip when I was younger, I wanted to create the old Flash feel of a simple, yet fun maze. I started with a general maze design. I started by designing the walls (in red, below) and then realized I would have to break them up into numbered walls the way I planned on implementing the code. Each wall would individually have to be implemented with its own coordinates. While this maze was not to scale, I did sort of set this up poorly for myself. Because I did not scale it beforehand, I mostly did trial and error when finding the coordinates for each wall — this took some time.

A few design features I wanted to include were:

  1. multiple options to the same end
  2. some sort of tricky bit — in this case I made a hole just big enough for the avatar to fit through. This also happens to be the most direct route to the end (you can see this in the video
  3. a fun avatar and different wall colours

For each wall, I used the “Hello Wall” as a template, and provided some variation of:

The main things I changed here were the new FBox() sizes for vertical and horizontal boxes, and wall.setPosition() for where the boxes were within the screen. Code can be found here.

Maze sketch

Another factor that may have played into my trial and error of wall placement was that I changed the dimensions of the worldHeight = 15; and screen size(1000, 600); to give myself more workspace with the maze. I could have done the math for each wall, but since my sketch wasn’t really to scale and I wanted to make some changes along the way (as seen in the green squiggles above) I kept it pretty free-formed for implementation.

In the style of LineRider, I chose a new avatar (below). Because I noticed the pantograph.png avatar rotated with the Haply movement, all I did was change the image. This stick figure guy cartwheels through the maze, hitting the walls and jumping around — yay.

Below is the video of my final maze and side-by-side interaction with the Haply. I wish haptics was easier to show visually, but alas here we are. Some of the time, I found the force feedback was stronger on some walls than others. Unsure if this is a glitchy thing or the way I’m holding it and letting it go, but ultimately it worked well and I am happy with my cartwheeling person through my maze.

--

--