Question: Problem 2. Robot traversal (10 points) Your boss wants a robot to traverse a room without colliding with any objects. To see if this task
Problem 2. Robot traversal (10 points) Your boss wants a robot to traverse a room without colliding with any objects. To see if this task is feasible, your boss asks you to simulate such a robot. In this problem, refer to the directions as North, East, South, and West. The goal of the simulation is to have the robot (white pixel) move from the North side of the room to the South side while avoiding the objects (dark gray pixels). The simulated robot moves by adding a vector [v, h] to its current position, where v and h represent the vertical and horizontal directions respectively The North-west pixel of the room has coordinates [1, 1], and the South-east pixel has coordinates [vSize, hSize], where vSize and hSize are provided in the code. (i) The framework of the simulation is provided in nav.m. Without changing the code, run nav.m by pressing F5, and answer the following questions: What does loc keep track of? . In what direction should the robot move based on line 14 (adding [1, o)? . Add a new object at [4, 7]. Explain what happens and why . If the robot were implemented based on the current state of the simulation, briefly explain why this robot would not be considered an intelligent system. (ii) Uncomment the if statement and explain how this improved robot handles the object you placed at [4, 7]. Assuming that the function detectObject() can be practically implemented using sensors, briefly explain how this improved robot is a more intelligent system than the robot in part() Save the path of the simulated robot as an image once it reaches the goal and include it with your report. (ii) Add another object at [5, 5. Modify the code to solve this new case. The robot can only move one unit at a time (i.e. one move per iteration of the while loop), and it cannot move diagonally. Do not introduce any new variables or functions, and do not hard-code a solution. Only modify the logic in nar.m between the START and STOP comments. Save the path of the simulated robot as an image once it reaches the goal and include it in your report. (iv) Finally, add another object at [5, 7]. Modify the code once again to solve this new case. The same rules apply - The robot can only move one unit at a time (ie. one move per iteration of the while loop), and it cannot move diagonally. Do not introduce any new variables or functions, and do not hard-code a solution. Only modify the logie in nav.m between the START and STOP comments. Save the path of the simulated robot as an image once it ches the goal and include it in your report. Hint: You may use the function havelBeenfHere Before() that we have provided. In your report, include: . Answers to all questions above in no more than 2 sentences each Images showing the path of the simulated robot once it reaches the goal for parts (). (ii) and (iv) Problem 2. Robot traversal (10 points) Your boss wants a robot to traverse a room without colliding with any objects. To see if this task is feasible, your boss asks you to simulate such a robot. In this problem, refer to the directions as North, East, South, and West. The goal of the simulation is to have the robot (white pixel) move from the North side of the room to the South side while avoiding the objects (dark gray pixels). The simulated robot moves by adding a vector [v, h] to its current position, where v and h represent the vertical and horizontal directions respectively The North-west pixel of the room has coordinates [1, 1], and the South-east pixel has coordinates [vSize, hSize], where vSize and hSize are provided in the code. (i) The framework of the simulation is provided in nav.m. Without changing the code, run nav.m by pressing F5, and answer the following questions: What does loc keep track of? . In what direction should the robot move based on line 14 (adding [1, o)? . Add a new object at [4, 7]. Explain what happens and why . If the robot were implemented based on the current state of the simulation, briefly explain why this robot would not be considered an intelligent system. (ii) Uncomment the if statement and explain how this improved robot handles the object you placed at [4, 7]. Assuming that the function detectObject() can be practically implemented using sensors, briefly explain how this improved robot is a more intelligent system than the robot in part() Save the path of the simulated robot as an image once it reaches the goal and include it with your report. (ii) Add another object at [5, 5. Modify the code to solve this new case. The robot can only move one unit at a time (i.e. one move per iteration of the while loop), and it cannot move diagonally. Do not introduce any new variables or functions, and do not hard-code a solution. Only modify the logic in nar.m between the START and STOP comments. Save the path of the simulated robot as an image once it reaches the goal and include it in your report. (iv) Finally, add another object at [5, 7]. Modify the code once again to solve this new case. The same rules apply - The robot can only move one unit at a time (ie. one move per iteration of the while loop), and it cannot move diagonally. Do not introduce any new variables or functions, and do not hard-code a solution. Only modify the logie in nav.m between the START and STOP comments. Save the path of the simulated robot as an image once it ches the goal and include it in your report. Hint: You may use the function havelBeenfHere Before() that we have provided. In your report, include: . Answers to all questions above in no more than 2 sentences each Images showing the path of the simulated robot once it reaches the goal for parts (). (ii) and (iv)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
