After the game "Stray" came out, I wanted to cosplay one of the Companion robots. My first attempt was Momo using a gamepad to control the animations, but then I got the idea of creating Morusque and using the guitar prop and a Raspberry Pi to animate the face - and I made it happen!
In my version of this cosplay, I created a guitar prop and put the raspberry pi's speaker inside it and the other electronics velcro'ed to the side. The face contains an iPad Mini on which I use two apps: Pi Helper, and a VNC Viewer, to run a virtual desktop for the Raspberry Pi. The iPad Mini is essentially a wireless monitor and I find this helpful for freedom of movement. But there's no reason you couldn't use a wired monitor and do the same thing. Use the Pi Helper to open a terminal and run the vncserver application, then use the VNC Viewer on the iPad to open the virtual desktop and run the program.
I used an online app called Piskel to create sprite sheets for the different face animations. The sprite sheets are attached in the file section! The sprite animation class in the code makes it easy to run the face animations according to different button presses and inputs. Just make sure your frames in the sprite sheet are arranged horizontally and are each 64x64. I used a Sprite Sheet Animation class found on the Pygame wiki - the author was not named.One last note on the sprite sheet animations - your frame rates may vary, so you might find you have to change them! Connecting to the Pi via the remote desktop was a little laggy, so I increased the animation frame rates by a lot. You may find they're a little fast! Adjust as necessary!
This project triggers different face animations if you press buttons, or if you scan certain RFID cards on the card reader. Morusque is a musician in Stray who plays music if you bring them music sheets. So in my version, I laminated music sheets with RFID cards inside. You can bring me a music sheet, and I will tap it on the RFID reader and the corresponding song will play. To get the RFID reader to work, you'll need to install the library - you can find it, along with instructions, here! https://pimylifeup.com/raspberry-pi-rfid-rc522/
I used a Sparkfun Pi Wedge to connect to the GPIO pins, but you could connect to the pins directly. The circuit diagram will show connections to the Pi Wedge.
Here are the controls:
White button (Pin 7, GPIO 7): Love animation and Meow Sound
Green button (Pin 37, GPIO 25): Talking animation, then random song plays with music animation
Blue button (Pin 29, GPIO 21): Cancel whatever animation is running and go to idle animation
Red button (Pin 13, GPIO 13): Quit the app
RFID cards are encoded with the titles of the eight songs Morusque plays: "PetiteValse", "LonelyRobot", "Untitled", "Compute", "Tomorrows", "CoolDown", "Mildly", "Unreadable"
Video of the mostly-finished product in action!
Comments