top of page

ME 134: This Robot Plays Games

This robotics project course built upon theory learned in previous courses, challenging 4-person teams to design and program a robotic arm. My team designed to build a human vs. robot game of "cornhole battleship" - essentially, a mash-up of the classic game battleship and the challenge of throwing hacky sacks into the battleship grid.

Game

  • 5x5 Battleship board

  • Human can choose from various randomly generated ship configurations

  • Robot and human will take turns throwing hacky sacks into each others’ boards, with aim of hitting the opponent’s ships

  • Robot does not know position of human’s ships, and vice versa

  • Receiver picks up hacky sacks and loads them back into thrower arm after each turn

ME134_game.JPG

Robots

At our disposal were 6 HEBI X-Series actuators and necessary electronics, 1 pair of grippers, a webcam, and whatever raw materials we decided we needed. We decided to split up the robot's tasks between two arms: a 4 DOF "Receiver" arm would collect a hacky sack from the board and deposit it into the 2 DOF "Thrower" arm.

Thrower

​DOF 1: Aim

DOF 2: Tit​

​

  • Although the actuators came geared, they needed a bit more speed for a catapulting thrower arm. As such, one of my teammates designed a gearbox for the thrower.

  • Although we attempted calculations to guess what gear ratio and arm length would be best for throwing, we hedged our bets by designing interchangeable gears and different length arms. Then through experimentation, found 2:1 gear ratio with 20.75 in arm to work best of the fabricated options.

  • Max throwing distance about 6 to 7 ft

  • ~80% accuracy throwing into the desired grid spot. As you can see from the video to the right, the hacky sack landed directly in the target we placed for it.

​

Kinematics: All motors for this arm were programmed in joint space. The throwing process went as follows:

  • The robot aims.

  • The tilt motor accelerates from a start position to achieve the desired exit velocity at the release position.

  • The robot performs a braking maneuver to ensure the hacky sack leaves the thrower. 

 

We found we achieved the best accuracy by hard coding each board location to an aim angle, release point, and exit velocity. 

me134_throwercad_edited.png

Receiver

me134_receivercad_edited.png

​DOF 1: Pan

DOF 2: Shoulder​

DOF 3: Elbow

DOF 4: Wrist

Bonus DOF: Gripper actuation

​

Unlike the thrower, the receiver moved in task space, with the exception of the wrist, which would simply use the angles of DOFs 3 and 4 to calculate how to point down. At each update() step, the program used Newton-Raphson inverse kinematics with guess of the previous joint positions. Quintic splines were computed based on (x, y) position of a hacky sack in arm’s reach as communicated by the hacky sack detector via webcam.

Other Software

Object Detection

hackysacks_edited.png

​A webcam mounted above the board allowed the robot to determine the location of the hacky sacks relative to the board using an HSV filter. Bright turquoise was determined easiest to detect with the HSV filter after testing 3 colors.

image.png

In order to calibrate the webcam frame to (x, y) locations, ArUco markers (black and white patterns, example shown above) were placed in known locations. Hacky sacks had to be observed in the same location (± error) multiple times before the location was used for scoring or retrieving​.

Gameplay and Error Handling

bottom of page