Question: An autonomous robot is being designed to step through a simple 2D obstacle course (that is a flat maze). For each step, the robot scans

An autonomous robot is being designed to step through a simple 2D obstacle course (that is a flat maze). For each step, the robot scans three points: to the left, in front, and to the right. The robot stores the results of the scan in a 1x3 vector (v) where each cell is occupied by either a 0 if no wall is scanned or a 1 if a wall is scanned (See Figure 1 in your Portfolio for an example). When there is no wall is in front of the robot, then the robot continues to step forward. When the front of the robot is blocked, then the robot turns to face the direction without a wall present. If the robot could turn left or right, then it chooses a random direction. When the robot reaches a dead end, the robot turns by 180 degrees and steps back the way it came.An autonomous robot is being designed to step through a simple 2D

Function Overview autonomous robot is being designed to step through a simple 2D obstacle course (that is a flat maze). For each step, the robot scans three points: to the left, in front, and to the right. The robot stores the results of the scan in a 1x3 vector (v) where each cell is occupied by either a 0 if no wall is scanned or a 1 if a wall is scanned (See Figure 1 in your Portfolio for an example). When there is no wall is in front of the robot, then the robot continues to step forward. When the front of the robot is blocked, then the robot turns to face the direction without a wall present. If the robot could urn left or right, then it chooses a random direction. When the robot reaches a dead end, the robot turns by 180 degrees and steps back the way it came Write a MATLAB function that checks both requirements of the vector v fron Part B of your portfolio. If v is in the correct format, then the code will output a 1, if v is in the incorrect format, then the code will output a 0 Function Inputs v- the input vector describing obstacle data. Function Outputs alidity - Should equal 1 if the input vector meets the requirements (ie. is valid), and 0 if the input vector does not meet the requirements. Function Template function Validity - input_requirements(v) % INSERT CODE HERE end Function Examples input_requirements([1,0,1]) should return 1. input_requirements ([2,e,1,0]) should return e. dditional Notes Useful functions and commands include: if, elseif, else

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!