Inspiration

We wanted to take the Twitch Plays series to the next level by allowing the chat stream to interact with hardware. Projects like Twitch Plays Pokemon brought together over one million people and we hope to emulate this for hardware.

What it does

This allows users from anywhere in the world to join the Twitch stream, join a team, and start battling in one of two games by entering 'f','b','l',or 'r' for forward, back, left, and right, respectively.

  • Sumo - The team whose car exits the arena first loses.
  • Capture the Flag - The team whose box gets toppled first loses.

Two modes support each game:

  • Democracy: The script listens for many commands and "averages" them to produce a command for each bot.
  • Anarchy: The script will push each command directly to the respective bot.

All modes are fully operable with Twitch chat and computer vision.

How we built it

The construction consists of a python script that mines chats from the channel via Twitch's Internet Relay Chat server and ensures that teams are balanced. The script passes movement information to an Arduino module that sends signals two the dismantled remote controls of the cars and tilt sensors. A webcam sits on top of the inverted wooden U-Frame that we built and captures the entire fight. Along with being helpful for streaming the fight to anyone in the world, the webcam also runs the computer vision algorithm, which can classify each bot to its respective team and determine when it exits the ring.

Challenges we ran into

OpenCV proved to be particularly challenging given inconsistent lighting and the moving objects. Integrating all of the components also was a major hurdle, as we eventually needed to use threading and transfer information between the threads.

Accomplishments that we're proud of

Our team is very proud of the cohesion of every complex aspect and the way it integrates an existing web service with our own hardware.

What we learned

This project reinforced the process of compartmentalizing different components of the project in order to ensure that the entire process can work when one portion of a script is changed. Allowing eachother to abstract different aspects of the project allowed us to hit the ground running quickly and rapidly develop a prototype. We also developed a working understanding of serial communication. Lastly, we effectively learned which aspects of the project to build (like the frame, the scripts, the wiring, etc.) and which components to abstract, like the radio communication of the remote controls.

What's next for Twitch Plays Battle Bots

Self resetting and automation. More games such as soccer.

Built With

Share this project:

Updates