📜 ⬆️ ⬇️

Group artificial intelligence for Oracle SQL XE stacker robots

image It’s good to think about robots and artificial intelligence during off-hours in front of a home computer and a cup of coffee. And it is quite another thing when you are faced with the need to develop high-level software for a robotic warehouse in a short time. And at the same time practical experience in this subject area is completely absent, but there is a rich theoretical one . You say that a smart person should not be in a similar situation. Well, maybe you are right, but life is very complicated and non-linear thing. So when my friend, the director of a company producing iron for robotic warehouses, complained to me that the previous high-level software developer had thrown them (he took an advance payment, fed breakfast for a long time, and then completely disappeared in an unknown direction) - I promised to think that here you can do.

Robotic warehouse


A few words about hardware (ASK - automated warehouse complex), for which it was necessary to develop high-level software. Perhaps some of the readers will disagree with the statement that the device in the photo above is a robot. It is more like a kind of machine: two rails are installed below and above, along which the robot moves with a sliding platform. On the left and right there are racks with cells in several levels (up to 12 meters high). Goods are stored in standard inexpensive containers of various sizes. A stacker robot can ride on rails, load a container from a specific cell, and unload a container into a specific cell. Details can be found on the manufacturer's website www.vind.ru.

Meditations


As I said, I had no practical experience in artificial intelligence, or in the control of robots. However, there was a great experience in DBMS and in various visualization systems. Low-level software for the robots themselves was written in C #. I had people on the team with a lot of experience in C #. Therefore, it was logical to use C # to develop a module that will communicate with robots.
The previous pseudo-developer used Oracle SQL server as a DBMS. We had a great experience with this server, so we decided to leave this particular server for the DBMS.
However, I was overcome with doubts - but will my team cope? Therefore, we decided to try to make a small piece at first - we called it the stacker server . This server actually had only one command - to move the container from one cell to another. The difficulty was that the cells could be located in different sub-warehouses, or in circular sub-warehouses with two robots. The previous developer stumbling block became the constant collisions of robots and the ineffectiveness of the chosen course of action.
')

Stacker server


The module of interaction with robots was written quite easily. Remembering my past experience with any glands, I decided to first of all implement an emulator and a sensible visualizer of a robotic warehouse. Well, it’s not possible to debug the algorithm on live robots - the number of collisions they can withstand is strictly limited. The emulator for one robot was already at the manufacturers of robots, and they kindly provided me with the source code in C #. As for the visualizer, our fellow developers of low-level software for robots had strong doubts that it could be implemented theoretically at all. However, after several days of meditation, the form below showed itself somehow.
image
That is, the visualizer shows the ASC as if from above, while the employment of the robot is highlighted by various animation effects from WPF . The found form of visualization was so liked by everyone that it was decided to use it at all levels, including marketing, when designing commercial proposals.

Favorite triggers from Oracle


The basic logic of the work of the ASC is the control of the state machine (so it seems that we were called this at lectures in the university). There is a set of warehouse conditions, and you need to switch the system between different states depending on a specific set of conditions. And for these purposes, Oracle SQL server turned out to be an ideal development tool. Triggers from Oracle made it possible to quickly and conveniently program the entire logic of the warehouse. Debugging was very convenient. It turns out that it is incredibly pleasant to work when the matmodel of the domain correlates well with the matmodel of the development tool.
There were still doubts about the speed of Oracle - the volume of the database was small, but the number of table change operations reached sometimes 20 per second. However, Oracle did not fail here, even free Oracle SQL XE.

Difficulties


All this idyll lasted until it was the turn to write the module of effective control of two robots on the same circular path. It seemed that something simpler - there is a common resource (rail), there is a rule for its allocation. But how to make a decision - which robot to carry out which team and in which direction? After a week of treading on the spot, I suddenly found that such words as the choice of strategy, decision making, the best way, and so on, came into our everyday life. And the understanding came that we seriously wandered into the marsh of artificial intelligence, from which we had to get out as quickly as possible. Time was limited. Remembering the institute course (remembering the good words of their teachers), that in case of problems with time, developers in tasks with artificial intelligence resort to an imitation model and a brute force method, he decided to do the same. It may not be quite beautiful, but it will definitely work.

Decision visualizer


However, even the simulation of such an uncomplicated system with two robots on the same rail proved to be a very difficult task. The number of various options for the behavior of the system grew, almost exponentially, and, starting from some point, the developer no longer understood the course of simulation. I had to realize one thing, the mention of which I met except in V. Pelevin in his anti-aircraft codes from Al-Efesbi : a decision-making visualizer . That is, since as a result of simulation modeling, the system often made non-optimal decisions, and it was necessary to understand where the error was, and debugging in real time was not an option - everything changed every second, then in the decision-making process (no more than 1 second), the system generated easy-to-read text file. The graphics in it were drawn with text symbols - again, not cool, but it allowed the developer to modify the visualizer itself and track and correct errors quite quickly.

Success


As a result of the incredible tension of the forces of our entire team, we were able to implement high-level software to control robots within the specified time frame. After some reflection, I called it “ group artificial intelligence for stacker robots” , since it is this which makes the actions of robots pseudo-conscious, aimed at the realization of a given goal. The development of a decision-making visualizer was a watershed in the entire project. We understood that we can do similar systems, and they work. Although after that there were a number of problems (for example, the conceptualization of the interaction of the ASC with the specific information system of the Customer for the purpose of unification), but these problems were already solved in the usual working order. If it will be interesting, I will tell about these moments in more detail in the following topics.
And what else turned out to be interesting - not all my programmers were able to work precisely on the artificial intelligence module of the system. Despite more than 10 years of programming experience. Apparently, the task of imagining oneself is not even a robot, but a group of robots, which can only be solved by programmers with a certain mindset. True, those professionals who worked especially intensively on the artificial intelligence module were haunted by nightmares for some time, as if they were palletized robots who could not find their optimal way.

disadvantages


Despite the fact that the system has been implemented and has been successfully operating for more than six months already, I perfectly see some of the shortcomings of the created product. First of all, I would like to hire mathematics and try to make a classical mathematical model of the work process of the stacker robots. However, as I remember from the institute course, not every task from simulation modeling has a solution in the form of mathematical formulas.
Also, there are thoughts to do everything on a full-fledged object-oriented approach. Because of the limitations of time, I often had to fall back on writing classical procedures and functions.
Still there is an idea to get acquainted with the world practical experience in creating such systems. However, quickly nothing was found. Maybe this is the strictest developer know-how, or I don’t know the necessary keywords?

Conclusion


I will not say trivial words about the inevitability of the robotization of the entire national economy. I will say easier. In my opinion, it will take another 10 years, and at least 30% of existing warehouses around the world will be robotized. For a variety of reasons, and not only because of economic feasibility (increased storage density and reduced staff). And I will be pleased to realize my small contribution to this process in the direction of ridding a person of routine work.

Source: https://habr.com/ru/post/155303/


All Articles