# Kunal's Robot Page

Welcome to Kunal's Robot Page! My robot can spin, move, draw pictures, and a lot more.

I'm an 18-year old freshman studying at USC. I've always had quite a passion for computer science and technology from a young age. I hope to delve into this great field during my four years at USC and I hope to become a great computer scientist. My other interests include reading, traveling, listening to music, and hanging out with friends.

Julio's Diary: Day 1. September 4th, 2012.

Today, four people took control over me and had me draw a strange shape. It took a little experimenting but eventually, I drew a successful shape known as the Tri-Force. I've attached a picture below.

I've also linked the other people's robot pages so you can take a look at what they're like.

Zach Vega-Perkins
Eric Strode
Phillip

Julio's Test!

Today I ran through some diagnostics. Everything checked out pretty well!

Today we had quite a challenge. We were required to draw a Fibonacci Spiral. Trashbot, a friend of mine, took it upon himself to do it and it looked pretty good! We determined the time it took to draw a quarter circle and also found out the ratios that we needed to draw it.

Zach Vega-Perkins
Shane Mileham
Joseph Boman

# Pre-Lab

1. The song I will sing for my performance is "Kids" by MGMT. This will be triggered at the beginning of the performance. Once the function performance is called, performance then calls the function song, triggering the song.

2. I'm going to draw a small house. This drawing will be triggered by the completion of the song. Once I complete the song, my human will place the pen in my slot and I will start to draw using the robot.forward and robot.turnLeft/Right commands.

3. For my surprise, I'm going to use the rand() function to choose a random number between 0 and 50. If this number is less than 10, I'm going to spin around in a circle. If it's greater than 10, I'm going to first check if anything is in my way using the getObstacle sensors. If nothing is in my way, I will dance. If something is in my way, I'm going to attempt to get out of the way but I will probably give up.

4. For my performance, I have it structured as follows: I will first check the battery levels, IR sensors, obstacle sensors, light sensors, and line sensors. If the battery level is greater than a certain number, the performance will commence. I'll start by calling the performance function, defined in the file "robPerformance.h". This file also contains the song(), drawHouse(), and surprise() function which comprises my performance. After the battery level are checked and performance starts, I will play the song first. After the song, I will draw the house, and finally, I will finish off with the surprise. After this, the robot will disconnect.

Here's a video of my performance! YAY!"

Video

For other robots, I've provided a zip for my code for the ROBOT PERFORMANCE. Make sure you download the header files as well!

## Lab 3: Braitenberg

Today, I learned a lot of new behaviors about Braitenberg behaviors. There are 4 different ones: Alive, Coward, Aggressive, and Timid. Here's the code that allows me to do it!

Here's the link to the cpp file.

This code first defines the functions for each different behavior. For timid, it first senses ambient light. Then, if it sees light, or the ambient light, it will go forward. If it enters a shadow, it will stop moving. If the shadow leaves, it will continue moving in a straight line. I use a switch to determine which function is carried out determined by the user input. They can enter numbers from 1-4 to choose which function they want me to execute.

## Homework 2: Robot Games

Prelab:

1. For the Opening Ceremony, my robot will be able to take user input (W, A, S, D) to go forward, backward, left, or right. It will travel to its respective position and then take another input to perform the fight song.

2. For the line following, my robot will use its line sensors to determine how to turn and when to turn. It will take the sensors into account and make sure it's on the line before proceeding on the line.

3. For the maze solver, my robot will use its obstacle and IR sensors in order to determine what is in front of it and when its blocked by an obstacle. This will allow it to turn when necessary.

4. For the drawing, my robot will attempt to draw the picture as fast as possible. This will be done by writing a program that allows for fast drawing by the robot.

5. For the overall structure, the robot will ask the user to input a number corresponding to a certain olympic event. Once the event is done, the user will be prompted again.

Perform-Shah.cpp Zach Vega-Perkins
Shane Mileham
Garv Manocha

## Arrays Lab

For this lab, we were able to make a playlist! Users could input songs they wanted in what order and I would play them. I could also do drawings and a lot of other stuff. Woohoo!

Robot Playlist

## Homework 3: Urban Search and Rescue

Prelab:

1. Our team's strategy for this USAR is to navigate through the disaster area, take pictures, edit the pictures by putting a green box, and then display the pictures in arrays. Our sensors used will be battery, light, IR, and obstacle to tell if there is a robot nearby. My algorithim is to display a menu for the robot and then allow the user to choose to navigate/take pictures, take pictures, edit pictures, show a picture, display unedited pictures, and display edited pictures. 2. For navigating, I will allow the user to input WASD for moving, P for taking pictures, Z for sensor readings, and X to exit manual navigation. 3. For locating lost scribblers, the robot will use its IR and obstacle sensors in order to tell if there is a robot nearby. 4. For our mapping, we will convene after exiting the disaster area and compare pictures and where we found the robots.

Urban Search and Rescue Zach Vega-Perkins
Shane Mileham
Joseph Boman

## Homework 4: Mars Rover

Prelab

1. My search algorithm goes through the picture horizontally (by columns). It searches for a range of RGB values that I determined by using a RGB color meter on my computer. It finds the first x and first y in which this color range is present, and finds the last x and last y.

2. My class Alien has several data members: firstX, firstY, lastX, lastY, width, height, and area. The function members are getters and setters of all of these variables.

3. My object recognition algorithim first goes through to find the color range of an alien. When this is found, it then sets a boolean, "onAlien", to true to signify that the search is currently on an alien. It also sets an integer, "betweenAliens", to 0. If the color range is not present, then betweenAliens is implemented for every pixel it searches that isn't in the color range. If this integer gets to greater than 3 times the height of the picture AND onAlien is true, then another boolean is set to true, "objectBroken". This signifies that I am now off the alien object. I then recursively call the function.

4. I started testing the algorithm with the picture with one alien so I knew I can correctly find one alien. Then, I did it with the one with two aliens so I can test out the object recognition.

5. My sorting algorithm was selection sort. I computed the area of each alien in each picture and then sorted the pointer of Alien objects. Selection sort divides the input list into two parts: items already sorted, and items remaining to be sorted.

6. My sorting algorithm was selection sort. I used the lastY in each picture and then sorted the pointer of Alien objects. Selection sort divides the input list into two parts: items already sorted, and items remaining to be sorted.

7. The big O of my sorting algorithm is O(n^2).

MARS Rover Code Zach Vega-Perkins
Shane Mileham
Joseph Boman

## Final Project!!

Prelab

1. For our final project, we wanted to have a topic that would engage middle school students. Middle school students are students who are tech-savvy as well as easily bored, so this topic could not be trivial. Picking this topic proved to be difficult, but we eventually found a topic we believed to be interesting, engaging, and exciting to carry out for these middle school students. Our topic is interactive experiences with the robot. These interactive experiences involve the students interacting with the robots, and the robots doing something that allows for the students to be involved. One example would be a visual tour of the USC campus using the robot’s picture-taking functions as well as its drawing functions. It would be able to show the middle school students a menu, for example, of areas of USC. The student could then pick what area they want to see a picture of and the robot displays a picture of that area. Another example would be the robot’s drawing functions and interacting with the middle school students to decide how many sides a polygon the robot will draw will have. Also, the robot could be like a keyboard—displaying a wide range of notes and the user choosing which note to play, and the robot playing the notes. The main point of interactive experiences is so that the middle school students can be engaged with the robots, as well as learning about what computer science can do. 2. My program will engage the user by prompting it for information such as user number, user name, age, grade, and it will store this info in a class. Then, it will prompt the user to enter the direction it wants the robot to go in as well as the duration the robot will travel. 3. My process for developing the human-computer interface was to think about how best the program could communicate with the user, and how it will allow for flexibility in terms of best user-computer interaction. 4. I will evaluate my human computer interface by asking the users to enter a rating of the things they encountered. Then, I will use this info to evaluate from a non bias perspective. 5. I will evaluate the user interaction by asking the users to enter of rating of the program they interacted with. Then, I will use this info to evaluate from a non bias perspective. 6. My program, after completing, will prompt the users to enter ratings for different categories. This will be read to a text file. 7. THe evaluation report will be the text file that was a reported by the users.

Code fetch

The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees