October 03, 2022

Programming exercises to understand robotics

 AI and robotics is mostly described as programming technique or as an algorithm. The question is which sort of program provides AI, or which sort of AI library is available? The surprising situation is, that AI is located in a different position. It has to do with with a programming exercise.

Some typical Non AI programming exercises are:
- "Write a software in python which prints out 6 randomly generated numbers"
- "Write a python program which plots a line on the screen"
- "write a java program which adds two numbers and prints the result on the screen"

These exercises are used to a teach programming and a certain programming language at the university. It depends on the student how to solve it. AI and robotics is some sort of advanced programming exercises which can be labeled as ultra-hard. The question is which sort of AI programming exercise is available? A possible challenge is given next.




There is a robot in a maze which can be controlled with the keyboard. The task is to write a grounded sensor for the robot which contains of 6 elements:
[xpos,ypos,distancefront, distanceleft,distanceright,distancetoenergy]

The sensor array should be printed to the screen all the time.

Such a programming exercise fits into the same category like "write a program which prints out all the prime numbers" because it formulates a problem which can be solved with an algorithm. The task for the student is to understand the problem, write a short program in Python or Java and then it can be determined if the software solves the task.

From an abstract point of view it is important to ask which sort of programming exercises are needed to explain the subject of robotics. What all these challenges have in common is, that not a certain algorithm is needed but a certain exercise. The formulated problem with the sensor array doesn't contain of program code nor an algorithm. But is a figure plus a text which formulates a problem. It is up to the opponent (the student) to provide an answer to the problem. The answer is written in a certain proramming language and will contain of an algorithm. In the concrete example, the typical answer will take the requested 6 elements from the underlying physics engine and in case of the distance value it has to be calculated from scratch. Then a print routine is needed to show the result on the screen.