Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Homework R Write a function that takes as inputs a robot location and a terrain Map. The Map is a grid like the one from
Homework R 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) Wite 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) BVML3811 Homework R 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) Wite 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) BVML3811
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started