Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C Program in Code blocks Write a function that takes as inputs a robot location and a terrain Map The Map is a grid

"Using C Program in Code blocks"image text in transcribed

Write a function that takes as inputs a robot location and a terrain Map The Map is a grid like the one from activity 3 and each cell has a number associated with a terrain type (0-asphalt, 1-grass, 2-sand). Your function should return a string associated to the gait to be employed by the robot e.g., slow, medium, fast void getGait(int x, int y, int *terrainMap, char* gaitSpeed) " Write a second function getLocalTerrain, which takes as inputs the current x,y robot location and the terrain map. The function should return the predominant terrain surrounding the robot. That is you need to look at all neighboring cells (N,S,E,W when applicable) and select the terrain that shows up the most. If there are ties, choose the worst terrain type. int getLocalTerrain(int x, int y, int *terrainMap) EML 3811 Homework Use the following terrain map for testing 0 Write a function that takes as inputs a robot location and a terrain Map The Map is a grid like the one from activity 3 and each cell has a number associated with a terrain type (0-asphalt, 1-grass, 2-sand). Your function should return a string associated to the gait to be employed by the robot e.g., slow, medium, fast void getGait(int x, int y, int *terrainMap, char* gaitSpeed) " Write a second function getLocalTerrain, which takes as inputs the current x,y robot location and the terrain map. The function should return the predominant terrain surrounding the robot. That is you need to look at all neighboring cells (N,S,E,W when applicable) and select the terrain that shows up the most. If there are ties, choose the worst terrain type. int getLocalTerrain(int x, int y, int *terrainMap) EML 3811 Homework Use the following terrain map for testing 0

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

More Books

Students also viewed these Databases questions

Question

=+Measures of Excellence in Technical Documents 7

Answered: 1 week ago

Question

When should you avoid using exhaust brake select all that apply

Answered: 1 week ago

Question

Distinguish between filtering and interpreting. (Objective 2)

Answered: 1 week ago