Question

In: Computer Science

In RVW complete the following Sensor Challenges: Hand in your code for each challenge (you can...

In RVW complete the following Sensor Challenges: Hand in your code for each challenge (you can paste into one document)

Try – it Forward until Touch Move the robot to the obstacle.  Once the robot touches the obstacle it stops

Vacuum Challenge – Using the touch sensor, the robot needs to touch all four walls in the room

Arm Position Classic - For this challenge, The robotic arm is configured with the Touch Sensor attached so that it when the arm is fully upright the button on the Touch Sensor is pushed in.   The starting point of the challenge has an object approximately 5 rotations length away from the robot. Starting with the arm in the ‘down’ position, program the robot to raise its arm until the touch sensor is pushed in, move forward 5 rotations, lower the arm around the object, and then bring the object back to the starting location.

Threshold Value - Using the Ultrasonic Sensor, set the threshold value so that the robot plays a sound when it detects an object within 10cm of the sensor.

Backward until far - Place a robot close to a wall with the Ultrasonic Sensor facing directly at it. Program the robot to move backward until the Ultrasonic Sensor reads a value greater than 30cm, and then stop.

Submit to Blackboard:

A document that contains your code for each of the above challenges.  

Click on the badges icon to view your badges. In the same document, a screen shot of the badges earned to show you completed the challenges successfully. Although the screen shot below shows two challenges completed, yours should have five completed.

Solutions

Expert Solution

soln: try it

task main()

{

repeat(forever)

{

setMotorSpeed(leftMotor , 60);

setMotorspeed(rightMotor,60);

waitUntil(getTouchValue(touchSensor) == 1);

{

setMotorSpeed(leftMotor , 0);

setMotorspeed(rightMotor,0);

}

}

}

answer 2:

task main()

{

repeat(forever)

{

setMotorSpeed(leftMotor , 60);

setMotorspeed(rightMotor,60);

waitUntil(getTouchValue(touchSensor) == 1);

turnRight(90 ,degrees , 60);

{

waitUntil(getTouchValue(touchSensor) == 1);

turnRight(90 ,degrees , 60);

{

waitUntil(getTouchValue(touchSensor) == 1);

turnRight(90 ,degrees , 60)

{

waitUntil(getTouchValue(touchSensor) == 1);

turnRight(90 ,degrees , 60)

}

}

}

}

answer abc:

task main()

{

repeat(forever)

{

setMotorSpeed(leftMotor , 60);

setMotorspeed(rightMotor,60);

waitUntil(getTouchValue(touchSensor) == 1);

{

waitUntil(getDistanceValue(Ultrasonic Sensor) == 10);

{

ap.loadSoundSet("Aldebaran");
fileId = ap.post.playSoundSetFile("filename");

}

setMotorSpeed(leftMotor , 0);

setMotorspeed(rightMotor,0);

waitUntil(getDistanceValue(Ultrasonic Sensor) == 10);

{

movereverse (waitUntil(1,getDistanceValue(Ultrasonic Sensor) == 30);

}

}

}


Related Solutions

A company claims to have invented a hand-held sensor that can detect the presence of explosives...
A company claims to have invented a hand-held sensor that can detect the presence of explosives inside a closed container. Law enforcement and security agencies are very interested in purchasing several of the devices if they are shown to perform effectively. An independent laboratory arranged a preliminary test. If the device can detect explosives at a rate greater than chance would predict, a more rigorous test will be performed. They placed four empty boxes in the corners of an otherwise...
THIS IS FOR ARDUINO PROGRAMMING Write code that checks the sensor data and meets the following...
THIS IS FOR ARDUINO PROGRAMMING Write code that checks the sensor data and meets the following conditions: For night conditions, turn on white LED 1 For day conditions, turn off white LED 1 Code should check intervals every 5 seconds. NEED THE BELOW CODE TO FIT THE ABOVE REQUIREMENTS. const int lightSensor = 5; //light sensor variable float sensValue = 0; //variable to hold sensor readings const int button = 3; //pin for button reads const int LED1 = 5;...
Use R to complete the following questions. You should include your R code, output and plots...
Use R to complete the following questions. You should include your R code, output and plots in your answer. 1. Two methods of generating a standard normal random variable are: a. Take the sum of 5 uniform (0,1) random numbers and scale to have mean 0 and standard deviation 1. (Use the properties of the uniform distribution to determine the required transformation). b. Generate a standard uniform and then apply inverse cdf function to obtain a normal random variate (Hint:...
Use R to complete the following questions. You should include your R code, output and plots...
Use R to complete the following questions. You should include your R code, output and plots in your answer. 1. Two methods of generating a standard normal random variable are: a. Take the sum of 5 uniform (0,1) random numbers and scale to have mean 0 and standard deviation 1. (Use the properties of the uniform distribution to determine the required transformation). b. Generate a standard uniform and then apply inverse cdf function to obtain a normal random variate (Hint:...
Please complete following c++ code asap using following prototypes complete each missing part / Linked list...
Please complete following c++ code asap using following prototypes complete each missing part / Linked list operations int getLength() const {return length;} void insertNode(College); bool deleteNode(string); void displayList() const; bool searchList(string, College &) const; }; main.cpp /*   Build and procees a sorted linked list of College objects. The list is sorted in ascending order by the college code. Assume that the college code is unique. */ #include <iostream> #include <fstream> #include <string> #include "LinkedList.h" using namespace std; void buildList(const string...
Use Python to Complete the following on a single text file and submit your code and...
Use Python to Complete the following on a single text file and submit your code and your output as separate documents. For each problem create the necessary list objects and write code to perform the following examples: Sum all the items in a list. Multiply all the items in a list. Get the largest number from a list. Get the smallest number from a list. Remove duplicates from a list. Check a list is empty or not. Clone or copy...
Can you complete the tasks inside the sample code. All the to-do task is inside the...
Can you complete the tasks inside the sample code. All the to-do task is inside the code commented out. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> typedef struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; }node; /*Task 1 - Complete the function below, newNode() will return a tree node*/ node* newNode(int key){ } /*Task 2 - Complete the function below to return the size (number of elements stored) of a binary tree*/ int size(node* root){ }...
Short description of your assigned challenge Describe the innovation you researched to address the challenge The...
Short description of your assigned challenge Describe the innovation you researched to address the challenge The result (what did it prove?) How/Why it impacts or supports the challenge the challenge is "make Solar energy economical"
Complete the following task in C++. Separate your class into header and cpp files. You can...
Complete the following task in C++. Separate your class into header and cpp files. You can only useiostream, string and sstream. Create a main.cpp file to test your code thoroughly. Given : commodity.h and commodity.cpp here -> https://www.chegg.com/homework-help/questions-and-answers/31-commodity-request-presented-two-diagrams-depicting-commodity-request-classes-form-basic-q39578118?trackid=uF_YZqoK Create : locomotive.h, locomotive.cpp, main.cpp Locomotive Class Hierarchy Presented here will be a class diagram depicting the nature of the class hierarchy formed between a parent locomotive class and its children, the two kinds of specic trains operated. The relationship is a...
Complete the following task in C++. Separate your class into header and cpp files. You can...
Complete the following task in C++. Separate your class into header and cpp files. You can only use iostream, string and sstream. Create a main.cpp file to test your code thoroughly. Given : commodity.h and commodity.cpp here -> https://www.chegg.com/homework-help/questions-and-answers/31-commodity-request-presented-two-diagrams-depicting-commodity-request-classes-form-basic-q39578118?trackid=uF_YZqoK Given : locomotive.h, locomotive.cpp, main.cpp -> https://www.chegg.com/homework-help/questions-and-answers/complete-following-task-c--separate-class-header-cpp-files-useiostream-string-sstream-crea-q39733428 Create : DieselElectric.cpp DieselElectric.h DieselElectric dieselElectric -fuelSupply:int --------------------------- +getSupply():int +setSupply(s:int):void +dieselElectric(f:int) +~dieselElectric() +generateID():string +calculateRange():double The class variables are as follows: fuelSuppply: The fuel supply of the train in terms of a number of kilolitres...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT