Mars Roverbot - An Exploration into Ruby Programming
TEAM: mary tsai
class: programming for online prototyping
DURATION: 3 weeks
Build a simple but useful personal chatbot that you can talk with through SMS. The chatbot should be created using the Ruby programming language and show distinct personality.
Curiosity is the current active Mars Rover and it’s goal is to investigate the Martian climate and geology, assess the environmental conditions of the Gale crater for microbial life and water, and perform habitability studies in preparation for human exploration. You can talk to Curiosity through this chatbot and ask it how its day was, ask questions about Mars, and see if it will send you photos that its taken. All of Curiosity’s responses should feel much more anthropomorphic than a normal robot’s and you should be able to learn about Mars through his curious and optimistic personality.
There is currently an existing Curiosity chatbot but it's extremely robotic and supplies facts in a very monotone way. I wanted to impart a personality into this robot that emphasized how it is the only active being on an entire planet. I utilized the NASA API to call interesting photos of Mars but I mostly wanted the bot to be a fun educational tool that could potentially be used by teachers to engage students' interest in Mars.
The chatbot itself is quite simple but there are three main components to it:
You can ask Curiosity how its day was, and what it did
You can ask Curiosity questions about Mars (e.g. how far is Mars from me?) or ask it to tell you some interesting facts about Mars
You can request photos that Curiosity has taken and it will supply you with a picture taken by an individual camera on a specific date
The most difficult part of the chatbot was implementing the NASA API to retrieve the photos.
The code below shows how to call the NASA API to provide a picture.
NASA asks for a specific rover, camera, and sol date to retrieve a photo and I wanted to keep it general, so I needed to request a random sampled picture.
The code to the right demonstrates retrieving the photos and supplying a random photo to you. I also supplied a message that described what camera and sol date it was taken on but all the photos are taken from the Curiosity rover since that’s the one you are talking to.
With the API called, the rest of the chatbot just needs some fine tuning to insert personality and make sure there aren’t too many hiccups; for example, I knew that when replying with text from a .txt file, I didn’t want it to repeat the same phrase again so just inserting sessions into the code makes it feel more smooth.
Also, interactions like waiting or pausing for you to answer a question are crucial. I implemented a simple game of I Spy, but it’s nice to be able to allow a guess to happen before supplying an answer.
Below shows an extremely simple user flow for Curiosity, which consists of 3 main actions that you can do. There is also a repertoire for easter eggs, that should showcase Curiosity's personality a bit more; however, those are only accessible through random chance. The easter eggs are provided because I wanted to try to have more engagement from the user as an exploration tool.
After implementing the main code, I simply had to create the personality through conversation. Curiosity is a hard-working rover who does mostly the same thing each day but it also barely moves. However, for such a mild-mannered rover, it also has a rock-vaporizing laser on the top of its head so I enjoyed putting in some easter eggs that showed a slightly vicious side of Curiosity.
Since Curiosity is the only active thing on Mars, I also wanted to have add some loneliness come through in dry humor. Overall, its personality is quite optimistic and it is also really happy to be talking to you, but instances such as below show off his slightly sarcastic side.
The hardest part was trying to make Curiosity’s dialog feel natural. Ideally, if I had more time, I would want to implement Google’s Natural Language Processing API. Because I was not able to include that this time, I had to essentially try to cover a lot of potential questions by building it into the code. The wizard of oz and user testing sessions were helpful because I was able to see what kinds of questions people would want to ask the Rover. Most of the time, they were scientific questions like “how big is Mars?” but once the user learned more about the personality of Curiosity, they would start asking questions that were more related to him, such as “what’s your favorite thing to do” or “who from Earth would you want to join you?”.
As mentioned above, if I had time, I would want to implement Google's Natural Language API. Since the main objective of the chatbot was to infuse a sort of anthropomorphic relatable personality into the Rover, the NL API would have been really helpful.
I also would want to make sure that the easter eggs are more apparent to the user. Right now, I supply a list of things that you can ask about, but if you deviate from that path, you may or may not get a surprising/fun answer. Ideally, I would want to always have an answer and almost never show the error message, but it's difficult to anticipate what users will ask. If I had more time, I would do multiple rounds of user testing and see what different people want to know - especially coming from a kid, a teacher, a regular working adult, etc.
Overall, I was pleased with outcome of the chatbot, and would hope that it could be some sort of educational tool that would engage and entertain people who would like to learn more about Mars.