Jolie’s Status Report for 12/7

The past week, I’ve been working on the game state tracker and some integration tasks such as getting the camera to take pictures within our python program as opposed to just from the command line. Cody and I spent a good amount of time on this task that shouldn’t have taken so long. We were getting an error that the camera was busy and couldn’t take the picture. We ended up earning this was because we had initialized a cv2 camera instance we were thinking of using and forgot to comment it out.

I had already written the functions for most of the intricacies of the game state tracker, so the rest was just interfacing with the MQTT protocol that Denis set up. Today, we tested the whole system together and it went quite well. I found a couple bugs in the check_board function I had written in terms of calculating the start and end column for a horizontal word. But after fixing that, when we pressed the “Check” button on the individual player touch screen, we got the point total and validity back! We are still deciding the convention we put in place for submitting words, whether we should require a check beforehand or not.

I am glad at the place we are in now, and hopefully we can finish up the home stretch in a relatively smooth manner. I’ve been working on the final report for the past three weeks, editing from the design report, so I think we should get that done soon.

Jolie’s Status Report for 11/23-11/30

These past couple weeks, Denis and I put a lot of work into the user interface with the individual touch displays. It took some trial and error with the driver to get the desktop of out RPi 0s to show up on the lcd display (which was quite frustrating) but we ultimately got the desktop to show. The touch portion was touch and go (no pun intended) for a while where it would randomly work or not work on boot. We think we found the problem with a race condition on boot up that would sometimes permit the touch functionality and sometimes  not. Denis and I laser cut a box for the battery pack and buck converter to fit in. The display then rests on top of the box for a clean wireless look.

I made the front end of the user facing app user tkinter graphics where I made a keyboard, tile display box, player scores, “check”, “submit”, and “hint” buttons, and then ultimately a page for hint results. This will be how players interact with our system.

For this upcoming week, we really need to finish integration, mostly of the cv with the rest of the system. I think we are in a good place to have everything done by the demo.

It’s safe to say I gained a lot of new skills throughout my Capstone experience this semester. First off, I was able to write the hint generation algorithm from help from the article https://www.cs.cmu.edu/afs/cs/academic/class/15451-s06/www/lectures/scrabble.pdf. I spent many hours rereading this to understand how the backtracking algorithm worked and researched more into the ins and out of the directed acyclic word graph. Furthermore, I had no prior experience with tkinter graphics so I read specs and watched videos on how to make a simple app and then expanded on it from there.  Finally, when debugging the issues we were having with the RPi 0s, I read many posts from Raspberry Pi Forums from people who were having similar issues to us. Often times, it would take many iterations of Forums to find a possible fix, which gave me good experience of dealing with this type of hardware.

Team Status Report for 11/16

For verification right now, we are each testing our individual subsections, with a regression model of testing. For example, with our networked devices, we began by sending the most basic of packages, and ensuring that it was being received. Then, we began working on two way communication, having device A send data to Device B, having Device B manipulate it and then sending it back to Device A. Then we would build to having multiple devices networked, with a main device operating as a broker. Now the packets contain IDs of the device that the message is addressed too, and our receiving devices interpret these packets to determine if they are for them.

In terms of validation, once we integrate all our subsystems, we plan on tracing a picture taken with the RPi Camera through our system as it gets translated into a 2D array, validates words and calculates score as well as outputting the result to the main LCD display. We will manually check along the way through print statements that the board is updated properly. Additionally, we plan on testing the system in various lighting scenarios to ensure that the ring light is sufficient for proper lighting of the board and tiles.

In our design report, we mentioned having a focus group of individuals play Scrabble with Scrabbletron so we can determine whether our updates really improve the Scrabble playing experience. We plan on running this study once we have a working system after integration.

Jolie’s Status Report for 11/16

This past week I wrote and debugged functions for validating a new board and calculating the score for that new move. The check_board function takes in the board with the possible new word placed in it and a list of the squares that tiles were just placed (should be in order left to right or up to down). The function find the new board made, looks it up in the dawg (much quicker look up time than a simple linear search in the dictionary). If it’s not in the dawg, the function returns a tuple of (False, 0), meaning it’s not a valid word and scores 0 points. If it is a word, the new board, start and end position of the word, and tiles added are passed into the calculate_score function I wrote which only includes the score and letter multipliers for tiles that are newly placed (accoding to official Scrabble rules). The total score for the new word is updated in check_board. If the placed word is horizontal, the function goes through each letter and does word validation and score updating on the new word made vertically if there is one, and vice versa for a vertical main word.

Denis has been able to refactor my hint logic and put it on the Pi for communication with the Pi 0s. This will be used for our demo next week.

I completed my tasks on time so far, and in the coming weeks, I will pick up some integration tasks in terms of interfacing with the LCD displays and interfacing the output of Cody’s cv with the input of the check_board function.

Verification:

For the scoring, I ran tests where I placed different words (horizontal and vertical) on the board (2D list) and verified that the computed score was correct. I also varied the “tiled_added” list so make sure that letter and word multipliers weren’t added to already filled in squares. I did a similar practice with the check_board function.

For the hints algorithm, I used a unit testing approach where I tested each function on it’s own before testing the whole hint generation since it is a complex algorithm. Timing wise, the hint generation takes about 0.05 seconds on my computer. On the Pi, processes seem to run 8 times slower, but this is still well within our time allotted of 1.4 seconds (design requirement).

Team Status Report for 11/9

Hardware Info:

RPI SSH cheatsheet: how to ssh into an rpi on CMU-DEVICE:

  • ssh username@IP

how to reboot rpi:

  • sudo shutdown -r now

MQTT communication format:

  • Index 0: Sender ID
  • Index 1: Receiver ID
  • Index 2: Task ID
  • Index 3-end: Data

 

This week, we interfaced the wireless communication and the hint logic, creating a basic setup where given a board state on the main Pi and a tile rack on the Rpi0, we can generate all of the possible words on the main Pi and send it back to the Rpi0. We also created a communication system that will standardize all of the communication that we will do between devices.

Jolie’s Status Report for 11/9

Last week, I finished up the hint logic, fixing some of the last little bugs as well as generalizing the algorithm to the vertical direction. Denis is now able to run the hint logic on the main RPi and can send receive hints with the RPi0s.. Also, I set up the gooseneck camera mount. I laser cut a platform (rectangle with four holes in it so that I could zip tie  it to the top of the camera mount we bought). I then was able to clip the ring light onto the platform. The RPi and RPi camera rest on the platform and the camera is looped through the ring light. The picture below is what the mount + platform looks like (without the RPi on it). The other picture is what I took from my phone camera. Just from that, we can see how the ring light really helps eliminate shadows that we were seeing before.

Last week, I wrote a preliminary scoring function where letter and word multipliers are taken into account (but haven’t tested it yet). This upcoming week, I plan on testing the scoring function as well as writing the function that takes in the newly placed tiles and validates/scores all the newly created words.

After this week, I feel more confident that we are running on schedule, but we must not let up and finish strong this last month of the semester.

 

Jolie’s Status Report for 11/2

This week I made a lot of progress with the hint generation. Right now, we can find all the horizontal words possible given the state of the board and rack. There is still one bug that I need to fix dealing with anchor squares which also have a filled square to the left. I just need to remove those anchor squares from the anchor list so that invalid words don’t propagate through, which shouldn’t be hard to fix. I also need to generalize the algorithm to the vertical direction. The hard part was already done in the horizontal direction, so the vertical functions should be easy to implement as they are just the transpose of the horizontal functions. Shown below is a snippet of the list of valid words, along with there start and end square, that the backtracking function returns.

 

Jolie’s Status Report for 10/26

Last week, I mentioned I was a bit behind on hint generation. I was able to catch up this week and made some good progress. Shown in the attached file, I added a function which updates cross-checks after a word is played. The next step is to implement finding prefixes and suffixes given an anchor square. I need the data structure of the language for that. The article we are basing the algorithm off uses a Directed Acyclic Word Graph. I found an open source implementation of the DAWG and will discuss will discuss with the team tomorrow when we meet what the think of using it.

Team Status Report for 10/26

We forgot to put these FSM diagrams in our Design Report. We wanted to document them here to eventually edit and add to the Final Report.

 

 

As of right now, the hardware part of our project is slightly behind. We have one Raspberry Pi communicating with my laptop, which was slightly behind our goal of having two of the Raspberry Pis communicating with each other. This is just a result of a congested schedule this week and hopefully we should be back on pace by next week. Luckily, nothing is super dependent upon the hardware right now so it does not pose much risk to our overall project.

Team Status Report for 10/19

There were no changed made to the existing design of the system in the past two weeks. Shown below are some of the processed images of words on a Scrabble board that Cody used to find the contours of letters. As he noted, some of the curve-less letters are harder to pick up.

Part A (Written by Denis): Scrabble is a global board game, with over 150 million copies sold all-time. This means that most people are at least tangentially aware of what Scrabble is.  We are attempting to make our project have a global use case by using low cost materials and portable, common power sources. The only major difference that we would have to make would be adjusting the plug that we put into the outlet, as that changes depending upon where you are in the world. If we were to create this as a world-wide product, we would have to adjust the powering of our main RPi, in order that it could work overseas. Another consideration we have made would be for those who are more unfamiliar with tech. If we were to create this as a product for consumers, we would likely send it as close to being ready as possible, and with a detailed user manual for setup/calibration.

Part B (Written by Jolie): Scrabble is sold in 28 different languages across the world. Those 28 languages encompass a large portion of the world’s population. Although our project is geared towards the English version, all that would need to be done differently is to use a different letter recognition library that can interpret characters from various languages and a Scrabble dictionary in that language. Aside from that, Scrabbletron would be versatile enough to be used in any other country where one of those 28 languages is spoken because the rules of the game remain the same. Across these languages, the need for an aid to the administrative tasks of Scrabble persist, so our project will meet these goals in any language.

Part C (Written by Cody): While we have not identified any serious environmental concerns, there are a few considerations to make for a project like ours. First, our system uses power for the CV computation and LCD displays. The plant generating this power could certainly have environmental impacts, so it’s important to make our system as energy-efficient as possible by writing quality code. Secondly, we have considered the impact of the physical materials our system uses. We are introducing multiple electrical components to the standard Scrabble setup, some of which (like the displays) have batteries which could be environmentally harmful if disposed of improperly at the end of their life cycles. One marginal improvement we’ve made to limit the physical materials is the switch to wireless communication.