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](https://static.wixstatic.com/media/c32fb7_add78cf46d5a495ab4fcc116e259e258~mv2.jpg/v1/fill/w_600,h_394,al_c,q_80,usm_0.66_1.00_0.01,enc_auto/ME134_game_JPG.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](https://static.wixstatic.com/media/c32fb7_7faff1327435458289d43b350a2581f8~mv2.png/v1/fill/w_485,h_304,al_c,q_85,enc_auto/me134_throwercad_edited.png)
Receiver
![me134_receivercad_edited.png](https://static.wixstatic.com/media/c32fb7_8d124a2011a14da78fdf86a9277ed0a5~mv2.png/v1/fill/w_254,h_322,al_c,q_85,enc_auto/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](https://static.wixstatic.com/media/c32fb7_78d4b5f072fb45a6ad7c820dea5e808b~mv2.png/v1/fill/w_258,h_242,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/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](https://static.wixstatic.com/media/c32fb7_cee5bc2128ee4a349e206455f470a47f~mv2.png/v1/fill/w_126,h_126,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/c32fb7_cee5bc2128ee4a349e206455f470a47f~mv2.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
![](https://static.wixstatic.com/media/c32fb7_3902a0fd99e84bc7b292d8173071839a~mv2.jpg/v1/fill/w_884,h_497,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/c32fb7_3902a0fd99e84bc7b292d8173071839a~mv2.jpg)
![](https://static.wixstatic.com/media/c32fb7_f8626954e17d4a9a99551e90586337d9~mv2.jpg/v1/fill/w_884,h_497,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/c32fb7_f8626954e17d4a9a99551e90586337d9~mv2.jpg)
![](https://static.wixstatic.com/media/c32fb7_a72a54f346a1459d825bb8de11139030~mv2.jpg/v1/fill/w_884,h_497,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/c32fb7_a72a54f346a1459d825bb8de11139030~mv2.jpg)