Tutorials
July 17, 2023

How we built the robotic claw game for ICRA

Written by
Anya Ramamurthy
Growth Marketer

When's the last time you tried your luck at a claw arcade game? There's that thrill as you navigate the claw overhead then watch it descend toward a prize. And the moment you snag one—it’s cheers all around! 🙌

Our team channeled this classic joy into building a robotic claw game that was a hit at our GA launch party and drew crowds everyday at ICRA this year. In this post, we’re pulling back the curtain to share how we built our robotic claw game using Viam and what we learned along the way.

Have a cool idea for an arcade-style claw game? You can build one yourself and customize it however you like! Check out our tutorial for building a robotic claw game with a Raspberry Pi.

How we built the robotic claw game 🦾

Inspired by a classic

Our motivation was simple: we wanted to build a cool robotic experience for our community events—something fun and interactive that also showcased a range of Viam’s capabilities for building and deploying robots.

The nostalgia and classic thrill of an arcade-style claw game immediately came to mind, with fun Viam swag or a Viam Rover as prizes!

An early concept sketch for the game

And the game wouldn’t just bring smiles to folks’ faces, it’d also demonstrate using Viam to:

  • Implement motion planning: Planning the robotic claw’s movements using Viam’s Motion Service

A collaborative and composable design

Imagining the fun we'd have both building and seeing it in action, our team got started eagerly! Three of our Developer Advocates—Hazal Mestci, Arielle Mella, and Matt Vella—collaborated and brought their unique skills to the table.

Hazal configured the robotic arm and wrote the Python code for planning the arm’s movements; Arielle came up with the game design, created the original concept sketches and designs, and developed the TypeScript game user interface; and Matt focused on building the physical game enclosure, integrating the gripper mount, and finetuning the TypeScript interface.

Building the game base

Glue is handy and fun to use

Since you can securely control robots from anywhere with Viam, it was easy for the team to collaborate on building and testing different pieces of the claw game whether at the office or at home. 

Another massively helpful aspect of using Viam was the flexibility to iterate on each piece of the robot without impacting or redoing other pieces. For example, Hazal could update the configuration of the arm without worrying about changing the code for planning the arm’s motion.

Placing and integrating the robotic arm

This flexibility also made it seamless to extend the functionality of the robotic claw game. Using Viam, the team could easily update the robot's configuration to support additional functionality without needing to change other parts.

For example, the user interface for an earlier version of the game allowed players to move the claw in the standard directions (left, right, back, and down).

Noticing this would sometimes take a while depending on where players moved the claw, the team implemented motion planning for the arm and updated the game interface to improve the game experience.

Now players could pick an area in the game enclosure for the claw to move to itself, and then they could adjust the claw manually in that space to narrow in on a prize.

Advanced version of the game interface

Viam’s approach for building composable robotic systems meant that with only three people on the project, the team could build the game from scratch in just two weeks!

The process for building the robot

Here’s a quick walkthrough of the process our team followed to build the robotic claw game. Want to build your own? Check out the full tutorial here.

Viam components & services:

Shopping list:

Steps:

  1. Build the claw game table and “cage,” and fill it with prizes to pick.
  2. Mount the xArm 6 in the center of the table.
  3. Attach the claw as the arm end effector. Neatly run the cables along the arm and secure loosely with velcro ties.
  4. Wire the relay to the claw and Raspberry Pi, and connect the 24v power supply to the relay.
  5. Create a new robot instance in the Viam app, and connect it to your laptop with viam-server.
  6. Visually configure and test your board, and arm components in the Viam app.
  7. Test the claw mechanism by triggering the GPIO pin connected to the relay.
  8. Visually configure and test the Motion Service in the Viam app. You’ll use this to control the arm to allow for constrained movement that provides an arcade-like experience.
  9. Copy and test with the controlling code script. Modify it as desired.
  10. Run the TypeScript package, and play the claw game from the tablet touchscreen.
  11. Throw a claw game party or play until you win—no quarters required!

Seeing the game in action ⚡️

The first real test of the claw game came during our GA launch party! It was exciting how much the game added to the atmosphere of celebration, and we gained valuable feedback from seeing how people interacted with the game throughout the evening. 

Based on this feedback, we refined our robot’s design to create an even more engaging and seamless experience at ICRA—and our efforts paid off! There were lines for the game throughout each day and some players even came back multiple times. See it in action here!

Playing the game together at ICRA

It was a joy to witness the camaraderie among participants who helped each other out and celebrated together when someone won a prize 🙌

As an experience that brought people together, the game was more than just a fun activity—it was a way to share the sense of curiosity and community that’s inherent to the world of robotics.

What our team learned 💡

From smaller adjustments to larger takeaways, our team learned plenty along the way in building the claw game. Here are some highlights:

  • The importance of rapid iteration and flexible design
    Our team was able to take the robotic claw game from an idea to a prototype in less than an hour—using Viam to easily configure robot components and services made all the difference in speeding up the prototyping phase. The claw game also underwent various modifications based on feedback from testing it with teammates and folks at Viam’s GA launch party. By learning from players’ experiences and using Viam to flexibly make changes, our team was able to make the game a hit at ICRA!
  • Learning skills in new areas:
    As often the case with robots, building the claw game required a diverse set of skills. Learning new skills together was a rewarding experience for folks on our team—whether it was trying new fabrication techniques or implementing a new software service.
  • The power of simplicity:
    In an earlier iteration of the claw game, the team found that the gripper had a hard time picking up and carrying different sized Viam t-shirts (one of the swag prizes). The team shifted to using Viam stress balls instead to simplify the gripping process and make the game more playable.

We also had fun thinking about some interesting ways to expand or evolve the game:

  • Using an ML model to determining grab success rate and create a score counter
  • Designing a hard mode in which the prizes are shuffled around with the arm after every few attempts

What ideas do you have for a fun robotic claw game? Share with us and other robotics enthusiasts in our Discord community.

Thanks for following along our journey! For our team, it was truly a prize to see the joy and excitement on the faces of all the game’s players 🌟


On this page

Get started with Viam today!