辅导案例-MTRX1702
2019/10/28 (11) MTRX1702 – Assessments https://edstem.org/courses/3530/assessments/5900 1/8 Maze Navigation In robotics a major challenge when exploring the world is successfully navigating ( nding and following a path) through an environment. One simple method for doing this is to construct a sequence of waypoints in the physical environment and then to traverse them in sequence. You have been given a set of environments (mazes) that have been kindly represented as images so that they are easier for you to work with. As a robot programmer it is your job to read an image, interpret it as a set of waypoints that will enable your robot to travel around inside the maze, and then nd a sequence of waypoints through a maze between a nominated start location and a nominated nish location. One such environment (maze) is shown below. The black lines represent impassable walls, whereas the white (actually light grey in the gure) areas between the walls represents free space that can be navigated by the robot. The maze has a one pixel wide black border that should be treated as the 'edge of the world' and should not be traversed. The red line represents a valid path through the maze, constructed as a directed sequence of waypoints. Coordinates are indexed from the bottom left of the image and the starting position will always be the pixel 1,1 in the bottom left hand corner. Approach to the Problem The task can be split into three nearly independent sub-tasks. 1. Reading the BMP le: A BMP le has a 'header' containing information on the image, immediately followed by the actual image data. You are to extract information from this header and decode the image data. More information on the BMP image encoding is included following assignment Speci cation. Examples of the information to be displayed are provided below. 2. Encoding the BMP le: After reading the bitmapped image you need to encode it as a matrix such that the maze can be displayed in human-readable form. The depiction of the maze will include its walls and corridors and the start and nish locations within the maze. In preparation for solving the maze ( nding the shortest path from the start location to the 2019/10/28 (11) MTRX1702 – Assessments https://edstem.org/courses/3530/assessments/5900 2/8