Skip to content

knosmos/robowordle

Repository files navigation

RoboWordle

Playing Wordle with Computer Vision and a 3D Printer

robowordle_demo.mov

Capabilities

  • Precise 3D printer movement
  • 3D printed stylus holder and camera mount for keypresses and image acquiration
  • Fiducial detection and dewarping to make system robust against suboptimal camera position / angle
  • Image processing with OpenCV for color identification

Installation

This project is not designed for widespread use, but if you do want to make it, here are the setup instructions.

Dependencies

  • opencv-python
  • printrun
  • numpy
  • pyserial

Assembly

  1. Print out the fiducial sheet (must be original size, otherwise the scale will be wrong) and attach to 3D printer
  2. Attach stylus to the print head (I designed this mount, but it will differ depending on the printer and stylus you use). Note that the stylus must be in contact with a sufficiently large conductive object for the capacitive touch to work (I used an alligator clip attached to the printer frame)
  3. Mount the camera (placement does not need to be precise as long as all four fiducials are clearly visible).
  4. This step is only necessary if you are calibrating for a device that has dimensions different from my iPhone 6.
    • Place the phone on the fiducial sheet and run dewarp.py; this will produce a dewarped image like this: dewarped
    • Run testing/marker.py to determine the location of each key. Click each key on the in order to mark the position; once all 27 keys (delete key is not used) are selected, copy-paste the positions to config.py
    • Run testing/grid_finder.py - click the top-left and lower-right corners of the Wordle grid, then copy-paste the positions to config.py as well.
  5. Connect the 3D printer to your laptop and run printer_control.py. This will allow you to directly interface with the printer via G-code commands. Slowly control the printer until the stylus head is exactly positioned over the lower-left corner of the lower-left fiducial. Make note of the X and Y values of the printer, and edit the respective values in config.py.
  6. Cross your fingers and run main.py.

Future plans

  • automatic end-of-game detection
  • more robust color detection
  • support for more devices

License

MIT

Releases

No releases published

Packages

No packages published

Languages