Abstract the bachelor thesis
The thesis starts with the definition of general terms like graphics and physics engine and provides a closer view in examples of such engines. Afterwards this concept defines and explains the build of the robot and the for him developed kind of animation called 'force animation'. This special kind of animation allows the robot to perform specific motions. The following part shows the prototypical implementation of the concept.
Thereby it describes the construction of a virtual robot in a real-time physic simulation. This process is shown with the aid of the irrlicht engine. The robot is made from boxes which resemble the body parts and joints which connect them. It can execute 'force animations' by motors in these joints to move its body parts.
Two different methods for creating such animations are described. The first method describes the conversion of skeletal animation, the second method the usage of artificial intelligence. With the first method the robot succeeded in performing the desired motions, but only without gravity. By applying a genetic algorithm the robot is able to acquire simple animations by itself, which were indicated through prior rules, for example, jumping and maintaining the balance on one leg.
The Robot
The planned robot had three joints per side: shoulder, hip and ankle and is simulated in the physic engine PhysX. The hip joint cannot only rotate but also stretch and thus replaces the knee joint. The shoulder joint was removed during the development due to stability problems of the physic simulation.
The three different actions of the hip joint:
- rotating the leg forward/backward
- rotate the leg sideways
- stretch the leg
There is also an animated version of the robot without the connection to the physic engine. It was created in blender and is based on a conventional bone animation. Unlike the physics version it additionally contains a knee joint. After the import into the software, the animation of the knee joint is translated to the stretching value of the hip joint.
The artificial intelligence
The project contains two different methods of machine learning. In both cases the AI is able to carry out a certain action with a certain amount of force e.g. stretch the leg with a force of 100 newton. It is able to set every 0.04 seconds (time step) a new action. The hip joint is able to carry out 3 actions and the ankle 1 action. With both sides together it is able to carry out 8 actions per time step; 200 per second. If the AI can set a force as integer for every action between 0 and 999 and it tries to learn a 1 second long animation, it has to find the best solution out of 200000 possible solutions (8 actions * 1000 possible values * 25 steps per second).
Neuronal network:
A robot created in blender carries out a given animation. The neuronal network has to learn how to move the robot body parts to change the current pose to the next pose of the animation. To do that the neuronal network gets all the information about its current joint positions and the positions about the given animation. Now it learns to create with this information a valid output to follow the animation.
The neuronal network uses the library Encog (http://www.heatonresearch.com/encog).
The neuronal network uses the library Encog (http://www.heatonresearch.com/encog).
Genetic algorithm:
The AI gets a task like 'you are only allowed to touch the ground with one leg'. At the start of the algorithm the software creates multiple robots with a random movement pattern. Every robot carries out its random animation and the algorithm uses a score system to checks how well every robot performs.The robots with the best score are recombined (yes, they have sex^^) to create a new robot. The new child robot contains parts of the movement pattern of the two parents as well as a small percent of mutation - new randomly created movement patterns. The algorithm follows the steps score -> recombine -> mutate repeatedly (one generation) until a good match for the problem is found.
The algorithm was developed without any libraries.
The best results are created by the genetic algorithm. The video shows how the robot learns to keep its balance on one leg. The first part shows the result after one generation and the second after many generations (after more than one hour of practise).
The algorithm was developed without any libraries.
The best results are created by the genetic algorithm. The video shows how the robot learns to keep its balance on one leg. The first part shows the result after one generation and the second after many generations (after more than one hour of practise).
The software
The software is programmed in C++ and uses C++/CLI and C# to interact with Encog, a C# AI library that is used to create the neuronal network. Furthermore, it uses the physics engine PhysX to simulate the robot and the Irrlicht Engine to draw everything.
No comments:
Post a Comment