Describe your robot: My robot's name is Juliana. She is a talented beeper
Describe yourself: While I don't know much about Computer Science, I'm excited to be learning it at USC. I play tennis and ski and I'm from Denver, Colorado.
After a bit of confusion, the sensors received correct signals and displayed them on Juliana's screen perfectly. yay
Erik's robot
Daria's Robot
Zach's Robot
:
It was a cloudy in September when Juliana successfully used all five of her sensors, as well as "if", "while", and "for" statements to avoid obstacles and increase her general awesomeness.
Here's the code!
My robot drew a Fibonacci Spiral!
The Code
Prelab
1. After displaying the battery level using the robot.getBattery sensor in the terminal, my robot will use the robot.getLight sensors to ensure the lights are on and, using an If statement to ensure this is true or an else statement if it isnât the robot will display different texts to the terminal. After this, the robot will make sure nothing is in front of it using the robot.getObstacle sensor and it will use a While statement to play âIâm Shipping Up to Bostonâ until I block the obstacle sensor, forcing the robot to go to the next step of the talent show.
2. Using the If and Else statement to check the robot.getLine sensor, the IR sensors will be displayed on the terminal along with unique texts for the output of the Line sensors. After passing an If statement that ensures the battery has enough power to continue, a For statement is used to repeat a series of four actions five times to create one complete star out of five separately made parts.
3. For the surprise, I will use the rand function to generate a random integer. If the integer is greater than ten, the robot will drive forward, spin clockwise, and play an E then and F#. If the integer is not greater than ten, the robot will drive backwards, spin counterclockwise, and play an F# then an E. The robot will then disconnect.
4. My robotâs performance will transition from the song to drawing stage by myself manually blocking the Obstacle sensor and it will transition from the drawing stage to the surprise stage when it completes the For statement of drawing the star. The performance will end when the robot concludes the If or Else statement in which it goes forward or backward and spins clockwise or counterclockwise.
The code for those who want to read it
header file
header file and song!
// Talents.cpp
#include #include #include #include #include #include #include "Talents.h"
using namespace std;
int main(int argc, char ** argv)
{
//Song
cout << "Battery Level is" << endl;
cout << robot.getBattery() << endl;
if (robot.getLight("center")!=0)
{cout << "Lights are on, time to start the show!" << endl;
}
else {
cout << "Why is it so dark in here?" << endl;
}
while (robot.getObstacle("center")==0) {
boston();
}
// Drawing
if (robot.getLine()[0]!=0) {
cout << "Here's what my IR sensors see!" << endl;
cout << robot.getIR()[0] << endl;
cout << robot.getIR()[1] << endl;
}
else {
cout << "The getLine Sensors are really inaccurate, but here is what my IR sensors see" << endl;
cout << robot.getIR()[0] << endl;
cout << robot.getIR()[1] << endl;
}
if (robot.getBattery()>=6.2)
{
for (int n=0; n<=4; n++) {
robot.forward(.7,1);
robot.turnLeft(1.9,1);
robot.forward(.8,1);
robot.turnRight(.38,1);
}
// surprise
}
cout << "Now for the Surprise!" << endl;
srand(time (NULL));
int randInt = rand() % 51;
if (randInt >= 10)
{
cout << "Holy Moly! The number generated by randInt is greater than ten!" << endl;
robot.forward(1,2);
robot.turnRight(1,7);
robot.beep(.3, 1318.51),(.3, 659.26); /*E*/
robot.beep(.15, 1479.98); /*F#*/
}
else {
cout << "By the beard of Zeus! The number generated by randInt is less than 10!" << endl;
robot.backward(1,2);
robot.turnLeft(1,7);
robot.beep(.15, 1479.98); /*F#*/
robot.beep(.3, 1318.51),(.3, 659.26); /*E*/
disconnect();
return 0;
}
} //
Video of the Talent
Today, Julianna learned how to come Alive, be a Coward, be Agressive, Love, and be Timid.
Here's the code!
My group consisted of Daria Caraway, Paige Kehoe, Erik Strattman, and myself
Prelab
1. There will be an if loop with user input options for choices of movement, left, right, back, or forward. After the loop is broken by a stop command, the robot will play the USC fight song.
2. The line following behavior utilizes the line sensors to follow a line beneath the robot. To do this, the robot frequently checks the data returned by the line sensors. If both sensors detect a line, the robot is directly atop the line and so it continues forward. If only the right or left sensor detects a line, the robot is beginning to stray and so turns to position both sensors over the line. If neither sensor detects a line, the robot turns in place in a last-ditch effort to recover the line.
3. The robot drives forward until the obstacle sensor sees an obstacle, then it will continue going until it is up against the obstacle. It will then look left, check for an obstacle, and if there is one it will check right and go forward.
â¨4. The robotâs algorithm for the fastest drawer is first to figure out the most efficient way to draw the shape (without retracing any lines). We will then figure out the speed of the robot so we can know how long it takes to travel 3 inches (the length of a small triangle) and also the time it takes for the robot to turn 60 degrees. Then the robot will draw the figure using the robot.turnLeft and robot.turnRight commands as well as the robot.forward command to navigate the drawing.
5. The terminal will ask for the user to input a, b, c, or d and each letter will correspond to one of the functions mentioned above. Code!
Teammates
Erik Strottman Paige Kehoe Daria Caraway
1. My team will split up into four quadrants of the room and thoroughly search their respective areas by sweeping through them back and forth. The robot’s movement is controlled by user input, and the sensors are all checked immediately after starting the program.
2. My robot will negotiate obstacles based on the user’s judgment because the robot’s movement is controlled by the user.
3. The robot will locate the lost scribbler by feeding the user pictures of the environment and the user will decide what the robot should do next in locating the scribbler.
4. When a scribbler is located, it will be marked on the map in regards to how far the scribbler has moved from a central location. The center will be found by taking into account the pictures taken and where the walls are in them.
Teammates
Erik Strottman Paige Kehoe Daria Caraway
1. With my program, I am trying to demonstrate to the students how difficult it is for engineer at NASA to command the Mars Rover because they only have small windows of time to actively control it. Everything else the robot does must be either autonomous or told in advance. I am trying to get the student to visualize what the robot should do in advance, just like the NASA engineers.
2. My program engages the user because it will essentially be a game played with the robot. The user will put their input and responses to questions in the terminal, and the robot will react accordingly on the obstacle course.
3. My human computer interface will be developed through the use of easy to understand prompts I have written in the terminal as well as an optional instruction manual at the beginning of the program that the user can choose to read or skip over.
4. My human computer interface will be evaluated in my ratings text file based off of the number of commands the user gave throughout the program. This will illustrate how clear my instructions were and how easy the interface is to understands.
5. At the end of the program, the user will be asked to rate the usability and enjoyment of the program on a scale from one to five.
6. My program collects user interaction information by incrementing a counter variable every time a new command is entered into the terminal until the obstacle course is completed.
7. The evaluation report will be generated by outputting the number of commands, as well as the user’s ratings of the program, to a text file that can be looked at later.