Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part B (Based off week 3 workshop content) An autonomous robot is being designed to step through a simple 2D obstacle course (that is a

image text in transcribed
Part B (Based off week 3 workshop content) 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: in front, to the left 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 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. 1. Write an algorithm that determines whether the input vector,v is in the correct format (must be a 1 x 3 vector containing only ones and zeros). 2. (AMS Submission) Convert the algorithm from question 1 to a MAT- LAB function. 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. The function should accept a single input v. 3. Write an algorithm that determines which direction the robot should step (assuming v is in the correct format). 4. (AMS Submission) Convert the algorithm in question 3 to a MAT- LAB function. The code should accept a single input v and output a number 1, 2, 3 or 4 for 'go straight', 'turn left', turn right' or 'turn around' respectively. Fig. 1. The robot has just taken a step, it scans the three directions around it and finds no wall to the left, a wall directly ahead and a wall to the right, it then stores this information in the vector v- [0,1,1]. The robot will then decide to turn left with an output of 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago