Question: 2 ) ( 2 5 points ) The door in the doorway egress problem can allow three robots at a time to exit. In the
points The door in the doorway egress problem can allow three robots at a time to exit. In the algorithm, robots arrange themselves so that each has a clear path to the door, and they then exit three at a time, with the three closest robots exiting simultaneously. Each robot must determine if it is among the three to exit. Construct a CortexM assembly program for a robot r to do the following. Robot r holds an array distance with the distance of each other robot to the center of the door. Let robotsseen hold the number of other robots. Variable owndistance holds the distance from r to the center of the door. Determine if r is one of the three closest robots. If so set variable exit to ; otherwise, set exit to Note: Each distance is an unsigned integer. We could instead consider each distance as a Q number, but that would not change the program. You can assume that no two distances are the same.
Demonstrate your results to the lab TA
Sample results for Part For the following inputs:
distance
robotsseen
owndistance
the following output is produced:
exit
If owndistance then exit
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
