Project 1 Dr.KofiNyarko,AssociateProfessorŸ5200PerringParkwayŸSchaeferEngineeringBuildingŸRoom223 Baltimore,Maryland21251ŸTel: XXXXXXXXXXŸFax: XXXXXXXXXXŸ XXXXXXXXXX EEGR 409: C...

the assignment must be coded in C using Visual studios code


Project 1 Dr.KofiNyarko,AssociateProfessorŸ5200PerringParkwayŸSchaeferEngineeringBuildingŸRoom223 Baltimore,Maryland21251ŸTel:443-885-3476ŸFax:724-298-1202Ÿ[email protected] EEGR 409: C Programming Applications Project 1.1 Objective: A technology company is developing a new search and rescue robot designed to autonomously navigate through an area and visually inspect every navigable pathway. Your company has been contracted to develop the navigation logic for this robot in C. Since it will be terribly inefficient to develop the C logic and implement directly on the robot for testing, you need to come up with a simple simulation environment which you will use for testing and visualization. The objective for project 1 is to design this simulation environment to read the map from a text file and display on the screen while implementing simple navigation logic to move the simulated robot through the simulated environment. Phase 1: Read and display the map A text file called map_1.txt is available on Canvas. When you open and view this file in notepad or some other text editor, you should see something similar to the figure below. The location of the Xs indicates where the robot can travel. Everything else represents where the robot cannot travel. Start by creating symbolic constants for the height and width of the map (#define), which is 78 by 22 respectively. Download the “map_1.txt” file from Canvas and place it in the same folder as your .c file. Open and read the file in your c code. If the file can’t be opened for whatever reason (i.e. the file is not found), display an appropriate message and end the program. If the file can be opened, then proceed to read in each character from the file. If the character read is not an X, display a hash mark (#), otherwise display a space. Lastly, display the starting point of the robot at coordinate position 2, 12 with an “at” symbol (@). Dr.KofiNyarko,AssociateProfessorŸ5200PerringParkwayŸSchaeferEngineeringBuildingŸRoom223 Baltimore,Maryland21251ŸTel:443-885-3476ŸFax:724-298-1202Ÿ[email protected] Extra Credit: Instead of using hash marks, use symbols from the ASCII table or the Unicode table. Unicode is an alternative to ASCII that works on more systems (like the Mac) because it is internationally recognized, while the entire ASCII set is not. Look up how to print Unicode characters online. Pick a suitable block Unicode symbol from https://www.unicode.org/charts/PDF/U2580.pdf and replace the hash symbol with the selected Unicode block symbol. (+10) Create a border around the map using the appropriate border symbols from https://en.wikipedia.org/wiki/Box-drawing_character#Unicode. (+10) Look up how to add color to your output and pick a distinct color for the borders, background, and the robot’s symbol. (+10) Dr.KofiNyarko,AssociateProfessorŸ5200PerringParkwayŸSchaeferEngineeringBuildingŸRoom223 Baltimore,Maryland21251ŸTel:443-885-3476ŸFax:724-298-1202Ÿ[email protected] Phase 2: Simple Robot Movement Simulation As a precursor to implementing robot navigation logic, simply move the robot’s position from the starting point mentioned in phase 1 to the end of the passageway. With each movement, show the path traveled by placing a period (.), or other appropriate Unicode symbol. In order to do so more easily, you can position the cursor (the insertion point for the next character to be printed) by using this parameterized macro (which should be placed at the start of the program) #define gotoxy(x,y) printf("\033[%d;%dH", (y), (x)) Hence, by stating gotoxy(5, 12), you can move the cursor in the output window to column 5, row 12. Use this capability to move the robot’s symbol without having to redraw the entire map. In addition, show the current position of the robot at the bottom of the map. The robot’s position should be updated after the enter key is pressed. See the output video on Canvas for the desired behavior. Grading Rubric: • Able to read each character in the map with verification that file can be opened (50 pts) • Able to display the correctly formatted map with block characters using symbolic constants of map width and/or height (15 pts) • Able to display the robot’s position with appropriate symbol (10 pts) • Able to animate the robot’s movement to the end of the passageway (25 pts) • Able to correctly use Unicode/ASCII characters for the map blocks (+10 pts) • Able to correctly use Unicode/ASCII characters to create borders (+10 pts) • Able to use different colors for borders, map blocks and robot position (+10 pts) Please see the instructions on Canvas concerning the requirements for assignment video submissions X X X X X X X X X X XXXXXXXXXXXXX X X X X X X X X X X XXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX X X X X X X X X X X X X X X X X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Project 1.2 Dr.KofiNyarko,AssociateProfessorŸ5200PerringParkwayŸSchaeferEngineeringBuildingŸRoom223 Baltimore,Maryland21251ŸTel:443-885-3476ŸFax:724-298-1202Ÿ[email protected] EEGR 409: C Programming Applications Project 1.2 Objective: Advance project 1.1 by enabling the robot to move through the map by way of explicit turn by turn direction. Phase 1: New Method to Store and Display Map Rather than displaying the map directly from reading in the file, create a function ReadMap to read the map file and store the value 1 in a double dimensioned array wherever the X appears in the map. The first dimension of the array corresponds to the map row (or y axis), and the second dimension corresponds to the map column (or x axis). This double dimensioned array should be initialized to all 0s when it declared in the main function. This is the expected header for the ReadMap function: int ReadMap(int map[MAP_HEIGHT][MAP_WIDTH]) Note that MAP_HEIGHT and MAP_WIDTH are symbolic constants. The function returns “true” if it is
Oct 17, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here