Dallas Christian Heyden

This web page is to document my experiences through college. Currently I am attending USC as a Computer Engineering major. I also partake in the Air Force ROTC program. I enjoy snowboarding, surfing, hiking, and hanging out with good friends. This is my first time creating my own personal website. So, tune in and I will try to update you as frequently as possible.

My Robot:

My robot's name is Yoda. He can do lots of things including: drawing, spinning, and turning, and such. During his free time, he trains the most powerful jedi warriors in order to fight for peace.

My Facebook

Lab 1 with Partner: Andrew Yocca

In this exercise, Andrew and I commanded his robot, Crush, to draw a star on a piece of paper. It was so fun!

Lab 2

My Output
getLight: 64400
getIR: 1, 1
getBattery: 7.07818
getObstacle: 0, 0, 0

Lab 3 With: Tanner Zigrang and Andrew Yocca

In this lab we tested the various sensors that Yoda has. For example, we used the line sensor . The line sensor was able to show that Yoda was either on a dark surface or light surface. Based on the given information, we used if and while commands to give Yoda things to do if he was on a light surface or dark surface.

We also utilized the obstacle sensor, and if there was an obstacle that Yoda detected, he would then move in the opposite direction. Therefore, Yoda successfully utilized both his line and obstacle sensors.

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
Lab 4 With: Andrew Yocca, Michael Ciesielka, and Jon Goodheart

In this lab, Michael, Andrew, Jon and I worked on both the Fibonacci circle, and the Fibonacci equation. We used the equation in order to evaluate possible outputs, and thus create commands for our robots to carry out the Fibonacci circle.

Robot's Got Talent:

#include #include #include #include #include using namespace std; int main(int argc, char ** argv) { // robot.forward(1,5);// //cout< 4500) { robot.beep(5,800); wait(2); } while (robot.getLine()[0] == 1) { robot.beep(.5,800); wait(2); } robot.beep(0.1,750); robot.beep(0.1,800); robot.beep(0.1,800); robot.beep(1.0,950); wait(.1); robot.beep(1.2,1000); wait(0.1); robot.beep(0.1,750); robot.beep(0.1,800); robot.beep(0.1,800); robot.beep(1.0,950); wait(.1); robot.beep(1.2,900); wait(0.1); robot.beep(0.1,750); robot.beep(0.1,800); robot.beep(0.1,800); robot.beep(1.0,950); wait(.1); robot.beep(1.2,900); wait(.1); robot.beep(0.1,750); robot.beep(0.1,800); robot.beep(0.1,800); robot.beep(1.5,600); wait(.1); robot.beep(0.1,750); robot.beep(0.1,800); robot.beep(0.1,800); robot.beep(1.0,950); wait(.1); robot.beep(1.2,1000); wait(0.1); robot.beep(0.1,750); robot.beep(0.1,800); robot.beep(0.1,800); robot.beep(1.0,950); wait(.1); robot.beep(1.2,900); wait(0.1); robot.beep(0.1,750); robot.beep(0.1,800); robot.beep(0.1,800); robot.beep(1.0,950); wait(.1); robot.beep(1.2,900); wait(.1); robot.beep(0.1,750); robot.beep(0.1,800); robot.beep(0.1,800); robot.beep(1.5,600); for (int n=1; n<=3; n++) { robot.beep(.25,1500); wait(.25); robot.beep(.25,500); robot.beep(.25,500); robot.beep(.25,1000); wait(.25); robot.beep(.25,1000); wait(.5); robot.beep(.25,1500); robot.beep(.25,1500); } if (robot.getLight("center") > 60000) { robot.motors(1,0); wait(5); robot.motors(0,1); wait(6.28); robot.motors(1,0); wait(1.5); robot.motors(1,0); wait(2.5); robot.stop(); } for (int n=1; n<=15; n++) { int random= rand() % 3800; random= random + 200; robot.beep(.5,random); } if (robot.getIR()[0] == 1) { robot.beep(2,1000); robot.beep(1,500); } else robot.beep(5,1000); if (robot.getBattery() > 6.8) { robot.beep(10,500); } wait(5); disconnect(); return 0; }

ROBOT GAMES:

1. Write a description of your robot’s performance for the Opening Ceremony. What is your algorithm and sensors used for this event?

For the Opening Ceremony, Yoda will be contributing to the formation of the 'U' in USC by using keyboard commands.

2. Write a description of your robot’s Line Following behavior. What is your algorithm and sensors used for this event?

Yoda will constantly evaluate position using the line sensors, and adjust using motors commands, based on its position over the dark line.

3. Write a description of your robot’s Maze Solving ability. What is your algorithm and sensors used for this event?

The robot starts by moving forward, and using the obstacle sensor it will see if there are objects in the way. If an object is in front of the robot, the robot will then turn 90 degrees, check the obstacle sensor again, and if there is an object, proceed to rotate 180 degrees. This will allow the robot to avoid all obstacles.

4. Write a description of your robot’s Fastest Drawer behavior. What is your algorithm and/or sensors used for this event?

The robot starts by drawing the center triangle and then draws each individual triangle. These individual triangles are drawn through 60 degree turns and no lines are traced over.

5. Write a description of what is your algorithm for structuring your robot team’s behaviors.

What we did was establish the above functions outside of the main function as void functions, and called them in the main function.

CODE:

#include #include #include #include #include using namespace std; const int MAX = 20; int drawlist[MAX]; void infinity() { robot.motors(1,0); wait(5); robot.motors(0,1); wait(6.28); robot.motors(1,0); wait(1.5); robot.motors(1,0); wait(2.5); } int fib(int n) { if ( n == 0 || n == 1 ) return n; return fib(n-1)+fib(n-2); } int fibFor(int n){ if(n==0 || n==1) return n; int value1 = 0; int value2 = 1; int nextValue = 0; for(int i = 2; i< n; i++) { nextValue = value1+value2; value1 = value2; value2= nextValue; } return nextValue; } //Yocca's Triforce Drawing void triforce() { double x = 0.5; double y = 1.02; int z = 1.0; wait(1); robot.forward(z,y); robot.turnRight(z,y); robot.forward(z,2*x); robot.turnRight(z,y); robot.forward(z,2*x); robot.turnLeft(z,y); robot.forward(z,x); robot.turnLeft(z,y); robot.forward(z,x); robot.turnRight(z,y); robot.forward(z,x); robot.turnRight(z,y); robot.forward(z,x); robot.turnLeft(z,y); robot.forward(z,x); robot.turnLeft(z,y); robot.forward(z,3*x); robot.turnLeft(z,y); robot.forward(z,x); robot.turnRight(z,y); robot.forward(z,x); robot.turnRight(z,y); robot.forward(z,x); robot.turnLeft(z,y); robot.forward(z,x); robot.turnLeft(z,y); robot.forward(z,3*x); robot.turnLeft(z,y); robot.forward(z,x); robot.turnRight(z,y); robot.forward(z,x); robot.turnRight(z,y); robot.forward(z,x); robot.turnLeft(z,y); robot.forward(z,x); robot.turnLeft(z,y); robot.forward(z,2*x); } /* void star() { robot.forward(1.0,1.0); robot.turnRight(1.0,1.25); robot.forward(1.0,1.0); robot.turnRight(1.0,1.25); robot.forward(1.0,1.0); robot.turnRight(1.0,1.13); robot.forward(1.0,.97); robot.turnRight(1.0,1.2); robot.forward(1.0,1.1); } */ void instructions(){ cout<<"w to go forward"<>move; switch (move){ case 'w': robot.motors(1,1); break; case 'q': robot.motors(-1,1); break; case 'a': robot.motors(-.5,.5); break; case 'e': robot.motors(1,-1); break; case 'd': robot.motors(.5,-.5); break; case 's': robot.motors(-1,-1); break; case 'f': robot.motors(0,0); break; case 'i': instructions(); break; case 'x': return 0; default: cout<<"Please enter a valid input: Hit i for instructions"< 4500){ robot.motors(-.25,-.25); wait(2); robot.motors(-1,1); wait(.825); robot.motors(.5,.5); for(int n=0; n<75; n++){ if(robot.getObstacle("center") > 4500){ robot.motors(-.25,-.25); wait(2); robot.motors(-1,1); wait(1.63); break; } } } } robot.stop(); }

HW s Assignment:

Pre-Lab

1. Write a description of your team’s USAR strategy. What is your algorithm and sensors used for this task?

Our strategy is to search for robots spread out across the room. We will take a picture and try to find where the robots are.

2. Write a description of your robot’s performance for navigating through the mock disaster area. What is your algorithm and sensors used for this sub-problem?

I will navigate my robot using my input. My algorithm involves checking all the values of each sensor. From there, I will be able to avoid any obstacles.

3. Write a description of your robot’s locating lost scribblers behavior. What is your algorithm and sensors used for this sub-problem?

I will be taking pictures with myro. I can analyze these pictures and estimate where the other robots are.

4. Write a description of your team’s mapping strategy. What is your algorithm for this task?

Our plan for mapping will be to take pictures and estimate where the disaster obstacles are. By having this outline, we will be able to compare the location of objects in the room to robots.

#include #include #include #include #include #include #include using namespace std; vector allPictures; vector robotPictures; void drawing(PicturePtr pic) { cout << "Height of picture: " << getHeight(pic) << endl; cout << "Width of picture: " << getWidth(pic) << endl; int minHeight; cout << "Predict top pixel value of robot" << endl; cin >> minHeight; int maxHeight; cout << "Predict bottom pixel value of robot" << endl; cin >> maxHeight; int minWidth; cout << "Predict left pixel value of robot" << endl; cin >> minWidth; int maxWidth; cout << "Predict right pixel value of robot" << endl; cin >> maxWidth; for (int i=minHeight; i> answer; if (answer == 1) { drawing(pic); } return pic; } void slideshowAll() { for (int i = 0; i < allPictures.size(); i++) { show(allPictures[i]); } } void slideshowRobots() { for (int i = 0; i < robotPictures.size(); i++) { show(robotPictures[i]); } } void instructions(){ cout<<"w to go forward"<>move;//asks for a user input switch (move){//determines which action to take. case 'w': robot.motors(1,1); break; case 'q': robot.motors(-1,1); break; case 'a': robot.motors(-.5,.5); break; case 'e': robot.motors(1,-1); break; case 'd': robot.motors(.5,-.5); break; case 's': robot.motors(-1,-1); break; case 'f': robot.motors(0,0); break; case 'g': sensors(); break; case 'p': snapshot(); break; case 'i': instructions(); break; case 'x': return 0; default: cout<<"Please enter a valid input: Hit i for instructions"<

HW4: Mars Rover Pre Lab

1. My search algorithm searches the picture, finding color values that match the color values of the alien. Once it finds these color values, it will use recursion to check the 4 surrounding pixels to see if they also match. Once a pixel is checked, it will then be marked. The program will then proceed to search the picture, but now bypassing the marked pixels. 2. Data members: mark sortSize sortLocation In my class Alien, I run one part of the recursion process, which I previously mentioned. Also in my class, I sort the size of the alien pixels, and their location. 3. I simply judged the differences in RBG values within the pictures, and saw that the aliens had very high green values, which was an indicator of their presence in the picture. 4. I started with mars4 because the color values for the aliens were the most diverse, so if the algorithm were to work on the pictures, it had to work on that picture. 5. The sort by size algorithm essentially takes aliens[j] and aliens[j+1] as parameters in the swapIt function, in order to sort the aliens based on their height and width. 6. The sort by closeness algorithm, does the same thing, but with located[j] and located[j+1] as parameters in the swapIt function, thus organizing the aliens based on where they were located in relation to one another. 7. Big O=O(n3)

Final Project

Project Code

Pre Lab

1. Write a description of your CS topic that you are trying to teach/demonstrate.

My specific topic is while loops, which I am trying to demonstrate/teach.

2. Write a description of how your program will engage the user.

Kid's love to play games, so I figured that I would make a number game through coding and while loops which will teach them that while they input a certain number the program will run certain functions.

3. Describe your process for developing your human-computer interface

I wanted to make an interface that was engaging to the middle school students. I used certain words that I knew would intrigue the public.

4. Describe how you will evaluate your human-computer interface.

I think that the children will know to guess again, but I could have put in the program, Guess again.

5. Describe how you will evaluate the user’s interaction.

I want them to figure out that they need to put input to change the course of the while loop, because if they do not change the input, the while loop will continue.

6. Write a description of how your program will collect user interaction

information

I know that I don't understand how to do that yet.

7. How will you generate an evaluation report based on the user data collected?

I will evaluate how many guesses it takes the user to guess the right number on average.